메뉴 건너뛰기

SAP 한국 커뮤니티



ABAP Statement Overview(명령어, 구문 정리)

sapjoy 2007.01.22 17:50 조회 수 : 17628 추천:12


ABAP Statement Overview

Alphabetical overview of the most important ABAP statements.



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 <loge