Thursday, 17 November 2011

ABAP FAQ - 2


ABAP FAQ's


What is the difference between SAP memory and ABAP memory?
Answer1:
data sending between main sessions using get parameter and set parameter is sap memory
data sending between internal sessions using import or export parameters is abap memory

What is the difference between Table and Template?
table is a dynamic and template is a static

When do we use End-of-selection?
End-of-selection event are mostly used when we are writing HR-ABAP code. In the HR-ABAP code, data is retrived in the Start-of-selection event and Printing on the list and all will be done in End-of-selection event.

What is table buffer? Which type of tables used this buffer?
buffer is nothing but a memory area. table is buffered means that table information is available on application server. when you call data from database table it will come from application server.transperent and pooled tables are buffered. cluster tables can not buffered.


What is the difference between SAP memory and ABAP memory?
Answer1:
data sending between main sessions using get parameter and set parameter is sap memory
data sending between internal sessions using import or export parameters is abap memory

Answer2:
sap memory is a global memory whereas abap memory is local memory.

For example, we have four programs in abap memory and assigned some varibles to a particular program in abap memory then those varibles can't be used by anyother program in abap memory i.e., the variables are only for that program and also local to that memory,whereas sap memory can access all the abap memory or else it can perform any kind of modifications.

Answer3:
SAP memory is available to the user during the entire terminal session.
ABAP memory is available to the user during life time of external session.


What is the difference between Type and Like?
Answer1:
TYPE, you assign datatype directly to the data object while declaring.
LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.

Answer2:
Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the existing properties of already existing data object.

Answer3:
type refers the existing data type
like refers the existing data object


What is difference between dialog program and a report?
Report is a excecutable program
Dialog is a module pool program.It has to be executed via a transaction only.
Dialog programming is used for customization ofscreens



What is Field sysmbol ?
Answer1:
You can use field symbols to make the program more dynamic. In this exanmple the name of a table control is substituted by a field symbol. Thus you cal call the form with any internal table, using the name of the tablæe control as a parameter.
Example
form insert_row
using p_tc_name.
field-symbols type cxtab_control. "Table control
assign (p_tc_name) to .
* insert 100 lines in table control
-lines = 100.


Why BAPI need then BDC ?
BAPI"S provide the standard interface to other applications apart from SAP and within differnt vesions of SAP too. Also it is OOD bases so dosen"t depends on screen flow. BDC gets failed if we make changes for screen changes through IMG customization

What are the advantages and disadvantages of using views in ABAP porgramming ?
advantages:
view is used to retrieve the data very fastly from the database tables
*memory wastage is reduced
*faster than joins to retrieve the data from database tables
disadvantages:
view is not a container,it will not hold the data
*view memory is not permanent memory

How can you debugg a script form?
SE71 -> give the form name -> utilities -> activate debugger

Wednesday, 16 November 2011

GET & SET Parameter


ABAP/4 memory 

The contents of the ABAP/4 memory are retained only during the lifetime of an external session (see also Organization of Modularization Units). You can retain or pass data across internal sessions. The EXPORT TO MEMORY and IMPORT FROM MEMORY statements allow you to write data to, or read data from, the ABAP memory.


ABAP memory - Transfer data from program to program.
SAP Memory - transfer data from program to Transaction.

When you see 'Export and Import ' and it is ABAP memory'

When you see Set parameter id and get Parameter id and it is called SAP Memory

  1. SAP Memory is a global memory area which all sessions within a
    SAPgui have access to. This allows for passing data between
    sessions. The SET PARAMETER ID and GET PARAMETER ID statements are
    used to manipulate the SAP Memory.

    SET PARAMETER ID 'MAT' field p_matnr.
    GET PARAMETER ID 'MAT' field p_matnr.
     
  2. ABAP Memory is a memory area, which all programs in the call stack within the same internal session can access. The EXPORT and IMPORT
    statements are used here.

    export p_matnr = p_matnr to memory id 'ZTESTMAT'.
    import p_matnr = p_matnr from memory id 'ZTESTMAT'.

ABAP FAQ - 1


ABAP Frequently Asked Question
 
ABAP/4
Q: When we create a customer the information is updated in structure RF02D and the some tables like KNA1 are updated. How can we find the tables for master data transactions?
A: Go to ABAP Workbench -> Overview -> application hierarchy - SAP -> follow the customizing based tree for your application. Double click on a lowest hierarchy level to get for the correct marked development class. Here you can find all the tables, views, logical databases etc. used for a system operation. 


R F C 
Q: We want to move a SAP table to an Access table using TABLE_EXPORT_TO_MSACCESS_RFC
Importing parameters are
DBNAME
DEST
FLG_APPEND
FLG_POPUP
LANGU
The table has three columns: 
TABNAM
MANDT
SDATA
We have no Exporting parameters. 
How shall we set the parameters? 
A: Install the PS utilities, which are part of SAPGUI install CD. You may run report RIACCESS from SE38. Go to SALE -> Communication -> Define RFC Destination. Setup two RFC destinations PS_ACCESS_1 and PS_ACCESS_2 and will have to get them to point to wdpsastr.exe and wdpsatab.exe respectively. Then execute RIACCESS and choose PS_ACCESS_1 to generate access tables. Please note that Access only supports tables with up 255 fields.
Q: We want an RFC do the following transactions - MB1A, MB1C, >MB01 (Goods receipt/issue)
A: Call the RFC INBOUND_IDOC_PROCESS with IDOC_CONTROL and IDOC_DATA. The structure in the field sdata in the IDOC_DATA is e1mbxyh and e1mbxyi.

Transports
Q: In a Dev instance, we want to transport a modification to a layout set from one client to another. What is the best way?
A: use transaction SE71. Choose Utilities->Copy from Client. Layout sets need not be transported between clients, via transport requests DEVKxxxxxx.
Q: We need to keep track of the transports that need to flow through to other systems (i.e., DEV, TST, TRN, PRD etc). Is there a way do this?
A: SAPCRAFT enables you to control the CTS from DEV system. This keeps track of all transports at all stages and enables you to allocate Import, export and Authorization functions to specific user. 

E D I / IDOC
Q: 1 we created an EDI Vendor and created all required output conditions. However no IDOC is generated when PO is printed. Why?
A: Go to Header->output for the PO. The output type shall be '6'. The status shall be '1'. If the status is '0' check the timing. If the status is '2' , go to 'GOTO->Processing Log' and the explanation for non-generation of IDOC can be seen.
Q: How can we create / upload IDOC's from legacy system to SAP?
A: Third party tool Mercator may be used to convert Legacy files to Idoc format. Mercator provides an IDOC tree import facility, SAP provides the export facility. You can transfer the Idoc layouts from SAP to Mercator automatically and then map. 
Q: We want to receive an outbound EDI 855 IDOC only if E2EDP20 -scheduling confirmation segment is present. Else get an "error" status preventing triggering the EDI subsystem.
A: User exit logic has to be added in function IDOC_INPUT_ORDRSP.
# Set up a test flag and set it off when the IDOC header is read. 
# Turn the flag ON when the EDP20 segment is read. 
# Interrogate this flag when the next segment after EDP20 in the same IDOC comes in. If it is on, you have an EDP20 coming in. 
# Issue an error status 51 with suitable message for whichever condition you don't want the IDOC to be processed, This will stop the IDOC from posting.
Q: Wherever PO is sent to the vendor via EDI, we want an acknowledgement of the PO by vendor. Which fields are updated and what should be my procedure?
A: Execute Program: IDOC_INPUT_ORDRSP
Process code: ORDR
Message type: ORDRSP
IDOC: ORDERS01
The confirmation process allows the supplier to return an acknowledgment. Only Dates and quantities can be changed the information is stored in the PO and can be viewed via Item->Confirmation->Overview. The PO can be flagged as 'confirmation required' so that Pos without acknowledgement receipt can be monitored. Control keys and tolerances (days and quantities) have to be customized.

A L E
Q: Our IDOC remains in status 51 (not posted) while testing ALE setup by passing DEBMAS02 Idocs. The message 'Field KNA1-BRSCH is not an input field'. This is the Industry key. What are we missing?
A: Go to IMG - menu path IMG->Logistics General-> Logistics Basic Data: Business partners->Customers-> Control->Define Account groups and field selection for customer.
Select sold-to or ship-to. Select General Data. Select control and double click. Industry key is found here. Change the option to 'Optional Entry'.
Check OSS 5599. You may have to update view V_T078D also.

Batch In-put/ Direct In-put
Q: We are calling transaction VL01 in batch input to create deliveries using a program for delivery due list. How ever we are unable to create deliveries for transport stock orders. Why?
a: Batch-inputs can not be used to fill the "delivery due list" screen because it is not a dynpro. This is a standard SAP report. A SAP report (check with "System -> Status") may be called using SUBMIT sentence with the appropriate options . It is preferred to call a report than create a Batch-input program.
Q: What are some sample Direct input data transfer programs?
A: In MM for Material Master data - RMDATIND
FI - for Accounting Documents - RFBIBL00
PP - for Independent requirements - RM06IN00
CA - for Classification data - RCCLBI03

Handling Tables
Q: We specify the logical database. And we want a field that is not present in any of the tables defaulted in logical database. How can we want to add this additional field from a different table?
A: . Presume you have a 
Logical database 
Table 1
Table 2
Table 3
 
Define the required field as additional field say fld of table 1, table 2 or   table 3  
And then in the code section define.
 
Perform get_f1d (zxxxxxxx) using f1d.
Form zxxxxxxx could be like;
Form get_f1d-using f. 
Select * from where 'conditions'
f = table4 - f1d.
Q: We need to download an internal table to the Presentation Server (local workstation). Whenever we run the program, the same file has to be saved as a separate file in sequential order. Ex: 0001.txt, 0002.txt etc. Where can we store the last file number?
A: SAP has a table TVARV for storing the variants. 
A record may be created in TVARV for all the programs that require this kind of incremental records. 
For Ex: the record could be 100Zmm10001 MM sequence rec where first part consists of client code and the program being run. Client code is required because TVARV does not have a field for client code. The second part is the description indicating the purpose what the record is created. This entire string may be posted in the Name field (char - 30).
The Type field (char- 1) may be populated with P or S (Parameter or Selection)
Low field (char- 45) may be populated with '0001' when run first time and increment it by one in your program for downloading of the internal table. 

Others
Q: How can we use CAD with SAP?
A: Third party tools from Eigner + Partner provide interfaces to SAP. Another third party software - Fast look Plus from Kamel Software enables you to view all of the Autocad formats.
Q: How can I access SAP through Internet?
A: SAP has its own Internet transaction Server (ITS). Other products include Haht, Web Objects, Net Dynamics etc. Each product has its' own architecture. 
However to access the database, access paths SAP GUI or RFC Channel have to be used.
Q: How can we transport the standard text?
A: Refer note 3355 in OSS for a complete explanation. The SAP script objects that should be transported must be written in a transport request.
The entries are as follows:
R3TR FORM NAME (NAME = Name of the layout set) 
R3TR STYL NAME (NAME = Name of the style) 
R3TR TEXT OBJECT,NAME,ID,L 
(OBJECT = Text object, NAME = Text name, ID = Text ID, L = Text language)
If you want to transport a number of texts, you can use report RSTXTRAN to insert the individual text keys into a correction. The transport request must be entered and released via the transport system. 
Q: How to find what transactions a particular user was running for a given period in the past (Eg: from 1st of a month)
A: You may use the transaction - STAT. 
Q: We want protect/lock a field so that only selected people can change the value while others can only read. How to set the authorizations?
A: Create an authorization object for change mode. Loop at screen in the user exit and set input to 0. Check the user based on sy-uname and the authorization. Decide whether input should be 0 or 1.
Q: How to lock a user-defined transaction for some time during which no user can access the same?
A: Use transaction SM01. Scroll through the transactions and check against the transaction to be locked. And after the maintenance is over, go back to SM01 and uncheck the same to unlock.
ABAP Tips and Tricks
Find out in what all Tables a specified field is available.
You can find out through transaction code SE15.
1) Give SE15 on command prompt.
2) Select ABAP Dictionary
3) Select "fields" folder
4) Click on table fields
5) Then you can enter the desired field name (In your case EKGRP)
6) Run OR press F8.
The system will list out all the tables, which contain your desired field name.
Or
1) Using transaction Code SE11 (ABAP Dictionary)
2) enter the Data table name where in the respective field (EKGRP) is used eg; EKKO
3) Click the where -used list button
4) Check out the box (DB tables) only.
There you can see entire list of tables containing the desired field.
Here the difficulty is that one should know at least the name of the one of the data tables, which contains the desired field.
With Compliment by: Manohar TS & Kotha
**********
Find the Table Name For a Field.
I know couple of ways to find the table name for a field.
Like.
1. Part the cursor at the field and press F1 & F9.
2. Se84 or se15
3. St05 (sql trace).
4. Setting Break point in ABAP.
If you will tell other methods it will be appreciate.
**********
*
* How to print Apostrophe using the write statement
* for e.g. you'll be there.
*
Report zapostrophe message-id z1.
DATA: LINE (20).
CONCATENATE 'You''' 'll be there.' INTO LINE.
WRITE:/ LINE.
**********
 
**********
Given a transaction code, how can I find the menu path?
In 4.6c, you can used tcode search_sap_menu to find the SAP MENU tcode.
Please note that there are no tcode available to find the path of the IMG transaction.
**********
How to un-encrypt SAP user password?
It is not possible to un-encrypt the SAP password, because a one-way encoding (with strong 1024 bit key) is used for this. The result is stored and each time one has entered the password the encoding result is checked.
**********
When you delete an entry from an internal table in ABAP, the system has to re-generate the index for all entries after your delete, slowing the report if you have many records to eliminate.
It is much quicker to do an insert of the correct records into a second table than to delete entries from the first. The reason for this is because the index is only generated for the newest element.
**********
If you want to protect a program against debugging, you just have to set the STATUS = S in the attributes view of the main program.
**********
BDC.
When you use a call transaction, and populate the BDCDATA table.
Make sure you pass the "DATE FIELDS" of any transaction by formatting it as  "XX/XX/YYYY"  cos if you pick this data from database it will be of the format 20030505 or something like that. Make sure you pass this value as character field.
Same is true for the "Rate Fields". Make sure you pass them as "Character Fields" by formatting them.
**********
If you need to find out the Okcodes for BDC sessions, look for program RSBDCCUA and run it for any platform say 'WN' for windows or MC for Mac and it will generate list of function codes
**********
To save the contents of an internal table as a Microsoft Excel Worksheet when debugging code in SAP R/3 Enterprise:
1. Click on the "Table" button
2. Type in the name of your internal table in the "Internal table" field and hit Enter.
3. Hit CTRL + F11 or click on the "Save as Excel Worksheet" button.
4. Type in the record numbers that you want to save. (Ex. From Line: 1 To Line: 10) Hit Enter.
5. Save your file.
**********
Starts with a Z are homegrown program.
You cannot be sure that anything, which starts with a Z, is a homegrown program.
SAP provides a number of correction programs, especially within the archiving area, which start with a Z.
for e.g. ZZSTOCKL from note 202345.
**********
Can line-size of abap report large than 255?
You can have line-size up to 1023.
Along with Report statement pass the line-size as 1023.   Ex. Report xyz line-size 1023.
**********
How to find out the number of days between a given date, excluding Saturdays and Sundays and public holidays?
Try functions,
=> DATE_CONVERT_TO_FACTORYDATE
=> HR_HK_DIFF_BT_2_DATES
Testing and Debugging ABAP Codes, Functions
Could some one help me? I am looking out answers for the following questions:
Explain what sort of testing you would do on your own code?
What steps would you take to debug a function or report in SAP?
Tips by: Kiran
First test your code with '/h' type in command window which shall take you to debug or by putting break points with F8. You test your program from code and then go to se30 performance analysis transaction and there you can know what are the drawbacks. Then go to SLIN transaction and do extended syntax check or from code in menu options where you have debugging -> extended check and the program id ready without error.
Tips by: Harichand Chandunair 
Testing your code.
As mentioned above after doing syntax check and extended syntax check you have to create a TEST PLAN. You have to test all possible Positive & Negative test cases. 
Test for division by zero if it involves calculation or code accordingly. 
Try to test for field overflows. If it involves sap script or smart forms try to print outputs, which have single, page and also multiple pages and which does not have any output at all. 
Test by leaving all parameters in selection screen blank. 
Test by entering wrong values in selection screen and display a pop-up if the user enters wrong selection screen values.
You can also do ABAP trace and SQL trace to make sure that your program is efficient.
Debugging code/program.
As mentioned above type /h in command line and try to execute the program. Another way is to set break point at the function module or the required line and do single step execute or execute.  Once you finished debugging, you can select Delete to clear all the break points.
Testing and Debugging ABAP
Third option in certain cases is to check for sy-subrc <> 0 and proceed from there by making it 0 by updating the sy-subrc in the debug editor and see how the program behaves if the value is what you enterd in the debug screen. For certain case try to use WATCH POINT feature in debug editor. 
Internal table in ABAP
*An internal table is a run time instance.  It gets created when program starts execution.
*It gets destroyed when program terminates. it has two different parts.  Header Line (optional) & Body (Compulsory).
*Any value that comes to or goes from internals table, that travels through header line \
*A related program is.
*Declaration.
Data: begin of inernaltable occurs 0,
 x type c,
 y type I,
 end of itab.
*Initializing header line
 internal table-x = 'd'.
   Internal table-y = 34.
  
*Storing value into internal table
Append internal table. 
Append internal table.
Append internal table.
*Reading internal table
loop at itab.
   Write: / internal table-x, internal table-y.  "Writes to output list
