SAP ABAP Statement syntax including basic implementation code
See below for details and syntax for specific SAP ABAP statements but also note there are a few basic syntax rules which are valid
for writing all ABAP code including:
• All statements must end with period/full stop (Example: SELECT * from EKKO into it_ekko.)
• ABAP statements and keywords are not case sensitive (Example: SELECT, Select, select).
• String values are enclosed within single quotes (Example: ld_string = 'Hello World'.)
• You can use * or " for commenting purposes. * must be placed at the start of the line and " can be placed any where.
Example using all of the above syntax rules
* The select statement retrieves data from the ekko table
* into an internal table called it_ekko
Select *
FROM ekko "get data for ekko table
into TABLE it_ekko
WhERe ebeln = '12345'. "only retrieves values that match this where clause
"Note: You can use the pretty printer functionality to auto format your code
VARYING Statement/Command Function of the DO loop which allows you to move horizontaly along a table row without actually having to specify each individual field name
STARTING NEW TASK Execute function module using STARTING NEW TASK statement
IN UPDATE TASK Execute function module using IN UPDATE TASK statement
IN BACKGROUND TASK Execute function module using IN BACKGROUND TASK statement