Download Android App of sapabap-vamsi

sapabap-vamsi : Download Android App for Mobiles

Wednesday, August 31, 2011

Displaying Logo in ALV Grid


Logo should be uploaded into application server using transaction 'OAER'.
  1. Go to Transaction OAER,
  2. Give Class Name as PICTURES
  3. Class type as OT
  4. Object Key as the name of the Object u want to specify
  5. Upon execution you would be prompted to give the file path details. Just upload which ever logo u want to display
  6. Now you can use the same name in your ALV FM
In your ALV program, you need to have event for TOP_OF_PAGE, and also this works only in case of Grid not in ALV LIST.

Look at the sample code to display LOGO.

**********************

call function 'REUSE_ALV_GRID_DISPLAY'
exporting
  i_callback_program = i_repid
  it_fieldcat = header
  is_layout = gt_layout
  i_callback_top_of_page = 'TOP-OF-PAGE1'
  i_grid_title = xyz
  it_sort = gt_sort[]
  i_default = 'X'
  i_save = 'U'
  is_variant = gt_variant
  it_events = gt_events
tables
  t_outtab = t_output.

*****************

*-------------------------------------------------------------------*

* Form TOP-OF-PAGE1

*-------------------------------------------------------------------*

form top-of-page1.

data: header type slis_t_listheader,
      wa     type slis_listheader.

* TITLE AREA

wa-typ = 'S'.
wa-info = text-h04.
append wa to header.

wa-typ = 'S'.
write sy-datum to wa-info mm/dd/yyyy.

concatenate text-h03 wa-info into wa-info separated by space.
append wa to header.

wa-typ = 'S'.
concatenate text-h02 sy-uname into wa-info separated by space.
append wa to header.

wa-typ = 'S'.
concatenate text-h01 sy-repid into wa-info separated by space.
append wa to header.

********" LOGO

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = header

i_logo = 'ENJOYSAP_LOGO'.

*********" LOGO

endform.

Here in TOP-OF-PAGE form it will show you the Prog name,Date, User Name.

Tuesday, August 30, 2011

ALV Fatal Error - GUI Cannot be reached


This Tutorial gives us a procedure to track most common occurring error in ALV and in an easy way.

Purpose: This document details about the common problem faced by many consultants: “Fatal Error – GUI cannot be reached” in ALV Grid Control. 


Pre-requisites: The reader of this Tutorial is assumed to have some basic knowledge regarding ALV and ALV grid controls. 


The problem:
SAP® has provided us with some demo programs on ALV. We would use one of them in our scenario. BCALV_GRID_DEMO is the demo program provided by SAP® for ALV Grid Control. When you execute the program in foreground, you get the similar following output:
 
When you schedule the same program in background, your job is cancelled due to an error. Screenshot of the same is shown below:
 


Reason:
ALV Grid control is based on the custom controls on the screen. When the program is scheduled in background, it tries to create GUI related front-end objects and hence the error “Fatal Error – GUI cannot be reached”. This type of problem is common with all the programs that use the ALV grid control to display the output. 

Solution:
Whenever we execute this type of programs in background, we should be passing a blank docking container instead of the custom container as parent to our grid control. 

The docking container doesn’t need any of the custom controls on the screen; instead it attaches an area to any or all of the four edges of the screen (top, left, right or bottom). The behavior of the areas in the container is determined by the sequence in which they are initialized. Docking Containers are attached to the screen from the inside out. This means that when you create a second container, it is attached to the edge of the screen, and the container that was already there is pushed outwards. 

Let us modify the standard program (by taking a copy of it) to enable it to execute it in background.

Following modifications have to be made:

·        Define a docking container in the program
data: or_doc  type ref to cl_gui_docking_container .

·        At the time of creating a custom container, check if the program is being executed in background or foreground. If the program is scheduled in background, then create a docking container instead of custom container.

if cl_gui_alv_grid=>offline( ) is initial.
    create object or_custom_container
           exporting container_name = c_container.
  create object or_grid
         exporting i_parent = or_custom_container.