end loop.
ABAP Tips by: Abdul Sayeed
Email: sayeed_mail2005@yahoo.com
Fields of Internal Tables
SY-TABIX
Current line of an internal table. The statements below, but only for index tables set SY-TABIX. The field is either not set or is set to 0 for hashed tables. 
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table. 
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE. 
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry. 
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string are found.
SY-TFILL
After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table. 
SY-TLENG
After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TLENG contains the length of the lines in the relevant internal table. 
SY-TOCCU
After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TLENG contains the initial amount of memory allocated to the relevant internal table.
List Box in ABAP Report
* List Box in ABAP Report
* Written by: SAP Basis, ABAP Programming and Other IMG Stuff
http://www.sap-img.com
 
REPORT ZLIST.
 
TYPE-POOLS: VRM.
 
DATA: NAME TYPE VRM_ID,
      LIST TYPE VRM_VALUES,
      VALUE LIKE LINE OF LIST.
 
PARAMETERS: PS_PARM (10) AS LISTBOX VISIBLE LENGTH 10.
 
AT SELECTION-SCREEN OUTPUT.
 
NAME = 'PS_PARM'.
VALUE-KEY = '1'.
 
VALUE-TEXT = 'LINE 1'.
APPEND VALUE TO LIST. VALUE-KEY = '2'.
 
VALUE-TEXT = 'LINE 2'.
APPEND VALUE TO LIST.
 
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
 
START-OF-SELECTION.
WRITE: / ‘PARAMETER:’ PS_PARM.
Example Code For Drill Down Report
REPORT zmm_rept_purchorderkkb01 LINE-SIZE 80
                                 LINE-COUNT 65(3)
                                 MESSAGE-ID z_msg_class
                                 NO STANDARD PAGE HEADING.
 
*------------------DECLARING THE STANDARD TABLES---------------------*
TABLES: ekko, "PURCHASE ORDER: HEADER
         ekpo. "PURCHASE ORDER: ITEM
 
*------------------DECLARING THE INTERNAL TABLE----------------------*
DATA: BEGIN OF it_ekko OCCURS 2,
          ebeln LIKE ekko-ebeln, "PURCHASE ORDER NUMBER
          Bukrs LIKE ekko-bukrs, "COMPANY CODE
          Bsart LIKE ekko-bsart, "PURCHASING DOCUMENT TYPE
          Lifnr LIKE ekko-lifnr, "VENDOR
          Spras LIKE ekko-spras, "LANGUAGE KEY
          Zterm LIKE ekko-zterm, "PAYMENT TERMS KEY
        End of it_ekko.
 
DATA: BEGIN OF it_ekpo OCCURS 2,
          Ebeln LIKE ekpo-ebeln, "PURCHASE ORDER NUMBER
          Ebelp LIKE ekpo-ebelp, "PURCHASE ORDER NUMBER
          Werks LIKE ekpo-werks, "PLANT
          Matnr LIKE ekpo-matnr, "MATERIAL NUMBER
          Matkl LIKE ekpo-matkl, "MATERIAL GROUP
        END OF it_ekpo.
 
DATA: it_ebeln LIKE ekko-ebeln OCCURS 0 WITH HEADER LINE.
 
*DATA: it_ebeln_high LIKE ekko-ebeln OCCURS 0 WITH HEADER LINE.
 
DATA: p_ebeln       TYPE i.
 
*------------------Declaring the selection screen--------------------*
 
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
 
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.
 
PARAMETER: p_limit TYPE i.
 
SELECTION-SCREEN END OF BLOCK blk1.
 
 
*INCLUDE z_incl_purorderkkb01_sub_f01.
 
 
*--------------------------------------------------------------------*
*  Validation for number of records to be printed                   *
*--------------------------------------------------------------------*
 
*AT SELECTION-SCREEN ON p_limit.
*  IF p_limit IS INITIAL.
*    MESSAGE e011.
*  ENDIF.
 
 
*  IF p_limit GT sy-linct.
*    MESSAGE e010.
*  ENDIF.
 
*----------------------------------------------------------------------*
*        Search help for purchase document number (s_ebeln-low)        *
*----------------------------------------------------------------------*
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_ebeln-low.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      Input  = s_ebeln-low
    IMPORTING
      Output = s_ebeln-low.
 
  Perform form_search_help.
 
  IF sy-subrc <> 0.
    CASE sy-subrc.
      WHEN 2.
        LEAVE TO SCREEN 1000.
    ENDCASE.
  ELSE.
    LOOP AT it_ebeln.
      IF sy-tabix = p_ebeln.
        S_ebeln-low = it_ebeln.
        EXIT.
      ENDIF.
    ENDLOOP.
  ENDIF.
 
*----------------------------------------------------------------------*
*        Search help for purchase document number (s_ebeln-high)       *
*----------------------------------------------------------------------*
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_ebeln-high.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      Input  = s_ebeln-high
    IMPORTING
      Output = s_ebeln-high.
 
  Perform form_search_help.
 
  IF sy-subrc <> 0.
    CASE sy-subrc.
      WHEN 2.
        LEAVE TO SCREEN 1000.
    ENDCASE.
  ELSE.
    LOOP AT it_ebeln.
      IF sy-tabix = p_ebeln.
        S_ebeln-high = it_ebeln.
        EXIT.
      ENDIF.
    ENDLOOP.
  ENDIF.
 
*----------------------------------------------------------------------
*                   Start-of-selection event                           
*----------------------------------------------------------------------
 
START-OF-SELECTION.
 
*----------------------To attach a user interface----------------------
 
SET PF-STATUS '0010'.
 
*---------To fetch the data for the basic list-------------------------
 
    SELECT ebeln                   "PURCHASE ORDER NUMBER
           Bukrs                   "COMPANY CODE
           Bsart                   "PURCHASING DOCUMENT TYPE
           Lifnr                   "VENDOR
           Spras                   "LANGUAGE KEY
           Zterm                   "PAYMENT TERMS KEY
     Up to p_limit rows
     Into table it_ekko from ekko
     Where ebeln in s_ebeln.
 
     REFRESH it_ekpo.
 
*---------To fetch the data for the secondary list---------------------
 
If it_ekpo is initial.
 
    SELECT ebeln "PURCHASE ORDER NUMBER
           Ebelp "PURCHASING DOCUMENT TYPE
           Werks "PLANT
           Matnr "MATERIAL NUMBER
           Matkl "MATERIAL GROUP
    FROM ekpo INTO TABLE it_ekpo for all entries in it_ekko
    WHERE ebeln EQ it_ekko-ebeln.
 
Endif.
 
*----------------------------------------------------------------------
*                   End-of-selection event                             
*----------------------------------------------------------------------
 
END-OF-SELECTION.
 
 
*---------To display the data for the basic list-----------------------
 
   Format color 4 intensified off.
  LOOP AT it_ekko.
    WRITE :/ sy-vline, it_ekko-ebeln UNDER text-002, 18 sy-vline,
                                                    "PURCHASE ORDER NUMBER
                       It_ekko-bukrs UNDER text-003, 27 sy-vline,
                                                    "COMPANY CODE
                       It_ekko-bsart UNDER text-004, 38 sy-vline,
                                                    "PURCHASING DOCUMENT TYPE
                       It_ekko-lifnr UNDER text-005, 50 sy-vline,
                                                    "VENDOR
                       It_ekko-spras UNDER text-006, 62 sy-vline,
                                                    "LANGUAGE KEY
                       It_ekko-zterm UNDER text-007, 80 sy-vline.
                                                    "PAYMENT TERMS KEY
 
  Hide: it_ekko-ebeln.
  ENDLOOP.
  WRITE :/ sy-uline (80).
 
*----------------------------------------------------------------------
*                To generate the detailed lists                        
*----------------------------------------------------------------------
AT LINE-SELECTION.
  CASE sy-lsind.
    WHEN 1.
      SET PF-STATUS '0011'.
 
*---------To display the data for the secondary list-----------------------*
WINDOW STARTING AT 10 10
       ENDING   AT 90 30.
    Format color 5 intensified off.
  LOOP AT it_ekpo where ebeln = it_ekko-ebeln.
    WRITE :/ sy-vline, it_ekpo-ebeln UNDER text-002, 15 sy-vline,
                                                     "PURCHASE ORDER NUMBER
                       It_ekpo-ebelp UNDER text-008, 30 sy-vline,
                                                     "PO ITEM NUMBER
                       It_ekpo-werks UNDER text-009, 45 sy-vline,
                                                     "PLANT
                       It_ekpo-matnr UNDER text-010, 60 sy-vline,
                                                     "MATERIAL NUMBER
                       It_ekpo-matkl UNDER text-011, 80 sy-vline.
                                                     "MATERIAL GROUP
  ENDLOOP.
 
  WRITE :/ sy-uline (80).
 
  ENDCASE.
 
  CASE sy-ucomm.
    WHEN 'EXIT' OR 'CANC' OR 'BACK'.
       LEAVE TO SCREEN 0.
  ENDCASE.
 
*----------------------------------------------------------------------
*                    At user-command event                             
*----------------------------------------------------------------------
 
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'SELE' OR 'LIST1'.
      IF sy-lsind = 1.
      SET PF-STATUS '0011'.
 
*---------To display the data for the secondary list-----------------------*
 
WINDOW STARTING AT 10 10
       ENDING   AT 90 30.
       Format color 5 intensified off.
 
  LOOP AT it_ekpo where ebeln = it_ekko-ebeln .
    WRITE :/ sy-vline, it_ekpo-ebeln UNDER text-002, 15 sy-vline, "PURCHASE ORDER NUMBER
                       It_ekpo-ebelp UNDER text-008, 30 sy-vline, "PO ITEM NUMBER
                       It_ekpo-werks UNDER text-009, 45 sy-vline, "PLANT
                       It_ekpo-matnr UNDER text-010, 60 sy-vline, "MATERIAL NUMBER
                       It_ekpo-matkl UNDER text-011, 80 sy-vline. "MATERIAL GROUP
 
  ENDLOOP.
 
  WRITE :/ sy-uline (80).
  Endif.
 
  ENDCASE.
 
  CASE sy-ucomm.
    WHEN 'EXIT' OR 'CANC' OR 'BACK'.
       LEAVE TO SCREEN 0.
 
  ENDCASE.
 
*----------------------------------------------------------------------*
*                    Top-of-page for basic list                        *
*----------------------------------------------------------------------*
 
TOP-OF-PAGE.
 
 Format color 3 intensified off.
 
  WRITE :/ sy-uline (80).
  WRITE :/ sy-vline,
           03 sy-repid,
           60 text-015,
              Sy-uname,
           80 sy-vline.
  WRITE :/ sy-vline, 03 sy-datum,
           35 text-012,
           60 text-014,
              Sy-pagno,
           80 sy-vline.
  WRITE :/ sy-uline (80).
  WRITE :/ sy-vline, text-002, 18 sy-vline, "PURCHASE ORDER NUMBER
                     Text-003, 27 sy-vline, "COMPANY CODE
                     Text-004, 38 sy-vline, "PURCHASING DOCUMENT TYPE
                     Text-005, 50 sy-vline, "VENDOR
                     Text-006, 62 sy-vline, "LANGUAGE KEY
                     Text-007, 80 sy-vline. "PAYMENT TERMS KEY
  WRITE :/ sy-uline (80).
 
*----------------------------------------------------------------------
*              Top-of-page for secondary list                          
*----------------------------------------------------------------------
 
TOP-OF-PAGE DURING LINE-SELECTION.
Format color 2 intensified off.
WINDOW STARTING AT 10 10
       ENDING   AT 90 30.
  WRITE :/ sy-uline (80).
  WRITE :/ sy-vline,
          03 sy-repid,
          60 text-015,
             Sy-uname,
          80 sy-vline.
 
  WRITE :/ sy-vline,
          03 sy-datum,
          35 text-013,
          60 text-014,
             Sy-pagno,
          80 sy-vline.
 
  WRITE :/ sy-uline (80).
 
  WRITE :/ sy-vline, text-014, 15 sy-vline, "PURCHASE ORDER NUMBER
                     Text-008, 30 sy-vline, "PO ITEM NUMBER
                     Text-009, 45 sy-vline, "PLANT
                     Text-010, 60 sy-vline, "MATERIAL NUMBER
                     Text-011, 80 sy-vline. "MATERIAL GROUP
 
  WRITE :/ sy-uline (80).
 
*----------------------------------------------------------------------
*                    End-of-page event                                 
*----------------------------------------------------------------------
 
END-OF-PAGE.
  WRITE :/ sy-vline,
           03 text-016,
              P_limit,
           60 text-014,
              Sy-pagno,
           80 sy-vline.
  Write:/ sy-uline(80).
 
INCLUDE Z_INCLUDE_PURCHORDERKKB01.
form form_search_help .
 
REFRESH it_ebeln.
  CLEAR it_ebeln.
  CLEAR P_ebeln.
 
  SELECT ebeln FROM ekko INTO TABLE it_ebeln.
 
  CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
    EXPORTING
      Endpos_col   = 21
      Endpos_row   = 35
      Startpos_col = 12
      Startpos_row = 1
      Title text    = text-012
 
    IMPORTING
      Choise       = P_ebeln
 
    TABLES
      Valuetab     = it_ebeln
 
    EXCEPTIONS
      break off    = 1
      OTHERS       = 2.
ABAP Interview Questions
1. How data is stored in cluster table? 
Each field of cluster table behaves as tables which contains the no. of entries. 
2. What are client dependant objects in abap/sap? 
SAP Script layout, text element, and some DDIC objects. 
3. On which even we can validate the input fields in module progams? 
In PAI (Write field statement on field you want to validate, if you want to validate group of fields put in chain and End chain statement.) 
4. In selection screen I have three fields, plant mat no and material group. If I input plant how do I get the mat no and material group based on plant dynamically? 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATERIAL. 
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' to get material and material group for the plant. 
5. How do you get output from IDOC? 
Data in IDOc is stored in segments; the output from Idoc is obtained by reading the data stored in its respective segments. 
6. When top of the page event is triggered? 
After excuteing first write statement in start-of-selection event. 
7. Can we create field without data element and how? 
In SE11 one option is available above the fields strip. Data element/ direct type. 
8. How do we debug sap script? 
Go to SE71 give lay set name; go to utilities select debugger mode on.
9. Which transaction code can I used to analyze the performance of ABAP program? 
TCode AL21.
10. How can I copy a standard table to make my own z_table?
Go to transaction SE11. Then there is one option to copy table. Press that button.  Enter the name of the standard table and in the Target table enter Z table name and press enter.
Following are some of the answers, which I gave upto my knowledge.
1. What is the use of ‘outerjoin’ 
Ans: With the use of outer join you can join the tables even there is no entry in all the tables used in the view.
        In case of inner join there should be an entry in al the tables use in the view.
2. When to use logical database?
Ans. Advantage of Logical databases:
 less coding s required to retrieve data compared to normal internel tables.
        Tables used LDB are in hierarchical structure.
3. What is the use of 'table index'?
Ans .Index is used for faster access of data base tables.
4. What is the use of 'FOR ALL ENTRIES'?
Ans. To avoid nested select statements we use SELECT FOR ALL ENTRIES statement.
        If there r more than 10000 records SELECT FOR ALL ENTRIES is used.
        Performance wise SELECT FOR ALL ENTRIES is better to use.
5. Can you set up background processing using CALL TRANSACTION?
       Yes, Using No Screen Mode.
6. What are table buffers?
    Table buffers reside locally on each application server in the system. The data of buffered tables can thus be accessed
 directly from the buffer of the application server. This avoids the time-consuming process of accessing the database.
    Buffering is useful if table needs to be accessed more no. of times in a program.
With Compliments from: Pavan
1. How do I set a flag for a field in any table?
Create a char field of length 1. for example field STAS-LKENZ is Deletion Indicator. It means that if the value in the field is 'X' then that record has been deleted.
2. Can I execute user exits? If yes, how?
Yes you can. after finding the user exit, you need to use, goto CMOD add ur user-exit to your project. Then activate the FM which you require. Now go into that function module there will be a Include program wit name ZX* . Double click on it, it will ask to create an object, answer it Yes and then write your code in it. 
3. How do I find the output type of a table or a program?
Table TNAPR / NAST
More than 100 ABAP Interview Faq's
Content Author : Prbabu
Author email : prbabu9@yahoo.co.in
Feel free to contribute to those questions without answers or add-in additional tips for those answers which you think can be further improve by Submitting a ABAP Tips or ABAP Programs
1. What is the typical structure of an ABAP/4 program? 
ANS:-
   HEADER ,BODY,FOOTER.
2. What are field symbols and field groups.? 
    Have you used "component idx of structure" clause with field groups? 
ANS:-
    Field symbols:- 
    Field groups :-
3. What should be the approach for writing a BDC program? 
ANS:-
STEP 1: CONVERTING THE LEGACY SYSTEM DATA TO A FLAT FILE to internal table CALLED "CONVERSION".
STEP 2: TRANSFERING THE FLAT FILE INTO SAP SYSTEM CALLED "SAP DATA TRANSFER".
STEP 3: DEPENDING UPON THE BDC TYPE i)call transaction(Write the program explicity)
         ii) create sessions (sessions are created and processed.if success data will transfer).
4. What is a batch input session? 
ANS:-
BATCH INPUT SESSION is an intermediate step between internal table and database table. 
Data along with the action is stored in session ie data for screen fields, to which screen it is passed,program name behind it, and how next screen is processed.
5. What is the alternative to batch input session? 
ANS:-
Call transaction.
6. A situation: An ABAP program creates a batch input session. 
    We need to submit the program and the batch session in back ground. How to do it? 
ANS:-
     go to SM36 and create background job by giving 
     job name,job class and job steps (JOB SCHEDULING) 
