In SAP ABAP several system variables can be used to influence program behavior or from which information can be obtained.
System variables are part of the structure sy
which can be checked during debugging. A full list can be obtained from transaction SE11
for structure SYST
.
The most famous variable is sy-subrc
. This variable contains the return code which is set by many ABAP statements. In general, if the value is 0 (sy-subrc = 0
) the statement was executed without problems.
Frequently used System Variables
System Variable | Description |
---|---|
sy-batch | Background Processing Active. Set to X if the ABAP program is running in the background |
sy-datlo | Local Date of Current User |
sy-datum | Current Date of Application Server |
sy-index | Loop Index in DO or WHILE loops (starts from 1) |
sy-langu | Language Key of Text Environment |
sy-mandt | Client ID of Current User |
sy-repid | Name of the current ABAP program |
sy-subrc | Return Code of ABAP Statements |
sy-tabix | Row Index of Internal Tables |
sy-tcode | Current Transaction Code |
sy-timlo | Local Time of Current User |
sy-uname | Name of Current User |
sy-uzeit | Current Time of Application Server |
sy-zonlo | Time Zone of Current User |