else .
create object or_grid
         exporting i_parent = or_doc .
endif . 

Now test executing the program in background. The report would be generated.

Monday, August 29, 2011

Getting started with Smart Forms (Building a simple application)...


Go to transaction “Smartforms”.

 

Enter a name for the form and click on Create.  

Enter a short description for the form. 

 

In this example, we will print a simple text using our form. To create a text, expand “Pages and Windows” à New Page. Select Main Window and Right click on that. Select Create à Text

 

Give a name to the text and short description. 

Also enter the text you want to see on the form. 

 

SAVE and Activate the Smart form. 

To know the function module that is generated upon activation of this smart form, click on Environment à Function module name. 

 

Following popup with the function module would appear. 

 

Test the smart form by clicking on Test. You would be navigated to the function builder with the function module defaulting to the one that is generated earlier. 

 

Click on execute. 

 

Since we do not have any parameters to pass on, click on Execute. 

Saturday, August 27, 2011

A demo program to create subscreen in your ABAP Program..."Last Login Details"


* This report will display the user last login date and time.
*
* Subscreen selection 1 : User Name
* 2 : Last Login Date
* 3 : Class Belong To
*
* Written by : SAP Basis, ABAP Programming and Other IMG Stuff
* http://sapabap-vamsi.blogspot.com/
*

REPORT ZSUBSCREEN.

TABLES: USR02, "Logon data
SSCRFIELDS. "FIELDS ON SELECTION SCREENS
*---------------------------------------------------------------
* SUBSCREEN 1
*---------------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-010.
SELECT-OPTIONS: USERNAME FOR USR02-BNAME.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN END OF SCREEN 100.

*---------------------------------------------------------------
* SUBSCREEN 2
*---------------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-020.
SELECT-OPTIONS: LASTLOGI FOR USR02-TRDAT.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN END OF SCREEN 200.

*---------------------------------------------------------------
* SUBSCREEN 3
*---------------------------------------------------------------
SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-030.
SELECT-OPTIONS: CLASSTYP FOR USR02-CLASS.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN END OF SCREEN 300.

* STANDARD SELECTION SCREEN FOR SCROLLING LEFT AND RIGHT
SELECTION-SCREEN: FUNCTION KEY 1,
FUNCTION KEY 2.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK SUB FOR 15 LINES,
END OF BLOCK SUB.

START-OF-SELECTION.
SELECT * FROM USR02 WHERE BNAME IN USERNAME
AND ERDAT IN LASTLOGI
AND CLASS IN CLASSTYP.
WRITE: / 'User ', USR02-BNAME,
'Last Login Date ', USR02-TRDAT,
'Last Login Time ', USR02-LTIME,
'CLASS ', USR02-CLASS.
ENDSELECT.
END-OF-SELECTION.

INITIALIZATION.
* SCREEN ICON LEFT AND RIGHT
SSCRFIELDS-FUNCTXT_01 = '@0D@'.
SSCRFIELDS-FUNCTXT_02 = '@0E@'.
SUB-PROG = SY-REPID.
SUB-DYNNR = 100.

AT SELECTION-SCREEN.
CASE SY-DYNNR.

WHEN 100.
IF SSCRFIELDS-UCOMM = 'FC01'.
SUB-DYNNR = 300.
ELSEIF SSCRFIELDS-UCOMM = 'FC02'.
SUB-DYNNR = 200.
ENDIF.

How to download internal table into an Excel file?


Use the function module SAP_CONVERT_TO_XLS_FORMAT to download the internal table to an excel file.

PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'c:\tmp\test.xls'.
DATA: t100_Lines TYPE STANDARD TABLE OF t001 WITH DEFAULT KEY.

SELECT * FROM t001 INTO TABLE t100_Lines.

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
  i_filename     = p_file
TABLES
  i_tab_sap_data = t100_Lines.

SAP Reports 2...

