SAP ABAP — System Variables
ABAP system variables is accessible from all ABAP programs.
These fields are filled by the SAP runtime environment and these variables are access by all the SAP system.
The complete list of ABAP system variables is found in the (SE11) SYST table in SAP.
Individual fields of the SYST structure can be accessed by using “SYST-“ or “SY-“.
The bellow table shows a sample program that uses system variables.
Example
REPORT Z_ABAP_DEVELOPER_TEST.
WRITE:/ ‘ABAP System Variables’.
WRITE:/ ‘Client : ‘ , SY-MANDT.
WRITE:/ ‘Date : ‘ , SY-DATUM.
WRITE:/ ‘Time : ‘ , SY-UZEIT.
WRITE:/ ‘Language :’, SY-LANGU.
WRITE:/ ‘Program : ‘, SY-CPROG.
WRITE:/ ‘Database:’ , SY-DBSYS.
WRITE:/ ‘Column No :’, SY-COLNO.
WRITE:/ ‘Index:’ , SY-INDEX.
WRITE:/ ‘Statu :’ , SY-SUBRC.
WRITE:/ ‘Transaction :’,SY-TCODE.
Output: