ABAP Syntax

ENDSELECT (ABAP Keyword)

ENDSELECT (ABAP Keyword) introduction & syntax details ENDSELECT Basic formENDSELECT. EffectCloses a loop introduced by SELECT . NoteSELECT is not concluded by ENDSELECT if it is a SELECT SINGLE command,if only aggregate functions appear in the INTO clause orif the INTO clause INTO TABLE itab or APPENDING TABLE itab does not include the addition PACKAGE […]

ENDWHILE (ABAP Keyword)

ENDWHILE (ABAP Keyword) introduction & syntax details ENDWHILE Basic formENDWHILE. EffectCloses a loop introduced by WHILE .

ENDPROVIDE (ABAP Keyword)

ENDPROVIDE (ABAP Keyword) introduction & syntax details ENDPROVIDE Basic formENDPROVIDE. EffectCloses a loop introduced by PROVIDE .

ENDMODULE (ABAP keyword)

ENDMODULE (ABAP keyword) introduction & syntax details ENDMODULE Basic formENDMODULE. EffectCloses a module definition introduced by MODULE .

ENDON (ABAP Keyword)

ENDON (ABAP Keyword) introduction & syntax details ENDON Basic formENDON. EffectThe ENDON statement closes a structure introduced by ON (CHANGE OF) .

ENDIF (ABAP Keyword)

ENDIF (ABAP Keyword) introduction & syntax details ENDIF Basic formENDIF. EffectThe ENDIF statement concludes a statement introduced by IF .

ENDLOOP (ABAP Keyword)

ENDLOOP (ABAP Keyword) introduction & details ENDLOOP Basic formENDLOOP. EffectThe ENDLOOP statement closes a loop introduced by LOOP .

ENDFUNCTION (ABAP Keyword)

ENDFUNCTION (ABAP Keyword) introduction & syntax details ENDFUNCTION Basic formENDFUNCTION. EffectCloses a subroutine definition introduced by FUNCTION .

ENDEXEC (ABAP Keyword)

ENDEXEC (ABAP Keyword) introduction & syntax details ENDEXEC Basic formENDEXEC. EffectCloses a processing block introduced by EXEC SQL .

ENDFORM (ABAP Keyword)

ENDFORM (ABAP Keyword) introduction & syntax details ENDFORM Basic formENDFORM. EffectCloses a subroutine definition introduced by FORM .

ENDCASE (ABAP Keyword)

ENDCASE (ABAP Keyword) introduction & syntax details ENDCASE Basic formENDCASE. EffectThe ENDCASE statement closes a case disinction introduced by CASE .

ENDDO (ABAP Keyword)

ENDDO (ABAP Keyword) introduction & syntax details ENDDO Basic formENDDO. EffectCloses a loop introduced by DO .

END-OF-SELECTION (ABAP Keyword)

END-OF-SELECTION (ABAP Keyword) introduction & syntax details END-OF-SELECTION Basic formEND-OF-SELECTION. EffectProcessing event Executes the code after END-OF-SELECTION when all the logical database records have been read and processed.Related START-OF-SELECTION , STOP , GET dbtab

ENDAT (ABAP Keyword)

ENDAT (ABAP Keyword) introduction & syntax details ENDAT Basic formENDAT. EffectThe ENDAT statement closes the control structure introduced by AT .

END-OF-PAGE (ABAP Keyword)

END-OF-PAGE (ABAP Keyword) introduction & syntax details END-OF-PAGE Basic formEND-OF-PAGE. EffectList processing event. The END-OF-PAGE event is executed whenever processing reaches that area when formatting a list page or if the RESERVE statement detects that there is insufficient space remaining on the current page. NoteThe size of the END-OF-PAGE area of list pages is defined […]

ELSE (ABAP Keyword)

ELSE (ABAP Keyword) introduction & syntax details ELSE Basic formELSE. EffectWithin an ” IF … ENDIF ” processing block, precedes the code to be executed if the logical expression specified by IF fails. Example DATA: RESULT TYPE I,OP1 TYPE I,OP2 TYPE I.…RESULT = OP1 – OP2.IF RESULT > 0.WRITE / ‘Result greater than zero.’.ELSE.WRITE / […]

ELSEIF (ABAP Keyword)

ELSEIF (ABAP Keyword) introduction & syntax details ELSEIF Basic formELSEIF logexp. EffectWithin a processing block enclosed by ” IF … ENDIF “, this statement indicates the processing to be executed if the logical expressions specified by IF and the preceding ELSEIF s are false, but the logical expression in this ELSEIF processing block is true.Between […]