8. What are the problems in processing batch input sessions? 
    How is batch input process different from processing online? 
ANS:-
PROBLEMS:-
 i) If the user forgets to opt for keep session then the session will be automatically removed from the session queue(log remains).  However if session is processed we may delete it manually.
ii)if session processing fails data will not be transferred to SAP database table.
10. What are the different types of data dictionary objects? 
ans:-
tables, structures, views, domains, data elements, lock objects, Matchcode objects.
11. How many types of tables exists and what are they in data dictionary? 
ans :-
4 types of tables
i)Transparent tables - Exists with the same structure both in dictionary as well as in database exactly with the same data and fields.   Both Opensql and Nativesql can be used.
ii)Pool tables & iii)Cluster tables - 
These are logical tables that are arranged as records of transparent tables.one cannot use native sql on these tables
(only opensql).They are not managable directly using database system tools.
iv)Internal tables - .
12. What is the step by step process to create a table in data dictionary? 
ans:-
   step 1: creating domains(data type,field length,range).
   step 2: creating data elements(properties and type for a table 
field).
   step 3: creating tables(SE11).
13. Can a transparent table exist in data dictionary but not in the data base physically?
ANS:- NO.
TRANSPARENT TABLE DO EXIST WITH THE SAME STRUCTURE BOTH IN THE DICTIONARY AS WELL AS IN THE DATABASE,EXACTLY WITH THE SAME DATA AND FIELDS.
14. What are the domains and data elements? 
ANS:-
DOMAINS : FORMAL DEFINITION OF THE DATA TYPES.THEY SET ATTRIBUTES SUCH  AS DATA TYPE,LENGTH,RANGE.
DATA ELEMENT : A FIELD IN R/3 SYSTEM IS A DATA ELEMENT.
15. Can you create a table with fields not referring to data elements? 
ANS:- 
YES.  eg:- ITAB LIKE SPFLI.here we are referening to a data object(SPFLI) not data element.
16. What is the advantage of structures? How do you use them in the ABAP programs? 
ANS:-
Adv:- GLOBAL EXISTANCE(these could be used by any other program without creating it again). 
17. What does an extract statement do in the ABAP program? 
ANS:-
Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements: 
EXTRACT <fg>.
When the first EXTRACT statement occurs in a program, the system creates the extract dataset and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract record is added to the dataset
EXTRACT HEADER.
When you extract the data, the record is filled with the current values of the corresponding fields.
As soon as the system has processed the first EXTRACT statement for a field group <fg>, the structure of the corresponding extract record in the extract dataset is fixed. You can no longer insert new fields into the field groups <fg> and HEADER. If you try to modify one of the field groups afterwards and use it in another EXTRACT statement, a runtime error occurs. 
By processing EXTRACT statements several times using different field groups, you fill the extract dataset with records of different length and structure. Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program.
18. What is a collect statement? How is it different from append? 
ANS:-
If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry. 
19. What is open sql vs native sql? 
ANS:- by Madhukar
Open SQL , native SQL are the interfaces to create the database applicatons.
Open SQL is consistant across different types of existing Databases.
Native SQL is the database language specific to database.Its API is specific to the databse.
Open SQL API is consistent across all vendors      
20. What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it? 
ANS:-
21. What is the meaning of ABAP/4 editor integrated with ABAP/4 data dictionary?
ANS:-
22. What are the events in ABAP/4 language? 
ANS:-
Initialization, At selection-screen,Start-of-selection,end-of-selection,top-of-page,end-of-page, At line-selection,At user-command,At PF,Get,At New,At LAST,AT END, AT FIRST. 
23. What is an interactive report? 
What is the obvious diff of such report compared with classical type reports? 
ANS:- 
An Interactive report is a dynamic drill down report that produces the list on users choice.
diff:-
a)  THE LIST PRODUCED BY CLASSICAL REPORT DOESN'T allow user to interact with the system
    the list produced by interactive report allows the user to interact with the system.
b)  ONCE A CLASSICAL REPORT EXECUTED USER LOOSES CONTROL.IR USER HAS CONTROL.
c)  IN CLASSICAL REPORT DRILLING IS NOT POSSIBLE.IN INTERACTIVE DRILLING IS POSSIBLE.
24. What is a drill down report? 
ANS:-
Its an Interactive report where in the user can get more relavent data by selecting explicitly.
25. How do you write a function module in SAP? describe. 
ANS:-
creating function module:-
called program - se37-creating funcgrp,funcmodule by assigning attributes,importing,exporting,tables,exceptions.
calling program - SE38-in pgm click pattern and write function name- provide export,import,tables,exception values.
26. What are the exceptions in function module? 
ANS:-
COMMUNICATION_FAILURE 
SYSTEM_FAILURE 
27. What is a function group? 
ANS:-
GROUP OF ALL RELATED FUNCTIONS. 
28. How are the date and time field values stored in SAP? 
ANS:-
DD.MM.YYYY.  HH:MM:SS 
30. Name a few data dictionary objects? //rep//
ANS:-
TABLES,VIEWS,STRUCTURES,LOCK OBJECTS,MATCHCODE OBJECTS.
31. What happens when a table is activated in DD? 
ANS:-
It is available for any insertion,modification and updation of records by any user.
32. What is a check table and what is a value table? 
Check table will be at field level checking.
Value table will be at domain level checking ex: scarr table is check table for carrid.
33. What are match codes? describe? 
ans:-
It is a similar to table index that gives list of possible values for either primary keys or non-primary keys.
34. What transactions do you use for data analysis? 
ANS:-
35. What is table maintenance generator? 
ANS:-
36. What are ranges? What are number ranges? 
ANS:-
    max,min values provided in selection screens.
37. What are select options and what is the diff from parameters? 
ANS:-
select options provide ranges where as parameters do not. 
SELECT-OPTIONS declares an internal table which is automatically filled with values or ranges 
of values entered by the end user. For each SELECT-OPTIONS , the system creates a selection table.
SELECT-OPTIONS <SEL> FOR <field>.
A selection table is an internal table with fields SIGN, OPTION, LOW and HIGH. 
The type of LOW and HIGH is the same as that of <field>. 
The SIGN field can take the following values: I Inclusive (should apply) E Exclusive (should not apply)
The OPTION field can take the following values: EQ Equal GT Greater than NE Not equal BT Between LE Less 
than or equal NB Not between LT Less than CP Contains pattern GE Greater than or equal NP No pattern.
diff:-
PARAMETERS allow users to enter a single value into an internal field within a report. 
SELECT-OPTIONS allow users to fill an internal table with a range of values. 
For each PARAMETERS or SELECT-OPTIONS statement you should define text elements by choosing 
Goto - Text elements - Selection texts - Change. 
Eg:- Parameters name(30).
when the user executes the ABAP/4 program,an input field for 'name' will appear on the selection screen.You can change the comments on the left side of the input fields by using text elements as described in Selection Texts.
38. How do you validate the selection criteria of a report? 
And how do you display initial values in a selection screen? 
ANS:-
validate :- by using match code objects.
display :- Parameters <name> default 'xxx'.
               select-options <name> for spfli-carrid.
39. What are selection texts? 
ANS:-
40. What is CTS and what do you know about it? 
ANS:-
The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing, and then transport the changes between the SAP Systems and clients in your system landscape.
This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project.
For practical information on working with the Change and Transport System, see Change and Transport Organizer and Transport Management System.
41. When a program is created and need to be transported to prodn does selection texts always go with it? if not how do you make sure? Can you change the CTS entries? How do you do it? 
ANS:-
42. What is the client concept in SAP? What is the meaning of client independent? 
ANS:-
43. Are programs client dependent? 
ANS:-
    Yes.Group of users can access these programs with a client no.
44. Name a few system global variables you can use in ABAP programs? 
ANS:-
SY-SUBRC,SY-DBCNT,SY-LILLI,SY-DATUM,SY-UZEIT,SY-UCOMM,SY-TABIX.....
SY-LILLI IS ABSOLUTE NO OF LINES FROM WHICH THE EVENT WAS TRIGGERED.
45. What are internal tables? How do you get the number of lines in an internal table? 
How to use a specific number occurs statement? 
ANS:-
 i)It is a standard data type object which exists only during the runtime of the program.
They are used to perform table calculations on subsets of database tables and for re-organising the contents of database tables according to users need.
ii)using SY-DBCNT.
iii)The number of memory allocations the system need to allocate for the next record population.
46. How do you take care of performance issues in your ABAP programs? 
Performance of ABAPs can be improved by minimizing the amount of data to be transferred. 
The data set must be transferred through the network to the applications, so reducing the amount OF time and also reduces the network traffic.
Some measures that can be taken are: 
- Use views defined in the ABAP/4  DDIC (also has the advantage of better reusability).
- Use field list (SELECT clause) rather than SELECT *.
- Range tables should be avoided (IN operator)
- Avoid nested SELECTS. 
i)system tools
ii)field symbols and field groups.
ans:-
Field Symbols : Field symbols are placeholders for existing fields. A Field Symbol does not physically reserve space for a field,but points to a field which is not known until runtime of the program.
eg:-  FIELD-SYMBOL <FS> [<TYPE>]. 
Field groups :  A field group combines several fields under one name.At runtime,the INSERT command is used to define which data fields are assigned to which field group.
There should always be a HEADER field group that defines how the extracted data will be sorted,the data is sorted by the fields grouped under the HEADER field group.
47. What are datasets? 
ANS:-
The sequential files(ON APPLICATION SERVER) are called datasets. They are used for file handling in SAP.
48. How to find the return code of a statement in ABAP programs? 
ANS:-
Using function modules.
49. What are interface/conversion programs in SAP? 
ANS : 
CONVERSION : LEGACY SYSTEM TO FLAT FILE.
INTERFACE  : FLAT FILE TO SAP SYSTEM.
50. Have you used SAP supplied programs to load master data? 
51. What are the techniques involved in using SAP supplied programs? 
Do you prefer to write your own programs to load master data? Why? 
52. What are logical databases? What are the advantages/disadvantages of logical databases? 
ANS:-
To read data from a database tables we use logical database.
A logical database provides read-only access to a group of related tables to an ABAP/4 program.
adv:-
The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
i)An easy-to-use standard user interface.
ii)check functions which check that user input is complete,correct,and plausible.
iii)meaningful data selection.
iv)central authorization checks for database accesses.
v)good read access performance while retaining the hierarchical data view determined by the application logic. 
disadv:-
i)If you donot specify a logical database in the program attributes,the GET events never occur.
ii)There is no ENDGET command,so the code block associated with an event ends with the next event 
statement (such as another GET or an END-OF-SELECTION). 
53. What specific statements do you using when writing a drill down report? 
ans:-
AT LINE-SELECTION,AT USER-COMMAND,AT PF.
54. What are different tools to report data in SAP? What all have you used? 
ans:-
55. What are the advantages and disadvantages of ABAP/4 query tool? 
56. What are the functional areas? User groups? and how does ABAP/4 query work in relation to these? 
57. Is a logical database a requirement/must to write an ABAP/4 query? 
59. What are Change header/detail tables? Have you used them? 
60. What do you do when the system crashes in the middle of a BDC batch session? 
ans:-
we will look into the error log file (SM35).
61. What do you do with errors in BDC batch sessions? 
ANS:-
We look into the list of incorrect session and process it again. To correct incorrect session we analyize the session to determine which screen and value produced the error.For small errors in data we correct them interactively otherwise
modify batch input program that has generated the session or many times even the datafile.
62. How do you set up background jobs in SAP? What are the steps? What are the event driven batch jobs? 
ans:-
go to SM36 and create background job by giving job name,job class and job steps(JOB SCHEDULING)
63. Is it possible to run host command from SAP environment? How do you run? 
64. What kind of financial periods exist in SAP? What is the relavent table for that? 
65. Does SAP handle multiple currencies? Multiple languages? 
ans:-
Yes.
66. What is a currency factoring technique? 
67. How do you document ABAP/4 programs? Do you use program documentation menu option? 
68. What is SAPscript and layout set? 
ans:-
The tool which is used to create layout set is called SAPscript. Layout set is a design document.
69. What are the ABAP/4 commands that link to a layout set? 
ans:-
control commands,system commands,
70. What is output determination? 
71. What are IDOCs? 
ans:-
IDOCs are intermediate documents to hold the messages as a container.
72. What are screen painter? menu painter? Gui status? ..etc. 
ans:-
dynpro - flow logic + screens.
menu painter - 
GUI Status - It is subset of the interface elements(title bar,menu bar,standard tool bar,push buttons) used for a certain screen.
The status comprises those elements that are currently needed by the transaction.
73. What is screen flow logic? What are the sections in it? Explain PAI and PBO. 
ans:-
The control statements that control the screen flow.
PBO - This event is triggered before the screen is displayed.
PAI - This event is responsible for processing of screen after the user enters the data and clicks the pushbutton.
74. Overall how do you write transaction programs in SAP? 
ans:- 
Create program-SE93-create transcode-Run it from command field.
75. Does SAP has a GUI screen painter or not? If yes what operating systems is it available on? What is the other type of screen painter called? 
76. What are step loops? How do you program pagedown pageup in step loops? 
ans:-
step loops are repeated blocks of field in a screen.
77. Is ABAP a GUI language? 
ANS:-
Yes.
ABAP IS AN EVENT DRIVEN LANGUAGE.
78. Normally how many and what files get created when a transaction program is written? 
What is the XXXXXTOP program? 
ans:-
ABAP/4 program.
DYNPRO
79. What are the include programs? 
ANS:-
When the same sequence of statements in several programs are to be written repeadly they are coded in include programs (External programs) and  are included in ABAP/4 programs.
80. Can you call a subroutine of one program from another program? 
ans:-  Yes- only external subroutines Using 'SUBMIT' statement.
81. What are user exits? What is involved in writing them? What precations are needed? 
82. What are RFCs? How do you write RFCs on SAP side? 
83. What are the general naming conventions of ABAP programs? 
ANS:-
Should start with Y or Z.
84. How do you find if a logical database exists for your program requrements? 
ans:-
SLDB-F4.
85. How do you find the tables to report from when the user just tell you the transaction he uses? And all the underlying data is from SAP structures? 
ans:-
Transcode is entered in command field to open the table.Utilities-Table contents-display.
86. How do you find the menu path for a given transaction in SAP? 
ans:-
87. What are the different modules of SAP? 
ans:-
FI,CO,SD,MM,PP,HR.
89. How do you get help in ABAP? 
ans:-
HELP-SAP LIBRARY,by pressing F1 on a keyword.
90. What are different ABAP/4 editors? What are the differences? 
ans:-
91. What are the different elements in layout sets? 
ans:-
PAGES,Page windows,Header,Paragraph,Character String,Windows.
92. Can you use if then else, perform ..etc statements in sap script? 
ans:-
yes.
93. What type of variables normally used in sap script to output data? 
94. How do you number pages in sapscript layout outputs? 
95. What takes most time in SAP script programming? 
ANS:-
LAYOUT DESIGN AND LOGO INSERTION.
96. How do you use tab sets in layout sets? 
97. How do you backup sapscript layout sets? Can you download and upload? How? 
98. What are presentation and application servers in SAP? 
ANS:-
The application layer of an R/3 System is made up of the application servers and the message server. Application programs in an R/3 System are run on application servers. The application servers communicate with the presentation components, the database, and also with each other, using the message server.
99. In an ABAP/4 program how do you access data that exists on a presentation server vs on an application server? 
ans:-
i)using loop statements.
ii)flat 
100. What are different data types in ABAP/4? 
ans:-
     Elementary - 
          predefined C,D,F,I,N,P,T,X.
          userdefined TYPES.
 ex: see in intel book page no 35/65
     Structured - 
         predefined    TABLES.
         userdefined Field Strings and internal tables.
101. What is difference between session method and Call Transaction? 
ans:-
102. Setting up a BDC program where you find information from? 
ans:- 
103. What has to be done to the packed fields before submitting to a BDC session. 
ans:-
     fields converted into character type.
104. What is the structure of a BDC sessions. 
ans:-
      BDCDATA (standard structure).
105. What are the fields in a BDC_Tab Table. 
ans:-
      program,dynpro,dynbegin,fnam,fval.
106. What do you define in the domain and data element. 
Technical details like 
107. What is the difference between a pool table and a transparent table and how they are stored at the database level. 
ans:-
ii)Pool tables is a logical representation of transparent tables .Hence no existence at database level. Where as transparent tables are physical tables and exist at database level.
108. What is cardinality? 
For cardinality one out of two (domain or data element) should be the same for Ztest1 and Ztest2 tables. M:N
Cardinality specifies the number of dependent(Target) and independent (source) entities which can be in a relationship.

Tuesday, 15 November 2011

ABAP SYNTAX


ABAP SYNTAX

 A                                                                                                   
ADD for single fields
Adds two single fields.
Syntax
ADD <n> TO <m>.
The contents of <n> are added to the contents of <m> and the results are stored in <m>. This is equivalent to: <m> = <m> + <n>.

ADD for field sequences
Adds sequences of fields in storage.
Syntax
ADD <n1> THEN <n2> UNTIL <nz> GIVING <m>.
ADD <n1> THEN <n2> UNTIL <nz> ACCORDING TO <sel> GIVING <m>.
ADD <n1> THEN <n2> UNTIL <nz> TO <m>.
ADD <n1> FROM <m1> TO <mz> GIVING <m>.
If <n1>, <n2>,..., <nz> is a sequence of fields with the same distance to one another and if they have the same type and length, these fields are added and the result is stored in <m>. Different variants allow you to limit fields to a subsequence, to include <m> in the sum, and to perform the operation on a sequence of fields that directly follow one another.

