SYST Structure in ABAP
SYST is a predefined structure in SAP. It is referenced through the shortcut SY in ABAP. You can view the contents of the structure using [SE11] – It contains roughly 171 fields. SAP will automatically fill the fields during run time thus enabling us to access these fields anytime during our ABAP programs to learn more about our environment, database and other currently processes. However, please be advised that these fields are mostly READ-ONLY but some of them can be written to as well ( Eg., SY-SUBRC can be set by a subroutine.
Important SY fields ( Select few are shown out of the total of 171 fields. Roughly 40 fields out of them are Obsolete – Meaning the system does not guarantee that these fields are correct/filled )
The Return Code of the preceding action. For example, if a sub-routine was executed previously, the status SY-SUBRC can be set in the code. Another example could be after executing an SQL Statement like an INSERT or a DELETE where the system sets the SY-SUBRC code to zero if the statement has been executed successfully.
Returns the Client that is currently executing the program.
Returns the name of the user executing the program.
Returns the current system date.
Returns the transaction code that executed the program.
Contains the number of the current index while being run in a loop ( For example, if the program is executing a LOOP this variable will return the number of the iteration )
This is specifically used for Internal Tables. It contains the current row number of the internal table.
To know more about SAP SYST structure, please take our SAP ABAP Training.