EDITOR-CALL (ABAP Keyword)

EDITOR-CALL (ABAP Keyword) introduction & syntax details EDITOR-CALL EDITOR-CALL – call editor for internal tables Basic formEDITOR-CALL FOR itab. Additions 1. … TITLE text2. … DISPLAY-MODE EffectDisplays the internal table itab in the ABAP/4 Editor. You can then use normal editor functions (e.g. insert, delete, search, replace) to make changes. When you save (with F11 […]

DIVIDE-CORRESPONDING (ABAP Keyword)

DIVIDE-CORRESPONDING (ABAP Keyword) introduction & syntax details DIVIDE-CORRESPONDING Basic formDIVIDE-CORRESPONDING rec1 BY rec2. EffectInterprets rec1 and rec2 as field strings, i.e. if rec1 and rec2 are tables with header lines, the statement is executed for their header lines. Searches for all sub-fields that occur both in rec1 and rec2 and then generates, for all field […]

DO (ABAP keyword)

DO (ABAP keyword) introduction & syntax details DO Variants 1. DO.2. DO n TIMES. Variant 1DO. Addition … VARYING f FROM f1 NEXT f2 EffectRepeats the processing enclosed by the DO and ENDDO statements until the loop is terminated by EXIT , STOP or REJECT . You can use the CONTINUE statement to end the […]

DESCRIBE (ABAP Keyword)

DESCRIBE (ABAP Keyword) introduction & syntax details DESCRIBE DESCRIBE – return attributes of an internal table Basic formDESCRIBE TABLE itab. EffectReturns the attributes of the internal table itab . You must use at least one of the additions listed below. Additions 1. … LINES lin2. … OCCURS n Addition 1… LINES lin EffectPlaces the number […]

DIVIDE (ABAP Keyword)

DIVIDE (ABAP Keyword) introduction & syntax details DIVIDE Basic formDIVIDE n1 BY n2. EffectDivides the contents of n1 by n2 and places the result in n1 . This is equivalent to: n1 = n1 / n2. Example DATA: SUM TYPE P, NUMBER TYPE P.DIVIDE SUM BY NUMBER. NoteThe details regarding conversions and performance given under […]

DEFINE (ABAP Keyword)

DEFINE (ABAP Keyword) introduction and details and syntax DEFINE Basic formDEFINE macro. EffectDefines a program component (macro) under the name macro . It must consist only of ABAP/4 statements and is expanded at compilation time. A macro should always be concluded with the END-OF-DEFINITION statement. In the definition, you can use &n to reference positional […]

DELETE (ABAP Keyword)

DELETE (ABAP Keyword) introduction & syntax details DELETE Delete from a database table – DELETE FROM dbtab WHERE condition.– DELETE FROM (dbtabname) WHERE condition.– DELETE dbtab.– DELETE *dbtab.– DELETE (dbtabname) … .– DELETE dbtab FROM TABLE itab.– DELETE (dbtabname) FROM TABLE itab.– DELETE dbtab VERSION vers.– DELETE *dbtab VERSION vers.Delete from an internal table – […]

DATA (ABAP Keyword)

DATA (ABAP Keyword) introduction & details DATA Variants1. DATA f.2. DATA f(len).3. DATA: BEGIN OF rec,…END OF rec.4. DATA: BEGIN OF itab OCCURS n,…END OF itab.5. DATA: BEGIN OF COMMON PART c,…END OF COMMON PART. EffectDefines global and local variables. Variables allow you to address declared data objects . They always have a particular data […]

CONVERT (ABAP Keyword)

CONVERT (ABAP Keyword) introduction and details CONVERT Variants 1. CONVERT DATE f1 INTO INVERTED-DATE f2.2. CONVERT INVERTED-DATE f1 INTO DATE f2. EffectAllows conversion between different formats which do not have their own type (see also MOVE ). The field f1 is converted from the source format to the target format and placed in f2 . […]

CREATE (ABAP Keyword)

CREATE (ABAP Keyword) introduction & details CREATE Basic formCREATE OBJECT obj class. Addition … LANGUAGE langu EffectGenerates an object of the class class . To address an OLE automation server (e.g. EXCEL) from ABAP/4 , the server must be registered with SAP. The transaction SOLE allows you to assign an automation server to a class.The […]

CONTINUE (ABAP Keyword)

CONTINUE (ABAP Keyword) introduction & details CONTINUE Basic formCONTINUE. EffectWithin loop structures like DO … ENDDOWHILE … ENDWHILELOOP … ENDLOOPSELECT … ENDSELECT CONTINUE terminates the current loop pass, returns the processing to the beginning of the loop and starts the next loop pass, if there is one. ExampleDO loop: Omit an area (10 … 20) […]

CONTROLS (ABAP Keyword)

CONTROLS (ABAP Keyword) introduction & Details CONTROLS Basic formCONTROLS ctrl TYPE ctrl_type. EffectDefines a control A control defines an ABAP/4 runtime object which displays data in a particular visual format, depending on the type. It offers the user standard processing options. At present, the following types of control are supported: ABAP/4 table control Basic formCONTROLS […]

CONDENSE (ABAP Keyword)

CONDENSE (ABAP Keyword) introduction & details CONDENSE Basic formCONDENSE c. Addition … NO-GAPS EffectShifts the contents of the field c to the left, so that each word is separated by exactly one blank. Example DATA: BEGIN OF NAME,TITLE(8), VALUE ‘Dr.’,FIRST_NAME(10), VALUE ‘Michael’,SURNAME(10), VALUE ‘Hofmann’,END OF NAME.CONDENSE NAME.WRITE NAME. produces the output: Dr. Michael Hofmann Addition… […]

CONSTANTS (ABAP Keyword)

CONSTANTS (ABAP Keyword) introduction & details CONSTANTS Variants 1. CONSTANTS c. … VALUE [ val | IS INITIAL ].2. CONSTANTS c(len) … VALUE [ val | IS INITIAL ].3. CONSTANTS: BEGIN OF crec,…END OF crec. EffectThe CONSTANTS statement defines global and local constants. Constants allow you to read statically declared data objects . They always […]

COMPUTE (ABAP Keyword)

COMPUTE (ABAP Keyword) introduction & details COMPUTE Basic formCOMPUTE n = arithexp. EffectEvaluates the arithmetic expression arithexp and places the result in the field n . Allows use of the four basic calculation types + , – , * and / , the whole number division operators DIV (quotient) and MOD (remainder), the exponentiation operator […]

CONCATENATE (ABAP Keyword)

CONCATENATE (ABAP Keyword) introduction & details CONCATENATE Basic formCONCATENATE f1 … fn INTO g. Addition … SEPARATED BY h EffectPlaces the fields f1 to fn after g . With the fields fi (1

COMMUNICATION ( ABAP Keyword)

COMMUNICATION ( ABAP Keyword) introduction & details COMMUNICATION Variants 1. COMMUNICATION INIT DESTINATION dest ID id.2. COMMUNICATION ALLOCATE ID id.3. COMMUNICATION ACCEPT ID id.4. COMMUNICATION SEND ID id BUFFER f.5. COMMUNICATION RECEIVE ID id…BUFFER f…DATAINFO d…STATUSINFO s.6. COMMUNICATION DEALLOCATE ID id. The COMMUNICATION statement allows you to develop applications which perform direct program-to-program communication. The […]

COLLECT ( ABAP keyword)

COLLECT ( ABAP keyword) introduction & details COLLECT Basic formCOLLECT [wa INTO] itab. Addition … SORTED BY f EffectCOLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab . If you use only COLLECT to fill an internal table, COLLECT makes sure that […]

COMMIT (ABAP Keyword)

COMMIT (ABAP Keyword) introduction & details COMMIT Basic formCOMMIT WORK. Addition … AND WAIT EffectExecutes a database commit and thus closes a logical processing unit or Logical Unit of Work ( LUW ) (see also Transaction processing ). This means that all database changes are made irrevocable and cannot be reversed with ROLLBACK WORK and […]

CNT (ABAP Keyword)

CNT (ABAP Keyword) introduction & details CNT Basic form… CNT(h) … EffectCNT(h) is not a statement, but a field which is automatically created and filled by the system if f is a sub-field of an extract dataset . CNT(h) can only be addressed from within a LOOP on a sorted extract.Type Standard output length OutputC […]

CLEAR (ABAP Keyword)

CLEAR (ABAP Keyword) introduction & details CLEAR Basic formCLEAR f. Additions 1. … WITH g2. … WITH NULL EffectResets the contents of f to its initial value. For predefined types (see DATA ), the following initial values are used:Type C : ‘ … ‘ (blank character) Type N : ’00…0’ Type D : ‘00000000’ Type […]

CLOSE (ABAP Keyword)

CLOSE (ABAP Keyword) introduction & details CLOSE Basic form 1. CLOSE DATASET dsn.2. CLOSE CURSOR c. Basic form 1CLOSE DATASET dsn. EffectCloses the file dsn , ignoring any errors which may occur. CLOSE is required only if you want to edit dsn several times. For further details, see the documentation for OPEN DATASET . Basic […]

CHECK ( ABAP Keyword)

CHECK ( ABAP Keyword) introduction & Details CHECK – within loops Basic formCHECK logexp. EffectCHECK evaluates the subsequent logical expression . If it is true, the processing continues with the next statement. In loop structures like DO … ENDDOWHILE … ENDWHILELOOP … ENDLOOPSELECT … ENDSELECT CHECK with a negative outcome terminates the current loop pass […]

BREAK-POINT ( ABAP Keyword)

BREAK-POINT ( ABAP Keyword) introduction & Details BREAK-POINT Variants: 1. BREAK-POINT.2. BREAK-POINT f. Variant 1BREAK-POINT. EffectThe BREAK-POINT statement interrupts the processing and diverts the system to debugging mode. You can then display the contents of all the fields at runtime and also control the subsequent program flow.If the system is unable to branch to debugging […]

CASE ( ABAP Keyword)

CASE ( ABAP Keyword) introduction & Details CASE Basic formCASE f.Effect Case distinction. Depending on the current contents of a field, this statement executes one of several alternative processing branches. The field whose contents determine how the subsequent processing is specified after CASE ; the individual processing branches are introduced by WHEN , followed by […]

AUTHORITY-CHECK (ABAP Keyword)

AUTHORITY-CHECK (ABAP Keyword) introduction & Details AUTHORITY-CHECK Basic form AUTHORITY-CHECK OBJECT object ID name1 FIELD f1 ID name2 FIELD f2 … ID name10 FIELD f10. Effect Explanation of IDs: object Field which contains the name of the object for which the authorization is to be checked. name1 … Fields which contain the names of the […]

BACK ( ABAP Keyword)

BACK ( ABAP Keyword) introduction & details BACK Basic formBACK. EffectReturns output position to the first line of the current page after the TOP-OF-PAGE processing.When used in connection with RESERVE x LINES , the statement returns the output position to the first output line after RESERVE . Example DATA: TOWN(10) VALUE ‘New York’,CUSTOMER1(10) VALUE ‘Charly’,CUSTOMER2(10) […]

AT (ABAP Keyword) introduction & Details

AT (ABAP Keyword) introduction & details ATEvents in lists– AT LINE-SELECTION.– AT USER-COMMAND.– AT PFn.Events on selection screens– AT SELECTION-SCREEN.Control break with extracts– AT NEW f.– AT END OF f.– AT FIRST.– AT LAST.– AT fg.Control break with internal tables– AT NEW f.– AT END OF f.– AT FIRST.– AT LAST.

ADD-CORRESPONDING (ABAP Keyword)

ADD-CORRESPONDING (ABAP Keyword) introduction & Details ADD-CORRESPONDING Basic formADD-CORRESPONDING rec1 TO rec2. EffectInterprets rec1 and rec2 as field strings. If, for example, rec1 and rec2 are tables, executes the statement for their header lines.Searches for all sub-fields which occur both in rec1 and rec2 and then, for all relevant field pairs corresponding to the sub-fields […]

ASSIGN (ABAP Keyword)

ASSIGN (ABAP Keyword) introduction & details ASSIGN Variants 1. ASSIGN f TO .2. ASSIGN (f) TO .3. ASSIGN TABLE FIELD (f) TO .4. ASSIGN LOCAL COPY OF MAIN TABLE FIELD (f) TO .5. ASSIGN COMPONENT idx OF STRUCTURE rec TO .6. ASSIGN COMPONENT name OF STRUCTURE rec TO . Variant 1ASSIGN f TO . Additions […]

ADD (ABAP Keyword)

ADD (ABAP Keyword) introduction and details ADD Variants 1. ADD n TO m.2. ADD n1 THEN n2 UNTIL nz GIVING m.3. ADD n1 THEN n2 UNTIL nz TO m.4. ADD n1 THEN n2 UNTIL nz…ACCORDING TO sel …GIVING m.5. ADD n1 FROM m1 TO mz GIVING m. Variant 1ADD n TO m. EffectAdds the contents […]