ADD-CORRESPONDING
Adds subfields of structures.
Syntax
ADD-CORRESPONDING <struc1> TO <struc2>.
All the subfields of the structures <struc1> and <struc2> having the same name are added and the results are stored in <struc2>.

ALIASES
Defines class-specific alias names for an interface component in ABAP objects.
Syntax
ALIASES <alias> FOR <intf~comp>.
<alias> is defined within a class or interface as synonymous with the interface component <intf~comp>.

APPEND
Appends a line or multiple lines to the end of an index table.
Syntax
APPEND <line>|LINES OF <jtab> TO <itab>
       [ASSIGNING <FS> | REFERENCE INTO <dref>].
A line <line> or multiple lines of an internal table <jtab> are appended to index table <itab>. If you use ASSIGNING or INTO REFERENCE, field symbol <FS> refers to the appended line or the relevant data reference is stored in <dref> after the statement.

ASSIGN
Assigns a field to a field symbol.
Syntax
ASSIGN <f> [INCREMENT <n>] TO <FS>
           [CASTING [TYPE <t>|LIKE <f>] [DECIMALS <d>]] [RANGE <r>].
Data object <f> is assigned to field symbol <FS>. <FS> now points to the data object. After the addition INCREMENT <n>, the storage area that is offset <n> times by a length of <f> starting with <f> is assigned to the field symbol. Pointed brackets are part of the syntax for field symbol names. The CASTING addition permits you to cast data objects when assigning field symbols. The RANGE addition defines the storage area in which either offset/length accesses or the INCREMENT addition are allowed. In Unicode programs, standard access is only allowed within the field limits of <f>, but this can be extended with RANGE. In non-Unicode programs, standard access is possible up to the boundary of the data segment and can be limited with RANGE.
Syntax
ASSIGN <dref>->* TO <FS> [CASTING ... ].
Dereferencing of the data reference in <dref>. The data object to which the data reference refers is assigned to field symbol <FS>.


AT for event blocks
Event keywords for defining event blocks for screen events.
Syntax
AT SELECTION-SCREEN...
AT LINE-SELECTION.
AT USER-COMMAND.
AT PFn.
User actions on a selection screen or on a list trigger certain events in the ABAP runtime environment. The event keywords define event blocks that are called when events occur.

AT for group change
Change of group when processing loops of extracts and internal tables.
Syntax
AT NEW <f>.
AT END OF <f>.
AT FIRST.
AT LAST.
AT <fg>.
The statements are used to process group levels within a loop using an extract dataset or an internal table. They introduce statement blocks that must be closed with ENDAT. The statements between AT and ENDAT are only executed if the corresponding group change occurred.

AUTHORITY-CHECK
Checks user authorization.
Syntax
AUTHORITY-CHECK OBJECT <object> ID <name1> FIELD <f1>
                                ID <name2> FIELD <f2>
                               ...
                                ID <name10> FIELD <f10>.
There is a check if the program user has all the authorizations defined in authorization object <object>. <name1>,..., <name10> are the authorization fields of the authorization object. <f1>,... <f1>, ..., <f10> are data objects of the program. The value of the data objects is checked against the authorization fields.

B                                                                                                   
BACK
Relative position of the output in a list.
Syntax
BACK.
Positions the list output either in the first column of the first line following the page header of the current page or in connection with RESERVE in the first column of the first line of a line block.

BREAK-POINT
Calls the Debugger.
Syntax
BREAK-POINT.
Interrupts execution of the program and goes to debugging mode. Is used as a test help. Normal program processing is interrupted when this statement is reached and the system goes to a debugger.

C                                                                                                   
CALL CUSTOMER-FUNCTION
Calls the customer function modules.
Syntax
CALL CUSTOMER-FUNCTION <func>...
Similar to CALL FUNCTION. The function modules must be programmed and activated within the customer's modification concept.

CALL FUNCTION
Calls the function modules.
Syntax
CALL FUNCTION <func> [EXPORTING ... fi = a i... ]
                     [IMPORTING ... fi = a i... ]
                     [CHANGING  ... fi = a i... ]
                     [TABLES    ... fi = a i... ]
                     [EXCEPTIONS... ei = r i... ]
              [DESTINATION <dest>]
              [IN UPDATE TASK]
              [STARTING NEW TASK]
              [IN BACKGOUND TASK].
The program calls either a function module in the same R/3 System, or one from an external system, depending on the variant of the statement you use. You can call update modules when processing transactions. You can also call functions asynchronously. The other additions are used to specify actual parameters for the parameter interface for the function module, <func>, and to handle exceptions.

CALL DIALOG
Calls a dialog module.
Syntax
CALL DIALOG <dialog> [AND SKIP FIRST SCREEN]
                     [EXPORTING... fi = a i... ]  
                     [IMPORTING... fi = a i... ]
                     [USING itab].
Calls the dialog module <dial>. A dialog module is an ABAP program with a sequence of screens. It does not have to be started using a transaction code, or run in the same SAP LUW, like the calling program. The additions are used to skip the initial screen in the sequence and specify actual parameters for the parameter interface of the dialog module.

CALL METHOD
Calls a method in ABAP Objects.
Syntax
CALL METHOD <meth> [EXPORTING ... <ii> =.<f i>... ]
                   [IMPORTING ... <ei> =.<g i>... ]
                   [CHANGING  ... <ci> =.<f i>... ]
                   [RECEIVING r = h ]
                   [EXCEPTIONS... <ei> = r i...     ]
                   [PARAMETER-TABLE <ptab>]
                   [EXCEPTION-TABLE <etab>].
[CALL METHOD]<meth>( ... ).
Calls a method <meth>. The additions are used to specify actual parameters for the parameter interface for the function module and to handle exceptions. The last two additions pass parameters dynamically in a dynamic method call. Alternatively, if the method is called statically, the parameters can be specified using parenthesis notation (as you can when specifying parameters in a CALL METHOD statement). You can also use functional methods with this syntax in operand positions.

CALL METHOD OF
Calls a method in OLE2 Automation.
Syntax
CALL METHOD OF <obj> <m>.
Calls the method, <m>, of the OLE2 Automation Object, <obj>.

CALL SCREEN
Calls a screen sequence.
Syntax
CALL SCREEN <scr>
            [STARTING AT <X1> <Y1>]
            [ENDING AT <X2> <Y2>].
Calls the sequence of screens that begins with the screen <scr>. All the screens in the screen sequence belong to the current ABAP program. The screen sequence ends when the program reaches the screen numbered 0. The additions let you call a single screen in a new window.

CALL SELECTION-SCREEN
Calls a selection screen.
Syntax
CALL SELECTION-SCREEN <scr>
                      [STARTING AT <x1> <y 1>]
                      [ENDING AT <x2> <y 2>].
Calls a selection screen defined in an ABAP program. The selection screen is processed in the program in the AT SELECTION-SCREEN event. The additions let you call a selection screen in a new window.

CALL TRANSACTION
Call a transaction.
Syntax
CALL TRANSACTION <tcod>
                 [AND SKIP FIRST SCREEN]
                 [USING <itab>].
Calls the transaction <tcod> after having received data from the calling program. At the end of the transaction that has been called, the system returns to the statement following the call in the calling report. The additions are used to skip the initial screen in the sequence or to pass a batch input table to the transaction.

CASE
Conditional branch.
Syntax
CASE <f>.
Opens a CASE control structure that ends with an ENDCASE statement. The CASE control structure allows you to control which statement blocks (introduced by WHEN) are processed, based on the contents of a data object.

CATCH
Catches a class-based exception.
CATCH <cx1> ... <cxn> [INTO <ref>].
You can only use this statement in a TRY-ENDTRY block, where you define a handler for one or more class-based exceptions. You can use INTO to place a reference to the exception object into the reference variable <ref>.

CATCH SYSTEM-EXCEPTIONS
Catches a catchable runtime error.
Syntax
CATCH SYSTEM-EXCEPTIONS <except1> = <rc 1>... <except n> = <rc n>.
Introduces a CATCH area, which ends with an ENDCATCH statement. If a catchable runtime error <excepti>, occurs between CATCH and ENDCATCH, the current processing block is interrupted. The system jumps to the appropriate ENDCATCH statement and fills SY-SUBRC with <rc i>.

CHECK
Conditionally leaves a loop or processing block.
Syntax
CHECK <logexp>.
If the logical expression <logexp> is true, the system continues with the next statement. If it is false, processing within the loop is interrupted at the current loop pass, and the next loop pass is performed. Otherwise the system leaves the current processing block. In conjunction with selection tables, and inside GET events, you can use an extra variant of the CHECK statement.

CLASS Declaration
Declares a class in ABAP Objects.
Syntax
CLASS <class> DEFINITION [PUBLIC]
              [INHERITING FROM <superclass>]
              [ABSTRACT]
              [FINAL]
              [CREATE PUBLIC|PROTECTED|PRIVATE]
              [FRIENDS <cif1> <cif 2> ...]
              [DEFERRED]
              [LOAD].
Introduces the declaration part of a class, <class>. The declaration part ends with ENDCLASS and contains the declaration of all the components of the class. The PUBLIC addition is generated only by the Class Builder. It defines a global class in the Class Library. The INHERITING FROM addition lets you derive the class, <class>, from a superclass, <superclass>. The ABSTRACT addition defines an abstract class, which cannot be instantiated. The FINAL addition defines a class that cannot have any subclasses. The CREATE addition specifies who can instantiate the class. FRIENDS allows you to specify other classes or interfaces, <cif> that can access the private components of the class and instantiate objects of the class, independently of the CREATE addition. The DEFERRED addition makes the class known to the program before it is declared. The LOAD addition loads a class explicitly from the Class Library.

CLASS – Implementation
Implements a class in ABAP Objects.
Syntax
CLASS <class> IMPLEMENTATION.
Introduces the implementation part of a class, <class>. The implementation part ends with ENDCLASS and contains the implementation of all the components of the class.

CLASS-DATA
Declares static attributes of a class or interface.
Syntax
CLASS-DATA <a>...
Like DATA. However, the attribute <a> is declared as a static attribute. Static attributes are not instance-specific. Their content is shared by all instances.

CLASS-METHODS
Declares static methods of a class or interface.
Syntax
CLASS-METHODS <meth>...
Like METHODS, except that the method <meth> is declared as a static method. A static method can access 
static attributes and can only trigger static events.

CLASS-EVENTS
Declares static events of a class or interface.
Syntax
CLASS-EVENTS <evt>...
Like EVENTS, except that the event <evt> is declared as a static attribute. Static events are the only type of event that can be triggered in a static method.

CLEANUP
Tidies up after class-based exceptions.
CLEANUP.
Can only be used within a TRY-ENDTRY block, where it defines a control block. If a class-based exception is not caught with a CATCH statement, the system executes the statements between CLEANUP and ENDTRY, before passing the exception along the call hierarchy.

CLEAR
Sets a variable to its initial value.
Syntax
CLEAR <f>.
The variable <f>, which can have any data type, is set to an initial value appropriate to its type.

CLOSE DATASET
Closes a file.
Syntax
CLOSE DATASET <dsn>.
Closes a file opened with OPEN DATASET on the application server.

CLOSE CURSOR
Closes a database cursor.
Syntax
CLOSE CURSOR <c>.
Closes a cursor opened with OPEN CURSOR.

COLLECT
Aggregates lines and then adds them to an internal table.
Syntax
COLLECT <line> INTO <itab>
       [ASSIGNING <FS> | REFERENCE INTO <dref>].
The system checks whether there is already a table entry that matches the key. If there is no corresponding entry already in the table, the COLLECT statement has the same effect as INSERT. If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area <line> to the contents of the fields in the existing entry. If you use ASSIGNING or INTO REFERENCE, field symbol <FS> refers to the inserted line or the relevant data reference is stored in <dref> after the statement.

COMMIT
Closes a SAP LUW.
Syntax
COMMIT WORK [AND WAIT]
Writes all the database changes and releases all the database locks. Triggers updating. The AND WAIT addition forces the program to wait until the system has finished updating the database. Otherwise, updating is asynchronous.

COMMUNICATION
Enables two programs to communicate with each other.
Syntax
COMMUNICATION INIT DESTINATION <dest> ID <id> [additions].
COMMUNICATION ALLOCATE ID <id> [additions].
COMMUNICATION ACCEPT ID <id> [additions].
COMMUNICATION SEND ID <id> BUFFER <f> [additions].
COMMUNICATION RECEIVE ID <id> [additions].
COMMUNICATION DEALLOCATE ID <id> [additions].
The statement initializes, creates, and accepts communication between two programs; lets these two programs send and receive data; and then closes the connection.

COMPUTE
Performs numeric operations.
Syntax
COMPUTE <n> = <expression>.
The result of the mathematical operation specified in <expression> is assigned to the field <n>. The keyword COMPUTE is optional.

CONCATENATE
Concatenates (chains) several strings to a string.
Syntax
CONCATENATE <c1>... <cn> INTO <c> [ SEPARATED BY <s> ]
                                  [IN BYTE MODE|IN CHARACTER MODE].
This statement concatenates the strings <c1> to <cn> and assigns the result to <c>. The addition SEPARATED BY <s> allows you to specify a character field <s> which is placed in its defined length between the individual fields. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions.

CONDENSE
Removes spaces from a string
Syntax
CONDENSE <c> [NO-GAPS].
This statement removes any leading blanks from the field <c> and replaces other sequences of blanks by exactly one blank. If the addition NO-GAPS is specified, all blanks are removed.

CONSTANTS
Declares constant data objects.
Syntax
CONSTANTS <c>... VALUE [<val> | IS INITIAL]...
The syntax is similar to DATA, except that the VALUE addition is required, and that internal tables and deep structures cannot be declared as constants The start value specified in the VALUE addition cannot be changed during the execution of the program.

CONTINUE
Ends a loop pass.
Syntax
CONTINUE.
Only possible within loops. This statement terminates the current loop pass and starts the next

CONTEXTS
Declares a context.
Syntax
CONTEXTS <c>.
Generates an implicit data type CONTEXT_<c>, which you can use to create context instances

CONTROLS
Defines a control.
Syntax
CONTROLS <ctrl> TYPE <ctrl_type>.
Defines an ABAP runtime object <ctrl>. This displays data in a particular format on a screen, depending on the type <ctrl_type> Currently, <ctrl_type> may be a table control or tabstrip control

CONVERT für Dates
Converts a data into an inverted date form.
Syntax
CONVERT DATE <d1> INTO INVERTED-DATE <d2>.
CONVERT INVERTED-DATE <d1> INTO DATE <d2>.
If <d1> and <d2> are date fields in the internal form YYYYMMDD, the nines complement of <d1> is placed in field <d2> and vice versa. In inverted date format, the most recent date has the smaller numerical value

CONVERT for Timestamps
Converts a timestamp into the correct date and time for the current time zone
Syntax
CONVERT TIME STAMP <tst> TIME ZONE <tz> INTO DATE <d> TIME <t>.
CONVERT DATE <d> TIME <t> INTO TIME STAMP <tst> TIME ZONE <tz>.
As long as <tst> has type P(8) or P(11) with 7 decimal placed, and <tz> has type C(6), the time stamp <tst> will be converted to the correct date <d> and time <t> for the time zone <tz>.

CONVERT for Text
Converts a text into a format that can be sorted alphabetically.
Syntax
CONVERT TEXT <text> INTO SORTABLE CODE <x>.
<text> must have type C and <x> must have type X. The string is then converted so that the relative order of the characters allows them to be sorted alphabetically in the current text environment

CREATE DATA
Creates a dynamic data object.
Syntax
CREATE DATA <dref> TYPE <type>|LIKE <obj>.
CREATE DATA <dref> TYPE LINE OF <itab>|LIKE LINE OF <itab>.
CREATE DATA <dref> TYPE REF TO DATA|<type>.
CREATE DATA <dref> TYPE TYPE|LIKE <tabkind> OF <linetype> WITH <key>.
If <dref> is a data reference variable, a data object of the specified type is created. The reference in <dref> points to this object. You can omit the TYPE declaration in fully-typed reference variables.

CREATE OBJECT in ABAP Objects
Instantiates an object in ABAP Objects.
Syntax
CREATE OBJECT <oref> [TYPE <class>] [EXPORTING ... <ii> =.<fi>... ].
<cref> must be a reference variable, defined with reference to a class. CREATE OBJECT then creates an object of that class, to which the reference in <cref> then points The reference in <dref> points to this object. If <oref> is a typed class reference variable with reference to a subclass of <class>, or if <oref> is an interface reference variable, whose interface is implemented in the class <class>, you can specify the class of the instantiated object explicitly in a TYPE addition, to establish the dynamic type of the reference variables. The EXPORTING addition specifies the non-optional IMPORTING parameters of the instance constructor of the class of the instantiated object.

CREATE OBJECT in OLE2 Automation
Instantiates an external object in OLE2 Automation.
Syntax
CREATE OBJECT <obj> <class>.
If <class> is a class assigned to an automation server, an initial object <obj> of this class is created 

D                                                                                                   
DATA with Reference to Known Data Types
Declares variables with a previously-declared data type
Syntax
DATA <f>... [TYPE <type>|LIKE <obj>]... [VALUE <val>].
Declares a variable <f> with the fully-defined data type <type> or the same data type as another data object <obj>. The data type <type> can be D, F, I, T, a type defined locally in the program using the TYPES statement, or a type from the ABAP Dictionary. The data object <obj> is a data object or line of an internal table that has already been defined. The VALUE addition specifies a starting value.
DATA with Reference to Generic Data Types
Declares variables by completing the description of a generic type
Syntax
DATA <f>[(<length>)] TYPE <type> [DECIMALS <d>]... [VALUE <val>].
DATA <f> TYPE <itab>.
The data type <type> can be C, N, P, X, STRING or XSTRING. The <length> option sets the field length. If you omit it, the field length is set to the appropriate initial value. If <type> is P, you can specify the number of decimal places using the DECIMALS <d> addition. If you omit this, the number of decimal places is set to 0. If you do not use the TYPE addition, the system uses the default predefined generic type C.
Syntax
DATA <f> TYPE <itab>.
The data type <itab> is a standard internal table with generic key. The default key is automatically used in the DATA statement.
DATA, Creating an Associated Data Type
Declares variables with data types that only exist as an attribute of the variable.
Syntax
DATA <f> TYPE REF TO <class>|<interface>.
The variable <f> is defined as an object reference variable for the class <class> or interface <interface>.
Syntax
DATA <f> TYPE REF TO DATA|<type>.
Declares the variable <f> as a data reference variable for a data object.
Syntax
DATA: BEGIN OF <structure>,
       ...
        <fi>...,
       ...
END OF <structure>.
Combines the variables <fi> to form the structure <structure>. The individual variables within a structure are addressed in the program with a hyphen between the structure name and component name as follows: <structure>-<f i>.
Syntax
DATA <f> TYPE|LIKE <tabkind> OF <linetype> WITH <key>.
The variable <f> is declared as an internal table with the table kind <tabkind>, line type <linetype>, and key <key>.
Syntax
DATA <f> TYPE|LIKE RANGE OF <type>|<obj>.
Declares the variable <f> as a RANGES table. A RANGES table has the same data type as a selection table, but is not linked to input fields on a selection screen.
DATA statement for Shared Data Areas
Declares shared data areas in a program.
Syntax
DATA: BEGIN OF COMMON PART <c>,
        
<f i>. ..
      END OF COMMON PART.
The variables <fi> are assigned to a data area <c>, which can be defined in more than one program. These data areas use the same memory addresses for all programs that are loaded into the same internal session.
DEFINE
Defines a macro.
Syntax
DEFINE <macro>.
Introduces the definition of the macro <macro>. Each macro must consist of complete ABAP statement and be concluded with the END-OF-DEFINITION statement.
DELETE for Files
Deletes files on the application server
Syntax
DELETE DATASET <dsn>.
Deletes the file <dsn> from the file system of the application server.
DELETE for Database Table Entries
Deletes entries from database tables.
Syntax
DELETE FROM <dbtab> WHERE <cond>.
All of the lines in the database table that satisfy the conditions in the WHERE clause are deleted.
Syntax
DELETE <dbtab> FROM <wa>.
DELETE <dbtab> FROM TABLE <itab>.
This deletes the line that has the same primary key as the work area <wa>, or deletes all the lines in the database that have the same primary key as a line in the internal table <itab>. The work area <wa> or the lines of the internal table <itab> must have at least the same length as the work area of the database table.
DELETE for Cluster Databases
Deletes data clusters from cluster database tables.
Syntax
DELETE FROM DATABASE <dbtab>(<ar>) ID <key>.
Deletes the entire cluster in area <ar> with the name <key> from the cluster database table <dbtab>.
DELETE for the Cross-Transaction Application Buffer
Deletes data clusters from the cross-transaction application buffer.
Syntax
DELETE FROM SHARED BUFFER <dbtab>(<ar>) ID <key>.
Deletes the data cluster for the area <ar> with the name <key> stored in the cross-transaction application buffer for the table <dbtab>.
DELETE for Lines from an Internal Table
Deletes lines from internal tables of any type.
Syntax
DELETE TABLE <itab> FROM <wa>.
DELETE TABLE <itab> WITH TABLE KEY <k1> = <f 1>... <k n> = <f n>.
Deletes using the table key. All lines with the same key are deleted. The key values are taken either from a compatible work area <wa> or specified explicitly.
Syntax
DELETE <itab> WHERE <cond>.
Deletes using conditions. Deletes all table entries that satisfy the logical expression <cond>. The logical condition can consist of more than one comparison. In each comparison, the first operand must be a component of the line structure.
Syntax
DELETE ADJACENT DUPLICATE ENTRIES FROM <itab> [COMPARING... ].
Deletes adjacent duplicate entries, either by comparing the key fields or the comparison fields specified explicitly in the COMPARING addition.
DELETE for Lines from Index Tables
Deletes entries from index tables.
Syntax
DELETE <itab> [INDEX <idx>].
If you use the INDEX addition, the line with index <idx> is deleted from the table <itab>. Without the INDEX addition, you can only use the above statement within a LOOP. In this case, you delete the current line.
Syntax
DELETE <itab> [FROM <n1>] [TO <n 2>] [WHERE <cond>].
The system deletes all of the lines of <itab> whose index lies between <n 1 > and <n 2 > and who meet the conditions specified in the WHERE clause. If you do not specify a FROM addition, the system deletes lines from the first line onwards. If you do not specify a TO addition, the system deletes lines up to the last line. The logical condition can consist of more than one comparison. In each comparison, the first operand must be a component of the line structure.
DEMAND
Retrieves values from a context instance.
Syntax
DEMAND <val1> = <f 1>... <val n> = <f n> FROM CONTEXT <inst>
                                        [MESSAGES INTO <itab>].
Fills the fields <fn> with the values <val n> from the context instance <inst>. You can handle these messages in your programs by using the MESSAGES addition.
DESCRIBE DISTANCE
Gets the distance between two fields.
Syntax
DESCRIBE DISTANCE BETWEEN <f1> AND <f2> INTO <f3> [IN BYTE|CHARACTER MODE].
Writes the number of bytes between data objects <f1> and <f 2> into the variable <d>. The length of the first field in memory is always included. In Unicode programs, you must specify either the IN BYTE MODE or IN CHARACTER MODE addition. In non-Unicode programs, the distance is returned in bytes.
DESCRIBE FIELD
Describes the attributes of a field.
Syntax
DESCRIBE FIELD <f> [LENGTH <l> [IN BYTE|CHARACTER MODE]]
                   [TYPE <t> [COMPONENTS <n>]]
                   [OUTPUT-LENGTH <o>] [DECIMALS <d>]
                   [EDIT MASK <m>] [HELP-ID <h>].
The attributes of the data object <f> specified by the parameters of the statement are written to the variables following the parameters. You can use any number of the additions in the same statement. In Unicode programs, you must specify either the IN BYTE MODE or IN CHARACTER MODE addition for LENGTH. In non-Unicode programs, the length is returned in bytes.
DESCRIBE LIST
Describes the attributes of a list.
Syntax
DESCRIBE LIST NUMBER OF LINES <lin> [INDEX <idx>].
DESCRIBE LIST NUMBER OF PAGES <n> [INDEX <idx>].
DESCRIBE LIST LINE <lin> PAGE <pag> [INDEX <idx>].
DESCRIBE LIST PAGE <pag> [INDEX <idx>]...
Depending on the variant of the statement that you use, writes the number of lines, number of pages, a line of a list on a given page, or various attributes of a page to variables.
DESCRIBE TABLE
Describes the attributes of an internal table.
Syntax
DESCRIBE TABLE [LINES <l>] [OCCURS<n>] [KIND <k>].
Depending on the additions you use, writes the number of lines occupied, the value specified for the INITIAL SIZE of the table, or the table type into a corresponding variable.
DIVIDE
Divides one field by another.
Syntax
DIVIDE <n> BY <m>.
Divides the content of <n> by <m>, and places the result in <n>. This is equivalent to: n=n/m.
DIVIDE-CORRESPONDING
Divides matching components of structures.
Syntax
DIVIDE-CORRESPONDING <struc1> BY <struc2>.
All the identically-named subfields of the structures <struc1> and <struc2> are divided and the results are stored these subfields of <struc1>.
DO
Introduces a loop.
Syntax
DO [<n> TIMES] [VARYING <f> FROM <f1> NEXT <f2>].
Introduces a statement block that ends with ENDDO. If you omit the TIMES addition, the statement block is repeated until it reaches a termination statement such as EXIT or CHECK. Use the TIMES addition to restrict the number of loop passes to <n>. The VARYING addition allows you to process fields the same distance apart in memory.
E                                                                                                   
EDITOR-CALL
Loads an ABAP program or internal table into a text editor.
Syntax
EDITOR-CALL FOR <itab>...
EDITOR-CALL FOR REPORT <prog>...
Loads the internal table <itab> or the program <prog> into a text editor, where you can edit it using standard editor functions.
ELSE
Introduces a statement block in an IF control structure.
Syntax
ELSE.
If the logical expression in an IF statement is false, ELSE introduces the statement block to be executed instead.
ELSEIF
Introduces a statement block in an IF control structure.
Syntax
ELSEIF <logexp>.
If the logical expression in an IF statement is false and <logexp> is true, ELSE introduces the statement block to be executed instead.
END-OF-DEFINITION
Closes a macro definition.
Syntax
END-OF-DEFINITION.
This statement concludes a macro definition introduced with DEFINITION.
END-OF-PAGE
Event keywords for defining event blocks for list events.
Syntax
END-OF-PAGE.
Whenever the page footer is reached while a list is being created, the runtime environment triggers the END-OF-PAGE event, and the corresponding event block is executed.
END-OF-SELECTION
Event keywords for defining event blocks for reporting events.
Syntax
END-OF-SELECTION.
Once a logical database has read all of the required lines and passed them to the executable program, the runtime environment triggers the END-OF-SELECTION event, and the corresponding event block is executed.
ENDAT
Closes a statement block in control level processing.
Syntax
ENDAT.
This statement concludes a control level processing block introduced with AT.
ENDCASE
Closes a CASE control structure.
Syntax
ENDCASE.
This statement concludes a control structure introduced with CASE.
ENDCATCH
Closes a CATCH area.
Syntax
ENDCATCH.
This statement concludes an exception handling block introduced with CATCH SYSTEM-EXCEPTIONS.
ENDCLASS
Closes a class definition.
Syntax
ENDCLASS.
This statement concludes a class declaration or implementation introduced with CLASS.
ENDDO
Closes a DO loop.
Syntax
ENDDO.
This statement concludes a loop introduced with DO.
ENDEXEC
Closes a Native SQL statement.
Syntax
ENDEXEC.
This statement ends a Native SQL statement introduced with EXEC SQL.
ENDFORM
Closes a subroutine.
Syntax
ENDFORM.
This statement concludes a subroutine definition introduced with FORM.
ENDFUNCTION
Closes a function module.
Syntax
ENDFUNCTION.
This statement concludes a function module introduced with FUNCTION.
ENDIF
Closes an IF control structure.
Syntax
ENDIF.
This statement concludes a control structure introduced with IF.
ENDINTERFACE
Closes a interface definition.
Syntax
ENDINTERFACE.
This statement concludes an interface definition introduced with INTERFACE.
ENDLOOP
Closes a LOOP.
Syntax
ENDLOOP.
This statement concludes a loop introduced with LOOP.
ENDMETHOD
Closes a method.
Syntax
ENDMETHOD.
This statement concludes a method implementation introduced with METHOD.
ENDMODULE
Closes a dialog module.
Syntax
ENDMODULE.
This statement concludes a dialog module introduced with MODULE.
ENDON
Closes a conditional statement block.
Syntax
ENDON.
This statement ends a conditional statement block introduced with ON CHANGE.
ENDPROVIDE
Closes a PROVIDE loop.
Syntax
ENDPROVIDE.
This statement concludes a loop introduced with PROVIDE.
ENDSELECT
Closes a SELECT loop.
Syntax
ENDSELECT.
This statement concludes a loop introduced with SELECT.
ENDTRY
Closes a TRY area.
Syntax
ENDTRY.
This statement concludes a control structure introduced with TRY.
ENDWHILE
Closes a WHILE loop.
Syntax
ENDWHILE.
This statement concludes a loop introduced with WHILE.
EVENTS
Defines events in classes or interfaces.
Syntax
EVENTS <evt> EXPORTING.. VALUE(<ei>) TYPE type [OPTIONAL]...
The event <evt> can be declared in the declaration part of a class or within an interface definition, and may have EXPORTING parameters that are passed to the event handler. The parameters are always passed by value.
EXEC SQL
Introduces a Native SQL statement.
Syntax
EXEC SQL [PERFORMING <form>].
Between EXEC SQL and the ENDEXEC statement, you can include a database-specific Native SQL statement. The PERFORMING addition allows you to pass a multiple-line selection line by line to a subroutine.
EXIT
Leaves a loop or processing block.
Syntax
EXIT.
Within a loop: The entire loop is terminated, and processing continues with the first statement following the loop. Outside a loop: Terminates the current processing block. In a reporting event: Jumps directly to the output list.
EXIT FROM STEP-LOOP
Ends a step loop.
Syntax
EXIT FROM STEP-LOOP.
Terminates step loop processing. A step loop is ais a way of displaying a table on a screen.
EXIT FROM SQL
Ends Native SQL processing.
Syntax
EXIT FROM SQL.
This statement may occur within a subroutine called using the PERFORMING addition in the EXEC SQL statement. The entire subroutine is processed, but no more subsequent lines of the selection are processed.
EXPORT
Exports data clusters.
Syntax
EXPORT... <fi> [FROM <g i>]... | (<itab>)
       TO  MEMORY
         | DATABASE <dbtab>(<ar>) ID(<key>)
         | SHARED BUFFER <dbtab>(<ar>) ID(<key>).
The data objects <fi> or <g i>, or the data objects in the internal table <itab> are stored as a data cluster in the cross-program ABAP memory of the current internal session, in a cluster database table <dbtab>, or in the cross-transaction application buffer of the table <dbtab>.
EXTRACT
Creates an extract dataset and adds lines to it.
Syntax
EXTRACT <fg>.
With the first EXTRACT statement of a program, the system creates the extract dataset and adds the first extract record. In each subsequent EXTRACT statement, the new extract record is added to the dataset. Each extract record contains exactly those fields that are contained in the field group <fg>, plus the fields of the field group HEADER (if one exists).
F                                                                                                   
FETCH
Uses a cursor to read entries from a database table.
Syntax
FETCH NEXT CURSOR <c> INTO <target>.
If the cursor <c> is linked with a selection in a database table, FETCH writes the next line of the selection into the flat target area <target>.
FIELD-GROUPS
Declares a field group for an extract dataset.
Syntax
FIELD-GROUPS <fg>.
This statement defines a field group <fg>. Field groups define the line structure of an extract dataset. You can also define a special field group called HEADER: When filling the extract dataset, the system automatically prefixes any other field groups with this field group.
FIELD-SYMBOLS
Declares field symbols.
Syntax
FIELD-SYMBOLS <FS> [<type>|STRUCTURE <s> DEFAULT <wa>].
Field symbols are placeholders or symbolic names for other fields. Pointed brackets are part of the syntax for field symbol names. The <type> addition allows you to specify the type of a field symbol. The STRUCTURE addition forces a structured view of the data objects that you assign to the field symbol.
FIND
Searches for patterns.
Syntax
FIND <p> IN [SECTION OFFSET <off> LENGTH <len> OF] <text>
            [IGNORING CASE|RESPECTING CASE]
            [IN BYTE MODE|IN CHARACTER MODE]
            [MATCH OFFSET <o>] [MATCH LENGTH <l>].
The system searches the field <text> for the pattern <p>. The SECTION OFFSET <off> LENGTH <len> OF addition tells the system to search only from the <off> position in the length <len>. IGNORING CASE or RESPECTING CASE (default) specifies whether the search is to be case-sensitive. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions. The MATCH OFFSET and MATCH LENGTH additions set the offset of the first occurrence and length of the search string in the fields <p> and <l>.
FORM
Defines a subroutine.
Syntax
FORM <subr> [USING   ... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ]
                       [CHANGING... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ].
Introduces a subroutine <form>. The USING and CHANGING additions define the subroutine’s parameter interface. The subroutine end with ENDFORM.
FORMAT
Sets formatting options for list output.
Syntax
FORMAT... <optioni> [ON|OFF]...
The formatting options <option i > (such as color) set in the FORMAT statement, apply to all subsequent output until they are turned off using the OFF option.
FREE
Release space in memory.
Syntax
FREE <itab>.
FREE MEMORY ID(<key>).
FREE OBJECT <obj>.
This statement deletes an internal table, a data cluster in ABAP memory, or an external object in OLE2 Automation, depending on the variant of the statement used.
FUNCTION
Defines a function module.
Syntax
FUNCTION <func>.
Introduces the function module <func>. This statement is not entered in the ABAP Editor, but is automatically generated by the Function Builder in the ABAP Workbench. The function module definition ends with the ENDFUNCTION statement
FUNCTION-POOL
Introduces a function group.
Syntax
FUNCTION-POOL.
The first statement in a function group. This statement is not entered in the ABAP Editor, but is automatically generated by the Function Builder in the ABAP Workbench. A function group is an ABAP program that contains function modules.
G
GET
Event keyword for defining event blocks for reporting events.
Syntax
GET <node> [FIELDS <f1> <f 2>...].
Only occurs in executable programs. When the logical database has passed a line of the node <node> to the program, the runtime environment triggers the GET event, and the corresponding event block is executed. You can use the FIELDS option to specify explicitly the columns of a node that the logical database should read.
GET BIT
Reads an individual bit.
Syntax
GET BIT <n> OF <f> INTO <g>.
Reads the bit at position <n> of the hexadecimal field <f> into the field <b>.
GET CURSOR
Gets the cursor position on a screen or in an interactive list event.
Syntax
GET CURSOR FIELD <f> [OFFSET <off>] [LINE <lin>]
[VALUE <val>] [LENGTH <len>].
GET CURSOR LINE <lin> [OFFSET <off>] [VALUE <val>] [LENGTH <len>].
At a user action on a list or screen, the statement writes the position, value, and displayed length of a field or line into the corresponding variables.
GET DATASET
Syntax
GET DATASET <dsn> [POSITIONS <pos>]
[ATTRIBUTE <attr>].
Gets the attributes of a file opened using OPEN DATASET. The POSITIONS additions writes the current read/write position to the field <pos>. The ATTRIBUTE addition writes the attributes to a structure, <attr>, of the type DSET_ATTRIBUTES.
GET LOCALE LANGUAGE
Gets the current text environment.
Syntax
GET LOCALE LANGUAGE <lg> COUNTY <c> MODIFIER <m>.
Returns the current language, country ID and any modifier into the corresponding variables
GET PARAMETER
Gets an SPA/GPA parameters
Syntax
GET PARAMETER ID <pid> FIELD <f>.
Writes the value of the SPA/GPA parameter <pid> from the user-specific SAP memory into the variable <f>.
GET PF-STATUS
Gets the current GUI status.
Syntax
GET PF-STATUS <f> [PROGRAM <prog>] [EXCLUDING <itab>].
Returns the name of the current GUI status (the same as SY-PFKEY) into the variable <f>. The PROGRAM addition writes the name of the ABAP program to which the status belongs into the variable <prog>. The EXCLUDING addition returns a list of all currently inactive function codes into the internal table <itab>.
GET PROPERTY
Gets a property of an OLE2 Automation object.
Syntax
GET PROPERTY OF <obj> <p> = <f>.
Writes the property <p> of an external OLE2 Automation object to the variable <f>.
GET REFERENCE
Gets a data reference.
Syntax
GET REFERENCE OF <obj> INTO <dref>.
Writes a data reference to an existing data object <obj> to the data reference variable <dref>.
GET RUN TIME FIELD
Measures the runtime in microseconds.
Syntax
GET RUN TIME FIELD <f>.
The first time the statement is executed, the variable <f> is set to zero. In each subsequent call, the runtime since the first call is written to <f>.
GET TIME
Synchronizes the time.
Syntax
GET TIME [FIELD <f>].
Refreshes the system fields SY-UZEIT, SY-DATUM, SY-TIMLO, SY-DATLO, and SY-ZONLO. The FIELD addition fills the variable <f> with the current time.
GET TIME STAMP FIELD
Returns a time stamp.
Syntax
GET TIME STAMP FIELD <f>.
Returns the short or long form of the current date and time, depending on whether the variable <f> has the type P(8) or P(11). The long form returns the time correct to seven decimal places.
H                                                                                                   
HIDE
Stores information about list lines.
Syntax
HIDE <f>.
While the list is being created, this statement stores the contents of the field <f> and the current line number in the internal HIDE area When the cursor is positioned on a line in an interactive list event, the stored value is returned to the field <f>.
I                                                                                                   
IF
Conditional branch.
Introduces a new branch.
Syntax
IF <logexp>.
Opens an IF control structure that ends with an ENDIF statement. The system evaluates the logical expression <logexp>, and processes different statement blocks depending on the result.
IMPORT
Imports data clusters.
Syntax
IMPORT... <fi> [TO <g i>]... | (<itab>)
       FROM  MEMORY
           | DATABASE <dbtab>(<ar>) ID(<key>)
           | SHARED BUFFER <dbtab>(<ar>) ID(<key>).
The data objects <fi> or <g i>, or the data objects in the internal table <itab> are read from data clusters, either in the cross-program ABAP memory of the current internal session; in a cluster database table <dbtab>; or in the cross-transaction application buffer of the table <dbtab> and written to the variables <f i> and <g i>.
IMPORT DIRECTORY
Creates the directory of a data cluster from a cluster database.
Syntax
IMPORT DIRECTORY INTO <itab>
       FROM DATABASE <dbtab>(<ar>)
       Id <key>.
Writes a directory of the data objects belonging to a data cluster in the cluster database <dbtab> to the internal table <dirtab>.
In the third variant, the table <itab> contains a directory of the objects stored using EXPORT TO DATABASE.
INCLUDE
Inserts an include program in another program.
Syntax
INCLUDE <incl>.
Has the same effect as copying the source code of the include program <incl> into the program. Include programs are not loaded at runtime, but are expanded when the program is generated. Include programs must have the program type I.
INCLUDE TYPE|STRUCTURE
Includes a structure within another.
Syntax
INCLUDE TYPE <t>|STRUCTURE <s> [AS <name> [RENAMING WITH SUFFIX <suffix>]].
Within a structure declared using TYPES|DATA BEGIN OF, copies a structured datatype <t>, or a structure <s> already available as a data object, as part of the structure declaration. The AS addition lets you address the individual components using the name <name>. The RENAMING addition lets you append a suffix, <suffix>, to <name>, so that you can copy the same structure several times.
INITIALIZATION
Event keywords for defining event blocks for reporting events.
Syntax
INITIALIZATION.
Only occurs in executable programs. The ABAP runtime environment triggers the INITIALIZATION event before the selection screen is processed, at which point the corresponding event block is processed.
INSERT for Database Tables
Inserts entries from database tables.
Syntax
INSERT <dbtab> FROM <wa>.
INSERT <dbtab> FROM TABLE <itab> [ACCEPTING DUPLICATE KEYS].
Inserts one line from the work area <wa> or several lines from the internal table <itab> into the database table <dbtab>. The ACCEPTING DUPLICATE KEYS addition prevents a runtime error from occurring if two entries have the same primary key. Instead, it merely discards the duplicate
INSERT for Field Groups
Defines the structure of field groups for extract datasets.
Syntax
INSERT <f1>... <f n> INTO <fg>.
Includes the fields <fi> in the field group <fg>, thus defining a line structure for an extract dataset.
INSERT for any Internal Table
Inserts lines from internal tables of any type.
Syntax
INSERT <line>|LINES OF <jtab> [FROM <n1>] [TO <n 2>]
       INTO TABLE <itab>
       [ASSIGNING <FS> | REFERENCE INTO <dref>].
Inserts a line <line> or a set of lines from the internal table <jtab> into the internal table <itab>. If <jtab> is an index table, you can use the FROM and TO additions to restrict the lines inserted. If you use ASSIGNING or INTO REFERENCE, field symbol <FS> refers to the inserted line or the relevant data reference is stored in <dref> after the statement.
INSERT for Index Tables
Inserts entries in index tables.
Syntax
INSERT <line>|LINES OF <jtab> [FROM <n1>] [TO <n 2>]
  INTO <itab> [INDEX <idx>]
  [ASSIGNING <FS> | REFERENCE INTO <dref>].
Inserts a line <line> or a set of lines from the internal table <jtab> into the internal table <itab>before the line with the index <idx>. If <jtab> is an index table, you can use the FROM and TO additions to restrict the lines inserted. If you omit the INDEX addition, you can only use the statement within a LOOP. A new line containing values is inserted before the current line. If you use ASSIGNING or INTO REFERENCE, field symbol <FS> refers to the inserted line or the relevant data reference is stored in <dref> after the statement.
INSERT for Programs
Inserts ABAP programs into the program library.
Syntax
INSERT REPORT <prog> FROM <itab>.
The lines of the internal table <itab> are added to the program library as the program <prog>.
INTERFACE
Declares a interface in ABAP Objects.
Syntax
INTERFACE <ifac> [DEFERRED]
                 [LOAD].
Introduces an interface <interface>. The definition ends with ENDINTERFACE and contains the declaration of all the components of the interface. The DEFERRED addition makes the interface known to the program before it is defined. The LOAD addition loads an interface explicitly from the Class Library.
INTERFACES
Implementation or nesting of an interface in ABAP Objects.
Syntax
INTERFACES <ifac>
  [ABSTRACT|FINAL METHODS <meth1> <meth 2> | ALL METHODS ABSTRACT|FINAL ]
  [DATA VALUES <attr1> = <val 1> <attr 2> = <val 2> ...]
.
Used in a class declaration: This statement adds the components of the interface to the existing class definition. Used in an interface definition: Forms a compound interface. Use the additions to characterize methods in interfaces as abstract or final. Their attributes can be filled with initial values.
L                                                                                                   
LEAVE for Screens
Leaves a screen.
Syntax
LEAVE SCREEN.
Stops processing the current screen and calls the subsequent screen. The next screen can either be defined statically in the screen attributes or set dynamically using the SET SCREEN statement.
Syntax
LEAVE TO SCREEN <scr>.
Stops processing the current screen and calls the dynamically-defined subsequent screen <scr>*.
LEAVE for Lists During Screen Processing
Switches between screen and list processing.
Syntax
LEAVE TO LIST-PROCESSING [AND RETURN TO SCREEN <scr>].
Allows you to create and display a list while processing a series of screens. The addition allows you to specify the next screen (to which you return after the list has been displayed). If you do not use the addition, screen processing resumes with the PBO of the current screen
Syntax
LEAVE LIST-PROCESSING.
Allows you to switch back explicitly from list processing to screen processing.
LEAVE for Programs
Leaves an ABAP program.
Syntax
LEAVE [PROGRAM].
Stops processing the current program and returns to the point from which it was called.
Syntax
LEAVE TO TRANSACTION <tcod> [AND SKIP FIRST SCREEN].
This statement ends processing of the current program and starts a new transaction, <tcod>. The addition allows you to skip the initial screen of the transaction.
LOAD-OF-PROGRAM
Event keywords for defining event blocks for a program constructor.
Syntax
LOAD-OF-PROGRAM.
When an ABAP program is loaded in an internal session, the runtime environment triggers the LOAD-OF-PROGRAM event, and the corresponding event block is executed.
LOCAL
Protects global data against changes.
Syntax
LOCAL <f>.
Only occurs in subroutines. When the subroutine starts, the value of <f> is stored temporarily, and restored to the variable <f> at the end of the subroutine.
LOOP Through Extracts
Introduces a loop through an extract dataset.
Syntax
LOOP.
Loops through an extract dataset. The loop ends with an ENDLOOP statement. When the LOOP statement is executed, the system stops creating the extract dataset of the program, and starts a loop through the entries in the dataset. One record from the extract dataset is read in each loop pass. The values of the extracted fields are placed in the corresponding output fields of the field group within the loop.
LOOP THROUGH internal tables
Starts a loop through an extract dataset.
Syntax
LOOP AT <itab> INTO <wa> WHERE <logexp>.
LOOP AT <itab> ASSIGNING <FS> WHERE <logexp>.
LOOP AT <itab> REFERENCE INTO <dref> WHERE <logexp>.
LOOP AT <itab> TRANSPORTING NO FIELDS WHERE <logexp>.
Loop through any Internal Table The loop ends with an ENDLOOP statement. If the logical expression <logexp> is true, each loop pass either assigns the current line content to the work area <wa>; assigns the current line to a field symbol <FS>; creates a reference to the current line by <dref>; or does not assign the line content at all. The first operand in each part of <logexp> must be a component of the internal table. Pointed brackets are part of the syntax for field symbol names.
With index tables, you can use the additions FROM <n> and TO <n> to restrict the lines that are read by specifying an index range.
LOOP Through Screen Fields
Starts a loop through the table SCREEN.
Syntax
LOOP AT SCREEN...
Similar to a loop through an internal table. The system table SCREEN contains the names and attributes of all of the fields on the current screen.
M                                                                                                   
MESSAGE
Displays a message.
Syntax
MESSAGE <xnnn> [WITH <f1>... <f4>] [RAISING <except>].
MESSAGE ID <mid> TYPE <x> NUMBER <nnn>.
MESSAGE <xnnn>(<mid>).
Displays the message <nnn> of message class <mid> as message type <x>. The message type specifies how the message is displayed, and how the program reacts. The WITH addition allows you to fill placeholders in the message text. The RAISING addition in function modules and methods allows you to terminate the procedure and trigger the exception <exception>.
MESSAGE <msg> TYPE <x>
This variant display a string, <msg>, directly as a message of the type <x>.
METHOD
Introduces the implementation of a method in a class.
Syntax
METHOD <meth>.
Only occurs in the implementation part of classes. Introduces a statement block that ends with ENDMETHOD. You do not have to specify any interface parameters, since these are defined in the method declaration.
METHODS
Declares methods in classes and interfaces.
Syntax
METHODS <meth> [FOR EVENT <evt> OF <cif>]
        IMPORTING... [VALUE(]<ii>[)] TYPE <t> [OPTIONAL]...
        EXPORTING... [VALUE(]<ei>[)] TYPE <t> [OPTIONAL]...
CHANGING ... [VALUE(]<ci>[)] TYPE <t> [OPTIONAL]...
        RETURNING VALUE(<r>)
        EXCEPTIONS       ... <ei>...
        [ABSTRACT]
        [FINAL]
        [REDEFINITION].
You declare a method <met> in the definition part of a class or in the definition of an interface: The IMPORTING, EXPORTING, CHANGING, RETURNING, and EXCEPTIONS additions define the parameter interface and exceptions of the method. The ABSTRACT addition defines an abstract class, which cannot be implemented in the same class. The function of a non-abstract method must be implemented using METHOD. The FINAL addition prevents you from redefining the method in subclasses. The REDEFINITION addition redefines a method of a superclass. The FOR EVENT addition declares an event handler method for the <evt> event of a class or interface.
MODIFY for Database Tables
Inserts or changes lines in database tables.
Syntax
MODIFY <dbtab> FROM <wa>.
MODIFY <dbtab> FROM TABLE <itab>.
Works like INSERT for database tables, if there is not yet a line in the table with the same primary key. Works like UPDATE if a line already exists with the same primary key.
MODIFY for any Internal Table
Changes the content of lines in internal tables of any type.
Syntax
MODIFY TABLE <itab> FROM <wa> [TRANSPORTING <f1> <f 2>...]
                              [ASSIGNING <FS> | REFERENCE INTO <dref>].
Copies the work area <wa> into the line of the internal table with the same table key as <wa>. If you use ASSIGNING or INTO REFERENCE, field symbol <FS> refers to the modified line or the relevant data reference is stored in <dref> after the statement. You can use the TRANSPORTING addition to specify the exact components that you want to change.
MODIFY <itab> FROM <wa> TRANSPORTING <f1> <f 2>... WHERE <logexp>.
Copies the work area <wa> into the line of the internal table for which the logical expression is true. In each comparison of the logical expression, the first operand must be a component of the line structure.
MODIFY for Index Tables
Changes the content of lines in index tables.
Syntax
MODIFY <itab> FROM <wa> [INDEX <idx>] [TRANSPORTING <f1> <f 2>...]
                        [ASSIGNING <FS> | REFERENCE INTO <dref>].
Copies the work area <wa> into the line of the internal table with the index <idx>. If you omit the INDEX addition, you can only use the statement within a LOOP. In this case, you change the current loop line If you use ASSIGNING or INTO REFERENCE, field symbol <FS> refers to the modified line or the relevant data reference is stored in <dref> after the statement.
MODIFY for Lists
Changes a list line.
Syntax
MODIFY LINE <n> [INDEX <idx>] [OF CURRENT PAGE|OF PAGE <p>]
      |CURRENT LINE
      LINE FORMAT <option1> <option2>...
      FIELD VALUE <f1> [FROM <g1>] <f2> [FROM <g2>]...
      FIELD FORMAT <f1> <options1> <f2> <options2>.
Changes either line <n> on the current or specified list (or page), or the last line to be chosen. The exact nature of the change is specified in the additions
MODIFY SCREEN
Changes the SCREEN table.
Syntax
MODIFY SCREEN...
Like changing an internal table. The system table SCREEN contains the names and attributes of all of the fields on the current screen.
MODULE
Introduces a dialog module.
Syntax
MODULE <mod> OUTPUT |[INPUT].
Introduces the dialog module <mod>. The OUTPUT and INPUT additions designate the module as a PBO or PAI module respectively. Each dialog module ends with ENDMODULE.
MOVE
Assigns values.
Syntax
MOVE <f1> TO <f2>.
Assigns the contents of the data object <f1> to the variable <f2>, with automatic type conversion if necessary. Equivalent to <f2> = <f1>.
MOVE-CORRESPONDING
Assigns values between identically-named components of structures.
Syntax
MOVE-CORRESPONDING <struc1> TO <struc2>.
Moves the contents of the components of structure <struc1> to the components of <struc2> that have identical names.
MULTIPLY
Multiplies two single fields.
Syntax
MULTIPLY <n> BY <m>.
Multiplies the content of <n> by <m>, and stores the result in <n>. This is equivalent to: m=m*n.
MULTIPLY-CORRESPONDING
Multiplies components of structures.
Syntax
MULTIPLY-CORRESPONDING <struc1> BY <struc2>.
All the identically-named subfields of the structures <struc1> and <struc2> are multiplied and the results are stored these subfields of <struc1>.
N                                                                                                   
NEW-LINE
Inserts a line break in a list.
Syntax
NEW-LINE [NO-SCROLLING|SCROLLING].
Positions the list display after the page header. The NO-SCROLLING addition prevents the new line from scrolling horizontally. SCROLLING resets the NO-SCROLLING addition.
NEW-PAGE
Inserts a page break in a list.
Syntax
NEW-PAGE [NO-TITLE|WITH-TITLE]
         [NO-HEADING|WITH-HEADING]
         [LINE-COUNT]
         [LINE-SIZE]
         [PRINT ON|OFF].
Generates a new page and positions the list output after the page header. The additions control how the page header is displayed, the length and width of the page, and the print output.
NODES
Declares an interface work area.
Syntax
NODES <node>.
Declares a variable with the same data type and the same name as a data type from the ABAP Dictionary. Structures in main programs and subroutines declared using NODES use a common data area. This statement is used in conjunction with logical databases.
O                                                                                                   
ON CHANGE
Introduces a new branch.
Syntax
ON CHANGE OF <f> [OR <f1> OR <f2>...].
Opens an ON control structure, which ends with ENDON. The statement block is executed whenever the contents of the field <f> or one of the other fields <fi> has changed since the statement was last executed.
OPEN CURSOR
Opens a database cursor.
Syntax
OPEN CURSOR [WITH HOLD] <c> FOR SELECT      <result>
                                  FROM      <source>
                                  [WHERE    <condition>]
                                  [GROUP BY <fields>]
                                  [HAVING   <cond>]
                                  [ORDER BY <fields>].