Q: What are the types of messages?
A: A message can have five different types.  These message types have the following effects during list processing:
A (=Amend):
E (=Error) or W (=Warning):
I (=Information):
S (=Success): 
Q: What are the drill-down features provided by ABAP/4 in interactive lists?
A: ABAP/4 provides some interactive events on lists such as AT LINE-SELECTION (double click) or AT USER-COMMAND (pressing a button). You can use these events to move through layers of information about individual items in a list. 
Q: What is meant by stacked list? 
A: A stacked list is nothing but secondary list and is displayed on a full-size screen unless you have specified its coordinates using the window command. 
Q: Is the basic list deleted when the new list is created? 
A: No.  It is not deleted and you can return back to it using one of the standard navigation functions like clicking on the back button or the cancel button. 
Q: What is meant by hotspots? 
A: A Hotspot is a list area where the mouse pointer appears as an upright hand symbol. When a user points to that area (and the hand cursor is active), a single click does the same thing as a double-click.  Hotspots are supported from R/3 release 3.0c. 
Q: What is the length of function code at user-command? 
A: Each menu function, push button, or function key has an associated function code of length FOUR (for example, FREE), which is available in the system field SYUCOMM after the user action. 
Q: Can we create a GUI status in a program from the object browser? 
A: Yes.  You can create a GUI STATUS in a program using SET PF-STATUS. 
Q: In which system field does the name of current gui status is there? 
A: The name of the current GUI STATUS is available in the system field SY-PFKEY. 
Q: Can we display a list in a pop-up screen other than full-size stacked list?
A: Yes, we can display a list in a pop-up screen using the command WINDOW with the additions starting at X1 Y1 and ending at X2 Y2 to set the upper-left and the lower-right corners where x1 y1 and x2 y2 are the coordinates. 
Q: What is meant by hide area? 
A: The hide command temporarily stores the contents of the field at the current line in a system-controlled memory called the HIDE AREA.  At an interactive event, the contents of the field are restored from the HIDE AREA. 
Q: When they get cursor command used in interactive lists? 
A: If the hidden information is not sufficient to uniquely identify the selected line, the command GET CURSOR is used.  The GET CURSOR command returns the name of the field at the cursor position in a field specified after the addition field, and the value of the selected field in a field specified after value. 
Q: How can you display frames (horizontal and vertical lines) in lists? 
A: You can display tabular lists with horizontal and vertical lines (FRAMES) using the ULINE command and the system field SY-VLINE.  The corners arising at the intersection of horizontal and vertical lines are automatically drawn by the system.
Q: What are the events used for page headers and footers? 
A: The events TOP-OF-PAGE and END-OF-PAGE are used for pager headers and footers. 
Q: How can you access the function code from menu painter? 
A: From within the program, you can use the SY-UCOMM system field to access the function code.  You can define individual interfaces for your report and assign them in the report to any list level.  If you do not specify self-defined interfaces in the report but use at least one of the three interactive event keywords.  AT LINE-SELECTION, AT PF<nn>, OR AT USER-COMMAND in the program, the system automatically uses appropriate predefined standard interfaces.  These standard interfaces provide the same functions as the standard list described under the standard list. 
Q: How the at-user command serves mainly in lists? 
A: The AT USER-COMMAND event serves mainly to handle own function codes.  In this case, you should create an individual interface with the Menu Painter and define such function codes. 
Q: How to pass data from list to report? 
A: ABAP/4 provides three ways of passing data:
---Passing data automatically using system fields
---Using statements in the program to fetch data
---Passing list attributes 
Q: How can you manipulate the presentation and attributes of interactive lists? 
A: ---Scrolling through Interactive Lists.
---Setting the Cursor from within the Program.
---Modifying List Lines. 
Q: How to call other programs? 
A: Report                                                  Transaction
Call and return        SUBMIT AND RETURN                      CALL TRANSACTION
Call without return   SUBMIT                                          LEAVE TO TRANSACTION
You can use these statements in any ABAP/4 program. 
Q: How many lists can a program can produce? 
A: Each program can produce up to 21 lists: one basic list and 20 secondary lists.  If the user creates a list on the next level (that is, SY-LSIND increases), the system stores the previous list and displays the new one.  Only one list is active, and that is always the most recently created list.

SAP Reports 2...

Q: What are the types of messages?
A: A message can have five different types.  These message types have the following effects during list processing:
A (=Amend):
E (=Error) or W (=Warning):
I (=Information):
S (=Success): 
Q: What are the drill-down features provided by ABAP/4 in interactive lists?
A: ABAP/4 provides some interactive events on lists such as AT LINE-SELECTION (double click) or AT USER-COMMAND (pressing a button). You can use these events to move through layers of information about individual items in a list. 
Q: What is meant by stacked list? 
A: A stacked list is nothing but secondary list and is displayed on a full-size screen unless you have specified its coordinates using the window command. 
Q: Is the basic list deleted when the new list is created? 
A: No.  It is not deleted and you can return back to it using one of the standard navigation functions like clicking on the back button or the cancel button. 
Q: What is meant by hotspots? 
A: A Hotspot is a list area where the mouse pointer appears as an upright hand symbol. When a user points to that area (and the hand cursor is active), a single click does the same thing as a double-click.  Hotspots are supported from R/3 release 3.0c. 
Q: What is the length of function code at user-command? 
A: Each menu function, push button, or function key has an associated function code of length FOUR (for example, FREE), which is available in the system field SYUCOMM after the user action. 
Q: Can we create a GUI status in a program from the object browser? 
A: Yes.  You can create a GUI STATUS in a program using SET PF-STATUS. 
Q: In which system field does the name of current gui status is there? 
A: The name of the current GUI STATUS is available in the system field SY-PFKEY. 
Q: Can we display a list in a pop-up screen other than full-size stacked list?
A: Yes, we can display a list in a pop-up screen using the command WINDOW with the additions starting at X1 Y1 and ending at X2 Y2 to set the upper-left and the lower-right corners where x1 y1 and x2 y2 are the coordinates. 
Q: What is meant by hide area? 
A: The hide command temporarily stores the contents of the field at the current line in a system-controlled memory called the HIDE AREA.  At an interactive event, the contents of the field are restored from the HIDE AREA. 
Q: When they get cursor command used in interactive lists? 
A: If the hidden information is not sufficient to uniquely identify the selected line, the command GET CURSOR is used.  The GET CURSOR command returns the name of the field at the cursor position in a field specified after the addition field, and the value of the selected field in a field specified after value. 
Q: How can you display frames (horizontal and vertical lines) in lists? 
A: You can display tabular lists with horizontal and vertical lines (FRAMES) using the ULINE command and the system field SY-VLINE.  The corners arising at the intersection of horizontal and vertical lines are automatically drawn by the system.
Q: What are the events used for page headers and footers? 
A: The events TOP-OF-PAGE and END-OF-PAGE are used for pager headers and footers. 
Q: How can you access the function code from menu painter? 
A: From within the program, you can use the SY-UCOMM system field to access the function code.  You can define individual interfaces for your report and assign them in the report to any list level.  If you do not specify self-defined interfaces in the report but use at least one of the three interactive event keywords.  AT LINE-SELECTION, AT PF<nn>, OR AT USER-COMMAND in the program, the system automatically uses appropriate predefined standard interfaces.  These standard interfaces provide the same functions as the standard list described under the standard list. 
Q: How the at-user command serves mainly in lists? 
A: The AT USER-COMMAND event serves mainly to handle own function codes.  In this case, you should create an individual interface with the Menu Painter and define such function codes. 
Q: How to pass data from list to report? 
A: ABAP/4 provides three ways of passing data:
---Passing data automatically using system fields
---Using statements in the program to fetch data
---Passing list attributes 
Q: How can you manipulate the presentation and attributes of interactive lists? 
A: ---Scrolling through Interactive Lists.
---Setting the Cursor from within the Program.
---Modifying List Lines. 
Q: How to call other programs? 
A: Report                                                  Transaction
Call and return        SUBMIT AND RETURN                      CALL TRANSACTION
Call without return   SUBMIT                                          LEAVE TO TRANSACTION
You can use these statements in any ABAP/4 program. 
Q: How many lists can a program can produce? 
A: Each program can produce up to 21 lists: one basic list and 20 secondary lists.  If the user creates a list on the next level (that is, SY-LSIND increases), the system stores the previous list and displays the new one.  Only one list is active, and that is always the most recently created list.

SAP Reports...


Q: What are SAP reports?
A: SAP Reports are event-driven programs using ABAP/4 programming language. These reports are used to fetch business-specific data from SAP standard databases under specified selection criteria, fetched data is processed to display result on output screen. User develop SAP report object on ABAP editor using the standard SAP transaction SE38.
QWhat are ABAP report types?
AABAP report types are of 7 types. ABAP report types are available in report’s attributes screen.
Executable program
Function group (containing function modules) 
Include 
Interface pool 
Class pool
Module pool
Subroutine pool
Q: How many lists can be displayed through an interactive report?
A: Maximum 21 lists can be displayed (1 basic list+ 20 secondary lists).
Qwhat is the event that will be triggered first in an ABAP report?
AInitialization event is triggered first if user executes an ABAP report. But if the program is of type 1, M, F, or S; then LOAD-OF-PROGRAM is triggered first and then INITIALIZATION event.
QWhat are the differences between simple and interactive ABAP reports?
AA simple ABAP report allows the user to interact with the whole business-result data. In case of interactive reports user can interact with specific result data at a time.
Q: How do you read selected lines of database table into an internal table in packages of predefined size?
A: SELECT * FROM <SPFLI>INTO TABLE <ITAB>PACKAGE SIZE<N>.
Where n is variable.
Q: How do you write a DATA object from ABAP/4 program to ABAP/4 memory and restore the same from memory to program.
A: EXPORT <f1>[FROM <g1>]<f2>[FROM <g2>]…. TO MEMORY ID <key>.
The ID <key>, which can be up to 32 characters long, identifies the data in memory.
Q: Name the function modules to write data from an Internal Table to the Presentation Server.
A: DOWNLOAD and WS_DOWNLOAD.
Q: How to determine the attributes of an internal table?
A: DESCRIBE TABLE <itab>[LINES <lin>] [OCCURS <occ>].
Q: What is interactive reporting?
A: It helps you to create easy-to-read lists.  You can display an overview list first that contains general information and provide the user with the possibility of choosing detailed information that you display on further lists.
Q: What are the uses of interactive reporting?
A: The user can actively control data retrieval and display during the session.  Instead of an extensive and detailed list, you create a basic list with condensed information from which the user can switch to detailed displays by positioning the cursor and entering commands.  The detailed information appears in secondary lists.
Q; what are the event key words in interactive reporting?
A: Event Keyword                                  Event
AT LINE-SELECTION                Moment at which the user selects a line by double clicking on it or by positioning the cursor on it and pressing F2.
AT USER-COMMAND                Moment at which the user presses a function key.
TOP-OF-PAGE DURING            Moment during list processing of a 
LINE-SELECTION                    Secondary list at which a new page starts.
Q: What is secondary list?
A: It allows you to enhance the information presented in the basic list.  The user can, for example, select a line of the basic list for which he wants to see more detailed information.  You display these details on a secondary list.  Secondary lists may either overlay the basic list completely or you can display them in an extra window on the screen.  The secondary lists can themselves be interactive again. 
Q; How to select valid lines for secondary list?
A: To prevent the user from selecting invalid lines, ABAP/4 offers several possibilities.  At the end of the processing block END-OF-SELECTION, delete the contents of one or more fields you previously stored for valid lines using the HIDE statement.  At the event AT LINE-SELECTION, check whether the work area is initial or whether the HIDE statement stored field contents there.  After processing the secondary list, clear the work area again.  This prevents the user from trying to create further secondary lists from the secondary list displayed.
Q: Can we call reports and transactions from interactive reporting lists?
A: Yes.  It also allows you to call transactions or other reports from lists.  These programs then use values displayed in the list as input values.  The user can, for example, call a transaction from within a list of change the database table whose data is displayed in the list.
Q: What are system fields for secondary lists?
A: SY-LSIND   Index of the list created during the current event (basic list = 0)
SY-LISTI         Index of the list level from which the event was triggered.
SY-LILLI         Absolute number of the line from which the event was triggered.
SY-LISEL        Contents of the line from which the event was triggered.
SY-CUROW    Position of the line in the window from which the event was triggered 
SY-CUCOL     Position of the column in the window from which the event was triggered          
SY-CPAGE      Page number of the first displayed page of the list from which the event was triggered.
SY-STARO      Number of the first line of the first page displayed of the list from which the event was triggered (counting starts with 1).  Possibly, a page header occupies this line.
SY-STACO      Number of the first column displayed in the list from which the event was triggered
SY-UCOMM    Function code that triggered the event.
SY-PFKEY       Status of the displayed list. 
Q: What are the page headers for secondary lists?
A: On secondary lists, the system does not display a standard page header and it does not trigger the event. TOP-OF-PAGE.  To create page headers for secondary list, you must enhance TOP-OF-PAGE: Syntax TOP-OF-PAGE DURING LINE-SELECTION.  The system triggers this event for each secondary list.  If you want to create different page headers for different list levels, you must program the processing block of this event accordingly, for example by using system fields such as SY-LSIND or SY-PFKEY in control statements (IF, CASE).

