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 VariableDescription
sy-batchBackground Processing Active. Set to X if the ABAP program is running in the background
sy-datloLocal Date of Current User
sy-datumCurrent Date of Application Server
sy-indexLoop Index in DO or WHILE loops (starts from 1)
sy-languLanguage Key of Text Environment
sy-mandtClient ID of Current User
sy-repidName of the current ABAP program
sy-subrcReturn Code of ABAP Statements
sy-tabixRow Index of Internal Tables
sy-tcodeCurrent Transaction Code
sy-timloLocal Time of Current User
sy-unameName of Current User
sy-uzeitCurrent Time of Application Server
sy-zonloTime Zone of Current User