Opens a cursor <c> with type CURSOR for a SELECT statement. You can use all the clauses of the SELECT statement apart from the INTO clause. The INTO clause is set in the FETCH statement. If you use the WITH HOLD addition, the cursor is not closed when a database commit occurs.
OPEN DATASET
Opens a file.
Syntax
OPEN DATASET <dsn>
             [FOR INPUT|OUTPUT|APPENDING|UPDATE]
             [IN BINARY MODE
             |IN TEXT MODE [ENCODING (DEFAULT|UTF-8|NON-UNICODE)]
             |IN LEGACY BINARY MODE [(BIG|LITTLE) ENDIAN] [CODE PAGE <cp>]
             |IN LEGACY TEXT MODE [(BIG|LITTLE) ENDIAN] [CODE PAGE <cp>]]
             [REPLACEMENT CHARACTER <rc>]
             [IGNORING CONVERSION ERRORS]
             [AT POSITION <pos>]
             [TYPE <c>]
             [MESSAGE <mess>]
             [FILTER <filt>].
Opens a file <dsn> on the application server. The additions after FOR specify how the file is read or written. The MODE additions specifies how content is interpreted (as characters or in binary form). The ENCODING addition specifies the character representation in the file. The LEGACY MODE allows you to read files that were written before Release 6.10. REPLACEMENT CHARACTERS and CONVERSION ERRORS are used to handle errors during character set conversion. AT POSITION specifies the position in the file. MESSAGE specifies where system messages are stored. FILTER lets you specify operating system commands.
OVERLAY
Overlays one string with another:
Syntax
OVERLAY <c1> WITH <c2> [ONLY <str>].
This statement overlays all positions in field <c1> containing letters which occur in <str> with the contents of <c2>. <c2> remains unchanged. If you omit ONLY <str>, all positions of <c1> containing spaces are overwritten.
P                                                                                                   
PACK
Converts type C variables to type P.
Syntax
PACK <f> TO <g>.
Packs the string <f> and places it in the field <g>. This can be reversed with the UNPACK statement.
PARAMETERS
Declares parameters for a selection screen.
Syntax
PARAMETERS <p>[(<length>)] [TYPE <type>|LIKE <obj>] [DECIMALS <d>]
              [DEFAULT <f>]
              [MEMORY ID <pid>]
              [LOWER CASE]
              [OBLIGATORY]
              [VALUE CHECK]
              [AS CHECKBOX]
              [RADIOBUTTON GROUP <radi>]
              [NO-DISPLAY]
              [MODIF ID <key>].
Declares a variable <p>, as in the DATA statement. For <p>, an input field appears on the corresponding selection screen. The additions allow you to define default values, accept lowercase input, define the field as required, check values, define a checkbox or radio button, prevent the field from being displayed on the selection screen, or modify the field
PERFORM
Calls a subroutine.
Syntax
PERFORM    <subr>
        |  <subr>(<prog>) [IF FOUND]
        |(<fsubr>)[IN PROGRAM (<fprog>)][IF FOUND]
        [USING  ... <pi>... ]
        [CHANGING... <pi>... ]
        [ON COMMIT].
Calls an internal or external subroutine <subr> or the subroutine whose name occurs in the <fsubr> field. The external program is <prog> or the name contained in <fprog>. The IF FOUND addition prevents a runtime error from occurring if the subroutine does not exist. The USING and CHANGING additions fill the subroutine’s parameter interface. The ON COMMIT addition delays the execution of the subroutine until the next COMMIT WORK statement.
POSITION
Absolute position of the display in a list.
Syntax
POSITION <col>.
Positions the list display in the column <col>.
PRINT-CONTROL for Print Format
Specifies the print format.
Syntax
PRINT-CONTROL <formats> [LINE <lin>] [POSITION <col>].
Sets the print format starting either at the current list position or at line <lin> and column <col>.
PRINT-CONTROL for Index Lines
Creates index lines in the spool file.
Syntax
PRINT-CONTROL INDEX-LINE <f>.
Writes the contents of field <f> into an index line after finishing the current print line. The index line is not printed. During optical archiving, the spool system divides the list into a data file and a description file containing the index lines.
PRIVATE
Defines the private section of a class.
Syntax
PRIVATE SECTION.
Introduces the declaration of all of the components of a class that are only visible in the class itself.
PROGRAM
Introduces a program.
Syntax
PROGRAM <prog>...
The first statement in some ABAP programs. Equivalent to: REPORT.
PROTECTED
Defines the protected section of a class.
Syntax
PROTECTED SECTION.
Introduces the declaration of all of the components of a class that are only visible in the class and its subclasses.
PROVIDE
Loops through internal tables at given intervals.
Syntax
PROVIDE <f1>... <fn> FROM <itab1>
        <g1>... <gm> FROM <itab2>
         ...         FROM <itabn>
         ... BETWEEN <f> AND <g>.
The contents of the specified fields of the internal tables <itab1> … <itabn> are placed in their header lines. The processing block between PROVIDE and ENDPROVIDE is then executed for each interval.
PUBLIC
Defines the public section of a class.
Syntax
PUBLIC SECTION.
Introduces the declaration of all of the components of a class that are visible in the class, its subclasses, and all users.

PUT
Triggers a GET event.
Syntax
PUT <node>.
Only occurs in logical databases. Directs the program flow according to the structure of the logical database.

R                                                                                                   
RAISE for Class-Based Exceptions
Raises an exception.
Syntax
RAISE EXCEPTION TYPE <class> | <ref>.
Terminates processing and raises an exception of the exception class <class>. If the reference variable <ref> points to an object of an exception class, <class> can be specified instead of TYPE.
RAISE for Exceptions of Function Modules and Methods
Raises exceptions.
Syntax
RAISE <except>.
Only occurs in function modules and methods. Terminates processing and raises an exception <except> defined in the interface.

RAISE for Events
Triggers events in ABAP Objects.
Syntax
RAISE EVENT <evt>.
Only occurs in methods. Triggers the event <evt> and calls all registered handler methods.

RANGES
Declares a RANGES table.
Syntax
RANGES <rangetab> FOR <f>.
Declares a RANGES table for the field <f>. A RANGES table has the same data type as a selection table, but is not linked to input fields on a selection screen.

READ for Files
Reads a file.
Syntax
READ DATASET <dsn> INTO <f>
[MAXIMUM LENGTH <maxlen>]
[ACTUAL LENGTH <len>].
Reads the contents of the file <dsn> on the application server to the variable <f>. The amount of data can be specified using MAXIMUM LENGTH. The number of bytes transferred can be written to <len> using ACTUAL LENGTH.

READ for any Internal Table
Reads a line of an internal table.
Syntax
READ TABLE <itab>  FROM <wa>
                  |WITH TABLE KEY <k1> = <f1>... <kn> = <fn>
                  |WITH KEY = <f>
                  |WITH KEY <k1> = <f1>... <kn> = <fn>
      INTO <wa> [COMPARING <f1> <f2>... |ALL FIELDS]
                [TRANSPORTING <f1> <f2>... |ALL FIELDS|NO FIELDS]
     |ASSIGNING <FS>
     |REFERENCE INTO <dref>.
This statement reads either the line of the internal table with the same key as specified in the work area <wa>, the line with the key specified in the TABLE KEY addition, the line that corresponds fully to <f>, or the one corresponding to the freely-defined key in the KEY addition. The contents of the line are either written to the work area <wa>, or the line is assigned to the field symbol <FS>. If you assign the line to a work area, you can compare field contents and specify the fields that you want to transport.

READ for Index Tables
Reads a line of an internal table.
Syntax
READ TABLE <itab> INDEX <idx>   INTO <wa>...
                              | ASSIGNING <FS>
                              | REFERENCE INTO <dref>.
The line with index 7 is read. The result is specified as with any internal table.

READ for Lists
Reads the contents of a line from a list.
Syntax
READ LINE  <n> [INDEX <idx>] [OF CURRENT PAGE|OF PAGE <p>]
          |CURRENT LINE
          [FIELD VALUE <f1> [INTO <g1>]... <fn> [INTO <gn>]].
Reads either the line <n> on the current or specified list or page, or the last line to have been selected by the user. The addition specifies the fields that you want to read, and the target fields into which they should be placed. The entire line is always placed in the system field SY-LISEL, and the HIDE area is filled for the line.

READ for Programs
Reads ABAP programs into the program library.
Syntax
READ REPORT <prog> INTO <itab>.
Copies the lines of the program <prog> into the internal table <itab>.

RECEIVE
Receives results from an asynchronous function module call.
Syntax
RECEIVE RESULTS FROM FUNCTION <func> [KEEPING TASK]
                     [IMPORTING ... fi = a i... ]
                     [TABLES    ... fi = a i... ]
                     [EXCEPTIONS... ei = r i... ]
Occurs in special subroutines to receive IMPORTING and TABLES parameters from function modules called using the STARTING NEW TASK addition

REFRESH
Initializes an internal table.
Syntax
REFRESH <itab>.
Resets the internal table <itab> to its initial value, that is, deletes all of its lines.

REFRESH CONTROL
Initializes a control.
Syntax
REFRESH CONTROL <ctrl> FROM SCREEN <scr>.
The control <ctrl> defined in the CONTROLS statement is reset with the initial values specified for screen <scr>.

REJECT
Leaves an GET processing block.
Syntax
REJECT [<dbtab>].
Terminates the processing of the current line of the node of the logical database. If you use the optional <dbtab>, the logical database reads the next line of the node <dbtab>.

REPLACE by Pattern
Replaces strings in fields with other strings using a pattern.
Syntax
REPLACE [ FIRST OCCURENCE OF | ALL OCCURENCES OF ] <old>
        IN [ SECTION OFFSET <off> LENGTH <len> OF ] <text> WITH <new>
        [IGNORING CASE|RESPECTING CASE]
        [IN BYTE MODE|IN CHARACTER MODE]
        [REPLACEMENT COUNT <c>]
        [REPLACEMENT OFFSET <r>]
        [REPLACEMENT LENGTH <l>].
In the string <text>, the search pattern <old> is replaced by the content of <new>. By default, the first occurrence of <old> is replaced. ALL OCCURENCES specifies that all occurrences be replaced. In the fields <old> and <new>, trailing spaces in C fields are ignored, but included in <text>. The SECTION OFFSET <off> LENGTH <len> OF addition tells the system to search and replace only from the <off> position in the length <len>. IGNORING CASE or RESPECTING CASE (default) specifies whether the search is to be case-sensitive. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions. The REPLACEMENT additions write the number of replacements, the offset of the last replacement, and the length of the last replaced string <new> to the fields <c>, <r>, and <l>.

REPLACE by Position
Replaces strings in fields with other strings by position.
Syntax
REPLACE <str1> WITH <str2> INTO <c> [LENGTH <l>].
                                    [IN BYTE MODE|IN CHARACTER MODE].
ABAP searches the field <c> for the first occurrence of the first <l> characters in the pattern <str1> and replaces them with the string <str2>. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions.

REPORT
Introduces a program.
Syntax
REPORT <rep> [MESSAGE-ID <mid>]
             [NO STANDARD PAGE HEADING]
             [LINE-SIZE <col>]
             [LINE-COUNT <n>(<m>)]
             [DEFINING DATABASE <ldb>].
The first statement in executable ABAP programs. <rep> can be any name you choose. The addition MESSAGE-ID specifies a message class to be used in the program. The DEFINING DATABASE addition defines the program as the database program of the logical database <ldb>. The other additions are formatting specifications for the default list of the program.

RESERVE
Inserts a conditional page break in a list.
Syntax
RESERVE <n> LINES.
Executes a page break on the current page if less than <n> lines are free between the current line and the page footer.

RETURN
Leaves a processing block.
Syntax
RETURN.
Leaves the current processing block. In a reporting event: Jumps directly to the output list.

ROLLBACK
Undoes the changes in a SAP LUW.
Syntax
ROLLBACK WORK.
ROLLBACK WORK always undoes all changes back to the start of the database LUW. The update modules are not called, and the log entry is deleted from table VBLOG. 

S                                                                                                   
SCROLL
Scrolls through lists
Syntax
SCROLL LIST FORWARD|BACKWARD [INDEX <idx>].
SCROLL LIST TO FIRST PAGE|LAST PAGE|PAGE <pag>
            [INDEX <idx>] [LINE <lin>].
SCROLL LIST LEFT|RIGHT [BY <n> PLACES] [INDEX <idx>].
SCROLL LIST TO COLUMN <col> [INDEX <idx>].
Positions the current list or the list level <idx> in accordance with the additions specified. You can scroll by window, page, columns, or to the left- or right-hand edge of the list.

SEARCH
Searches for strings.
Syntax
SEARCH <f>|<itab> FOR <g> [ABBREVIATED]
                          [STARTING AT <n1>]
                          [ENDING AT <n2>]
                          [AND MARK]
                          [IN BYTE MODE|IN CHARACTER MODE].
Searches the field <f> or table <itab> for the string in the field <g>. The result is stored in SY-FDPOS. The additions let you hide intermediate characters, search from and to a particular position, and convert the found string into uppercase. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions.

SELECT
Reads data from the database.
Syntax
SELECT <result>
  INTO <target>
  FROM <source>
  [WHERE <condition>]
  [GROUP BY <fields>]
  [HAVING <cond>]
  [ORDER BY <fields>].
The SELECT statement consists of a series of clauses, each of which fulfils a certain task:

SELECT clause
Defines the structure of the selection.
Syntax
SELECT [SINGLE]|[DISTINCT]
       * | <si> [AS <a i>]... <agg>( [DISTINCT] <s j>) [AS <a j>]...
The selection can be one line, SINGLE, or several lines. You can eliminate duplicate lines using the DISTINCT addition. To select the entire line, use *, otherwise, you can specify individual columns <si>. For individual columns, you can use aggregate functions <agg>, and assign alternative column names <a i>.
INTO clause
Defines the target area into which the selection from the SELECT clause is written.

Syntax
...  INTO [CORRESPONDING FIELDS OF] <wa>
   | INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE <itab>
                                             [PACKAGE SIZE <n>]
   | INTO (<f1>, <f 2>,...)
The target area can be a flat work area <wa>, an internal table <itab>, or a list of fields <fi>. If you use the CORRESPONDING FIELDS addition, data is only selected if there is an identically-named field in the target area. If you use APPENDING instead of INTO, the data is appended to an internal table instead of overwriting the existing contents. PACKAGE SIZE allows you to overwrite or extend the internal table in a series of packages.The data type of the target area must be appropriate for the selection in the SELECT clause.

FROM clause
The FROM clause determines the database tables from which the data specified in the SELECT clause is read.
Syntax
... FROM [<tab> [INNER]|LEFT [OUTER] JOIN] <dbtab> [AS <alias>]
                               [ON <cond>]
         [CLIENT SPECIFIED]
         [BYPASSING BUFFER]
         [UP TO <n> ROWS]
You can read both single fields and groups of fields. You link several tables using inner and outer joins to link tables with conditions <cond>, where <tab> is a single table or itself a join condition. The names of database tables may be specified statically or dynamically, and you can use alias names. You can bypass automatic client handling with the CLIENT SPECIFIED addition, and SAP buffering with BYPASSING BUFFER. You can also restrict the number of lines read from the table using the UP TO <n> ROWS addition.

WHERE clause
Restricts the number of lines selected.
Syntax
... [FOR ALL ENTRIES IN <itab>] WHERE <cond>
The condition <cond> may contain one or more comparisons, tests for belonging to intervals, value list checks, subqueries, selection table queries or null value checks, all linked with AND, OR, and NOT. If you use the FOR ALL ENTRIES addition, the condition <cond> is checked for each line of the internal table <itab> as long as <cond> contains a field of the internal table as an operand. For each line of the internal table, the system selects the lines from the database table that satisfy the condition. The result set is the union of the individual selections resulting from each line.

GROUP BY clause
Groups lines in the selection.
Syntax
... GROUP BY <s1> <s 2>
Groups lines with the same contents in the specified columns. Uses aggregate functions for all other columns in each group. All columns of the SELECT clause that are not listed in the GROUP BY clause must be included in aggregate functions.
HAVING clause
Restricts the number of line groups selected.
Syntax
... HAVING <cond>
Like the WHERE clause, but can only be used in conjunction with a GROUP BY clause. The HAVING clause uses conditions to restrict the number of groups selected.
ORDER BY clause
Sorts the lines of the selection.
Syntax
... ORDER BY PRIMARY KEY |... <si> [ASCENDING|DESCENDING]...
Sorts the selection in ascending or descending order according to the primary key or the contents of the fields listed.

SELECT-OPTIONS
Declares selection criteria for a selection screen.
Syntax
SELECT-OPTIONS <sel> FOR <f>
               [DEFAULT <g> [to <h>] [OPTION <op>] SIGN <s>]
               [MEMORY ID <pid>]
               [LOWER CASE]
               [OBLIGATORY]
               [NO-DISPLAY]
               [MODIF ID <key>]
               [NO-EXTENSION]
               [NO INTERVALS]
               [NO DATABASE SELECTION].
Declares a selection table <sel> for the field <f>. For <sel>, places input fields on the corresponding selection screen. The additions allow you to set a default value, accept input in lowercase, define a required field, suppress or modify the display on the selection screen, restrict the selection table to a line or a selection to a single field, or prevent input from being passed to a logical database.

SELECTION-SCREEN for Selection Screen Formatting
Formats selection screens
Syntax
SELECTION-SCREEN SKIP [<n>].
SELECTION-SCREEN ULINE [[/]<pos(len)>] [MODIF ID <key>].
SELECTION-SCREEN COMMENT [/]<pos(len)> <comm> [FOR FIELD <f>]
                                              [MODIF ID <key>].
SELECTION-SCREEN BEGIN OF LINE.
 ...
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF BLOCK <block>
                                [WITH FRAME [TITLE <titel>]]
                                [NO INTERVALS].
 ...
SELECTION-SCREEN END OF BLOCK <block>.
SELECTION-SCREEN FUNCTION KEY <i>.
SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push>
                            USER-COMMAND <ucom> [MODIF ID <key>].
Allows you to insert blank lines, lines and comments, group input fields together in lines and blocks, and create pushbuttons.

SELECTION-SCREEN for Selection Screen Definition
Defines selection screens.
Syntax
SELECTION-SCREEN BEGIN OF <numb> [TITLE <tit>] [AS WINDOW].
 ...
SELECTION-SCREEN END OF <numb>.
Defines a selection screen with screen number <numb>. All PARAMETERS, SELECT-OPTIONS, and SELECTION-SCREEN statements that occur between these two statements define the input fields and the formatting of this selection screen. The TITLE <title> addition allows you to define a title for a selection screen. You can use the AS WINDOW addition to call a selection screen as a modal dialog box.

SELECTION-SCREEN for Selection Screen Versions
Defines selection screen versions.
Syntax
SELECTION-SCREEN BEGIN OF VERSION <dynnr>
 ...
  SELECTION-SCREEN EXCLUDE <f>.
 ...
SELECTION-SCREEN BEGIN OF VERSION <dynnr>.
Only occurs in logical databases. Hides fields that otherwise appear on the standard selection screen.

SELECTION-SCREEN for Logical Databases
Provides special functions.
Syntax
SELECTION-SCREEN DYNAMIC SELECTIONS | FIELD SELECTION
                 FOR NODE|TABLE <node>.
Only occurs in logical databases. Declares a node as accepting dynamic selections or field selections.

SET BIT
Sets individual bits.
Syntax
SET BIT <n> OF <f> [TO <b>].
This statement sets the bit at position <n> of the hexadecimal field <f> to 1 (or to the value of field <b>). The field <b> must contain the value 0 or 1.

SET BLANK LINES
Allows blank lines in lists.
Syntax
SET BLANK LINES ON|OFF.
Prevents blank lines created in WRITE statements from being suppressed in list output.

SET COUNTRY
Sets output Formats
Syntax
SET COUNTRY <c>.
Sets the output formats for numeric and date fields for the country with the ID <c>.

SET CURSOR
Sets the cursor on the screen.
Syntax
SET CURSOR FIELD <f> [OFFSET <off>]
                     [LINE <lin>].
SET CURSOR LINE <lin> [OFFSET <off>].
SET CURSOR <col> <line>.
Sets the cursor either to a particular position in a field, line, or column of a line.

SET DATASET
Syntax
SET DATASET <dsn> [POSITIONS <pos> | END-OF_FILE]
[ATTRIBUTE <attr>].
Changes the attributes of a file opened using OPEN DATASET. The POSITIONS addition sets the current read/write position to the value in the field <pos> or to the end of the file. The ATTRIBUTE addition passes the attributes to the file in a structure, <attr>, of the type DSET_ATTRIBUTES.

SET EXTENDED CHECK
Affects the extended program check.
Syntax
SET EXTENDED CHECK ON|OFF.
Switches the extended program check (SLIN) on or off, suppressing the corresponding messages.

SET HANDLER
Registers event handlers in ABAP Objects.
Syntax
SET HANDLER... <hi>... [FOR <ref>|FOR ALL INSTANCES].
If you do not use the FOR addition, the handler is set for all static events. Use the FOR addition to register handlers for instance events.

SET HOLD DATA
Sets a screen attribute.
Syntax
SET HOLD DATA ON|OFF.
Sets the screen attribute "Hold data" from the program.

SET LANGUAGE
Sets the display language.
Syntax
SET LANGUAGE <lg>.
All text symbols are refreshed with the contents of the text pool in language <lg>.

SET LEFT SCROLL BOUNDARY
Sets the left boundary for horizontal scrolling.
Syntax
SET LEFT SCROLL-BOUNDARY [COLUMN <col>].
Sets the current output position or the position <col> as the left-hand edge of the scrollable area on the current list page.

SET LOCALE LANGUAGE
Sets the current text environment.
Syntax
SET LOCALE LANGUAGE <lg> [COUNTRY <c>] [MODIFIER <m>].
Sets the text environment for alphabetical sorting according to the language <lg>, country <c>, and any further modifier <m>.

SET MARGIN
Sets the margin of a print page.
SET MARGIN <x> [<y>].
Sends the current list page to the spool system with a margin of <x> columns from the left-hand edge and <y> rows from the top edge of the page.

SET PARAMETER
Sets an SPA/GPA parameters
Syntax
SET PARAMETER ID <pid> FIELD <f>.
Writes the value of the field to the SPA/GPA parameter <pid> in the user-specific SAP memory.

SET PF-STATUS
Sets the GUI status
Syntax
SET PF-STATUS <stat> [EXCLUDING <f>|<itab>]
                     [IMMEDIATELY] [OF PROGRAM <prog>].
Sets the GUI status <stat> for the subsequent screens. The EXCLUDING addition allows you to deactivate functions dynamically. The IMMEDIATELY addition sets the GUI status of the list currently displayed. The OF PROGRAM addition allows you to use a GUI status from another program.

SET PROPERTY
Sets a property of an OLE2 Automation object.
Syntax
GET PROPERTY OF <obj> <p> = <f>.
Sets the property <p> of an external OLE2 Automation object to <f>.

SET RUN TIME ANALYZER
Controls runtime analysis.
Syntax
SET RUN TIME ANALYZER ON|OFF.
The runtime analysis only measures the runtime of the statements in the block between SET RUN TIME ANALYZER ON and OFF.

SET RUN TIME CLOCK
Controls runtime analysis.
Syntax
SET RUN TIME CLOCK RESOLUTION HIGH|LOW.
Sets the accuracy of the runtime to low accuracy with long measurement interval or high accuracy with shorter measurement interval.

SET SCREEN
Sets the next screen.
Syntax
SET SCREEN <scr>.
Temporarily overwrites the statically-defined next screen with <scr>. <scr> is processed after the current screen.

SET TITLEBAR
Sets the screen title.
Syntax
SET TITLEBAR <tit> [OF PROGRAM <prog>] [WITH <g1 >... <g9>].
Sets the title <tit> for the subsequent screens. The OF PROGRAM addition allows you to use a title from another program. The WITH addition fills any placeholders in the title.

SET UPDATE TASK LOCAL
Switches on local update.
Syntax
SET UPDATE TASK LOCAL.
Updates are processed in the current work process.

SET USER-COMMAND
Triggers a list event.
Syntax
SET USER-COMMAND <fc>.
Triggers a list event with the function code <fc> and calls the corresponding event block.

SHIFT
Shifts strings.
Syntax
SHIFT <c> [BY <n> PLACES] [LEFT|RIGHT|CIRCULAR]
          [IN BYTE MODE|IN CHARACTER MODE].
Shifts the field <c> by one or <n> places. The additions allow you to specify the direction, and how the empty spaces are dealt with. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions.

SKIP for Blank Lines
Generates blank lines in the display list.
Syntax
SKIP [<n>].
The system writes <n> blank lines into the current list, starting at the current line. If no value is specified for <n>, one blank line is output.

SKIP for Positioning
Absolute position of the display in a list.
Syntax
SKIP TO LINE <lin>.
Positions the list display in the line <col>.

SORT for Extracts
Sorts an extract dataset.
Syntax
SORT [ASCENDING|DESCENDING] [AS TEXT] [STABLE]
    ... BY <fi> [ASCENDING|DESCENDING] [AS TEXT]...
Ends the creation of the extract dataset of a program and, at the same time, sorts its records. Without the BY option, the system sorts the dataset by the key specified in the HEADER field group. You can define a different sort key by using the BY addition. The other additions specify whether you want to sort in ascending or descending order, and whether strings should be sorted alphabetically.

SORT for Internal Tables
Sorts internal tables.
Syntax
SORT <itab> [ASCENDING|DESCENDING] [AS TEXT] [STABLE]
           ... BY <fi> [ASCENDING|DESCENDING] [AS TEXT]...
Sorts the internal table <itab>. If you omit the BY addition, the table is sorted by its key. You can define a different sort key by using the BY addition. The other additions specify whether you want to sort in ascending or descending order, and whether strings should be sorted alphabetically.

SPLIT
Splits a string.
Syntax
SPLIT <c> AT <del> INTO <c1>... <cn> INTO TABLE <itab>
                  [IN BYTE MODE|IN CHARACTER MODE].
This statement searches the character field <c> for delimiter strings <del> and the parts before and after the delimiters are placed in the target fields <c1> ...> … <cn>, or into a new line of the internal table <itab>. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions.

START-OF-SELECTION
Event keywords for defining event blocks for reporting events.
Syntax
START-OF-SELECTION.
After the selection screen has been processed, the runtime environment triggers the LOAD-OF-PROGRAM event, and the corresponding event block is executed.

STATICS
Defines static variables.
Syntax
STATICS <f>...
Like DATA. Retains the value of a local variable beyond the runtime of the procedure in which it occurs.

STOP
Leaves a reporting event.
Syntax
STOP.
Only occurs in event blocks for reporting events. Leaves the event block and goes to the END-OF-SELECTION block.

SUBMIT
Calls an executable program of type 1.
Syntax
SUBMIT <rep> [AND RETURN] [VIA SELECTION-SCREEN]
                          [USING SELECTION-SET <var>]
                          [WITH <sel> <criterion>]
                          [WITH FREE SELECTIONS <freesel>]
                          [WITH SELECTION-TABLE <rspar>]
                          [LINE-SIZE <width>]
                          [LINE-COUNT <length>].
Calls the program <rep>. If you omit the AND RETURN addition, the current program is terminated. Otherwise, the data from the current program is retained, and processing returns to the calling program when <rep> has finished running. The other additions control the selection screen and set attributes of the default list in the called program.

SUBTRACT for single fields
Subtracts two single fields.
Syntax
SUBTRACT <n> FROM <m>.
The contents of <n> are subtracted from the contents of <m> and the results are stored in <m>. This is equivalent to: <m> = <m> - <n>.

SUBTRACT-CORRESPONDING
Subtracts components of structures.
Syntax
SUBTRACT-CORRESPONDING <struc1> FROM <struc2>.
All the subfields of the structures <struc1> and <struc2> having the same name are subtracted and the results are stored in <struc2>.

SUM
Calculates sums of groups.
Syntax
SUM.
Only occurs in loops through internal tables. Calculates the sums of the numeric fields in all lines of the current control level and writes the results to the corresponding fields in the work area.

SUPPLY
Fills context instances with values.
Syntax
SUPPLY <key1> = <f 1>... <key n> = <f n> TO CONTEXT <inst>.
Fills the key fields <keyn> of the context instance <inst> with the values <f n>.

SUPPRESS DIALOG
Prevents the current screen from being displayed.
Syntax
SUPPRESS DIALOG.
Can only occur in a PBO dialog module. The screen is not displayed, but its flow logic is still processed. 

T                                                                                                   
TABLES
Declares an interface work area.
Syntax
TABLES <dbtab>.
Declares a structure with the same data type and the same name as a database table, a view, or a structure from the ABAP Dictionary. Structures in main programs and subroutines declared using TABLES use a common data area.

TOP-OF-PAGE
Event keywords for defining event blocks for list events.
Syntax
TOP-OF-PAGE [DURING LINE-SELECTION].
Whenever a new page begins while a standard list is being created, the runtime environment triggers the TOP-OF-PAGE event and the corresponding event block is executed. The addition DURING LINE-SELECTION has the same function, but for detail lists.

TRANSFER
Writes to a file.
Syntax
TRANSFER <f> TO [LENGTH <len>].
Writes the field <f> to the file <dsn> on the application server. You can specify the length of the data you want to transfer using the LENGTH addition.

TRANSLATE
Converts characters to strings.
Syntax
TRANSLATE <c>  TO UPPER|LOWER CASE
              |USING <r>.
The characters of the string <c> are converted into upper- or lowercase, or according to a substitution rule specified in <r>.

TRY
Introduces a TRY block.
Syntax
TRY.
Class-based exceptions can be handled using the CATCH statement, within the block ended with ENDTRY.

TYPE-POOL
Introduces a type group.
Syntax
TYPE-POOL <tpool>.
The first statement in a type group. This statement is not entered in the ABAP Editor, but is automatically generated by the Dictionary in the ABAP Workbench. A type group is an ABAP program that contains type definitions and constant declarations that can be used in several programs.

TYPE-POOLS
Declares the types and constants of a type group to a program.
Syntax
TYPE-POOLS <tpool>.
This statement allows you to use all the data types and constants defined in the type group <tpool> in your program.

TYPES for Single Field Types
Defines a single field type.
Syntax
TYPES <t>[(<length>)] [TYPE <type>|LIKE <obj>] [DECIMALS <dec>].
Defines the internal data type <t> in the program with length <len>, reference to the ABAP Dictionary type <type> or a data object <obj>, and, where appropriate, with <dec> decimal places.
Syntax
TYPES <t> TYPE REF TO <class>|<interface>.
Defines the internal data type <t> in the program with reference to the class <class> or the interface <interface>.
Syntax
TYPES <t> TYPE REF TO DATA|<type>.
Defines the internal data type <t> as a data reference to a data object.

TYPES for Complex Types
Defines complex types.
Syntax
TYPES: BEGIN OF <structure>,
        ...
         <ti>...,
        ...
       END OF <structure>.
Combines the data types <ti> to form the structure <structure>. You can address the individual components of a structure in a program using a hyphen between the structure name and the component name as follows: <structure>-<t i>.
Syntax
TYPES <t> TYPE|LIKE <tabkind> OF <linetype> [WITH <key>].
Defines the local data type <t> in the program as an internal table with the access type <tabkind>, the line type <linetype>, and the key <key>.
Syntax
TYPES <t> TYPE|LIKE RANGE OF <type>|<obj>.
Defines the internal data type <t> as a RANGES table. A RANGES table has the same data type as a selection table, but is not linked to input fields on a selection screen. 

U                                                                                                   
ULINE
Places horizontal lines in the display list.
Syntax
ULINE [AT [/][<pos>][(<len>)]].
Without additions, creates a new line on the current list and fills it with a horizontal line. The additions allow you to insert a line break and specify the starting position and length of the line.

 UNPACK
Converts type P variables to type C.
Syntax
UNPACK <f> TO <g>.
Unpacks the packed field <f> and places it in the string <g> with leading zeros. This can be reversed with the PACK statement.

UPDATE
Changes entries in database tables.
Syntax
UPDATE <dbtab> SET  <si> = <f>
                   |<si> = <s i> + <f>
                   |<si> = <s i> - <f> [WHERE <cond>].
The value in the column <si> is set to the value <f>, increases it by <f>, or decreases it by <f> for all lines selected. The WHERE clause specifies the lines that are changed. If you omit the WHERE clause, all lines are changed.
Syntax
UPDATE <dbtab> FROM <wa>.
UPDATE <dbtab> FROM TABLE <itab>.
This deletes the line that has the same primary key as the work area <wa>, or deletes all the lines in the database that have the same primary key as a line in the internal table <itab>. The work area <wa> or the lines of the internal table <itab> must have at least the same length and alignment as the lines of the database table. 

W                                                                                                   
WHEN
Introduces a statement block in a CASE control structure.
Syntax
WHEN <f1> [OR <f 2> OR...] | OTHERS.
The statement block following a WHEN statement is executed if the contents of the field <f> in the CASE statement are the same as those of one of the fields <f i >. Afterwards, the program carries on processing after the ENDCASE statement. The statement block after WHEN OTHERS statement is executed if the contents of <f> does not equal any of the <f i > contents.

WHILE
Introduces a loop.
Syntax
WHILE <logexp> [VARY <f> FROM <f1> NEXT <f2>].
Introduces a statement block that ends with ENDWHILE. The statement block between WHILE and ENDWHILE is repeated as long as the logical expression <logexp> is true, or until a termination statement such as EXIT or CHECK occurs. The VARY addition allows you to process fields the same distance apart in memory.

WINDOW
Displays a list as a modal dialog box.
Syntax
WINDOW STARTING AT <x1> <y1> [ENDING AT <x2> <y2>].
Only occurs in list processing. The current detail list is displayed as a modal dialog box. The top left-hand corner of the window is positioned at column <x1> and line <y1>. The bottom right-hand corner is positioned at column <x2> and line <y2> (if specified).

WRITE
Displays lists.
Syntax
WRITE [AT [/][<pos>][(<len>)]] <f> [AS CHECKBOX|SYMBOL|ICON|LINE]
                                   [QUICKINFO <g>].
                                   [<format>]
The contents of the field <f> are formatted according to their data type and displayed in the current list. . The additions before the field allow you to specify a line break, the starting position, and the length of the field. The additions after the field allow you to display checkboxes, symbols, icons, and lines. The <format> addition can contain various other formatting options. The QUICKINFO addition allows you to assign a tool tip <g> to the field.

WRITE TO
Assigns string values.
Syntax
WRITE <f1> TO <f2> [<format>].
Converts the contents of a data object <f1> to type C, and assigns the resulting string to the variable <f2>. You can use the same formatting options available in the WRITE statement.