Friday, August 26, 2011

How to trace a long running batch job?


Now imagine the following situation. You are the administrator of a production system, and you encounter in the Process Overview (transaction sm50) a batch process, which already has been running several days and has been selecting data from a database table. This process is blocking other background jobs and you have to find out what this process is actually doing:


You can find this out very easily with the ABAP Runtime Analysis. You can use the ABAP Runtime Analysis (SE30) to trace programs which are running in a parallel session.
1. Ensure that you run SE30 on the same server as the running process!
2. You must create or adjust a trace variant for tracing the parallel process. Set aggregation to "None" again to get the Call Hierarchy.
3. Press the "Switch On/Off" button to trace processes running in a parallel session. The Runtime Analysis displays a list of the running processes similar to the Process Overview (transaction sm50).
4. Use the "Start measurement/End measurement" buttons to activate and deactivate trace.

Caution: Deactivate the trace again after short tracing time so that you do not reach the trace file quota! Before deactivating the trace, refresh the work process display. The dialog step that was active in the work process with the activated trace may have changed, and that deactivates the trace automatically.



5. Press "Evaluate" button to analyze trace results.



SAP ABAP Performance Tuning - Tools provided for Performance Analysis


Following are the different tools provided by SAP for performance analysis of an ABAP object

  1. Run time analysis transaction SE30
This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing. 

  1. SQL Trace transaction ST05
The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.


The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on the SPFLI table in our test program is mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.

The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.

To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.

SAP ABAP Performance Tuning - Use of selection criteria


Instead of selecting all the data and doing the processing during the selection, it is advisable to restrict the data to the selection criteria itself, rather than filtering it out using the ABAP code. 

Not recommended

            Select * from zflight.
             Check : zflight-airln = ‘LF’ and zflight-fligh = ‘BW222’.
            Endselect.

Recommended

            Select * from zflight where airln = ‘LF’ and fligh = ‘222’.
            Endselect.

One more point to be noted here is of the select *. Often this is a lazy coding practice. When a programmer gives select * even if one or two fields are to be selected, this can significantly slow the program and put unnecessary load on the entire system. When the application server sends this request to the database server, and the database server has to pass on the entire structure for each row back to the application server. This consumes both CPU and networking resources, especially for large structures.

Thus it is advisable to select only those fields that are needed, so that the database server passes only a small amount of data back.

Also it is advisable to avoid selecting the data fields into local variables as this also puts unnecessary load on the server. Instead attempt must be made to select the fields into an internal table.