SAPFree referencePDF, Excel, Word exportSAP ECC / S/4HANA

SAP ABAP System Fields Reference (SY-SUBRC, SY-DATUM, SY-TABIX)

System fields live in the ABAP structure SYST and are filled by the runtime. This reference lists the ones ABAP developers use every day with the type, the meaning and where they help. Search by name or by purpose, then export the table for your team.

Download:
System fieldTypeMeaningTypical use
SY-SUBRC
Integer
Return code of the last ABAP statement
0 means success. Check after READ TABLE, SELECT, CALL FUNCTION, OPEN DATASET
SY-TABIX
Integer
Current line index of an internal table
Row number inside LOOP AT or after READ TABLE or APPEND
SY-INDEX
Integer
Loop pass counter
Number of the current pass in DO and WHILE loops
SY-DBCNT
Integer
Number of database rows processed
Rows read by SELECT or changed by INSERT, UPDATE, DELETE, MODIFY
SY-FDPOS
Integer
Found position
Offset of a match after string comparisons and searches
SY-TFILL
Integer
Number of rows in an internal table
Set by DESCRIBE TABLE, lines( ) is preferred in new code
SY-TLENG
Integer
Row length of an internal table
Set by DESCRIBE TABLE
SY-DATUM
Date
Current application server date
Default date in selections, validity checks, posting date defaults
SY-UZEIT
Time
Current application server time
Time stamps in logs and file names
SY-DATLO
Date
Local date of the user
Date in the time zone of the user
SY-TIMLO
Time
Local time of the user
Time in the time zone of the user
SY-ZONLO
Character
Time zone of the user
Use with SY-DATLO and SY-TIMLO
SY-TZONE
Integer
Time difference to UTC in seconds
Server time zone offset, not the user's
SY-UNAME
Character
Logon user name
Created by, changed by, authority and log entries
SY-MANDT
Character
Client of the current logon
Client dependent selects, cross-client checks
SY-LANGU
Character
Logon language
Reading text tables such as MAKT with SPRAS
SY-SYSID
Character
System ID
Identify DEV, QAS or PRD in conditional logic and logs
SY-HOST
Character
Application server host name
Logs, diagnosing which server ran a job
SY-OPSYS
Character
Operating system of the application server
File path handling when OS matters
SY-SAPRL
Character
SAP release of the system
Version checks and diagnostics
SY-TCODE
Character
Current transaction code
Behaviour that depends on the calling transaction in exits and BAdIs
SY-REPID
Character
Name of the current ABAP program
Program name for titles, logs and messages
SY-CPROG
Character
Name of the calling program
Inside includes and called routines, the main program name
SY-DYNNR
Character
Current screen number
Screen logic and PBO or PAI modules
SY-UCOMM
Character
Function code of the last user action
Handling button clicks and menu entries in PAI
SY-PFKEY
Character
Current GUI status
Screen status checks
SY-TITLE
Character
Title of the current screen
Reading or changing the window title
SY-LSIND
Integer
Index of the current list level
Interactive classic lists, 0 for the basic list
SY-PAGNO
Integer
Current list page number
Page footers and headers in classic lists
SY-LINNO
Integer
Current line in the list
Classic list output position
SY-COLNO
Integer
Current column in the list
Classic list output position
SY-LILLI
Integer
Selected list line
Absolute line number after a list interaction
SY-CUCOL
Integer
Cursor column position
Where the user clicked in a list or screen
SY-CUROW
Integer
Cursor row position
Where the user clicked in a list or screen
SY-MSGID
Character
Message class of the last message
Fill with MESSAGE ... INTO or pass on to BAL and BAPIRET2 mapping
SY-MSGTY
Character
Message type of the last message
S success, I information, W warning, E error, A abort, X exit
SY-MSGNO
Character
Message number of the last message
Three digit number within the message class
SY-MSGV1 to SY-MSGV4
Character
Variables for message placeholders
Four values that replace & in the message text
SY-BATCH
Character
Program runs in background
X when running as a background job, branch for no dialogs
SY-BINPT
Character
Program runs under batch input
X during a batch input session
SY-CALLD
Character
Called in CALL TRANSACTION mode
X when started with CALL TRANSACTION
SY-ULINE
Character
Horizontal line constant
Drawing lines in classic list output
SY-VLINE
Character
Vertical line constant
Drawing cell borders in classic list output

Types are shown as the basic kind. The exact length and DDIC type are in structure SYST in transaction SE11. Some fields, such as SY-TFILL, are legacy, use lines( ) and other expression-based functions in new code. SY fields can be overwritten by any statement, so copy SY-SUBRC to a local variable if you need it later.

Developer onboarding pack

Want a short ABAP onboarding and review checklist for new team members? Tell us your landscape.

Optional. The tool and every export work without this. No spam.

How to use the reference

Type part of a name, such as TAB or MSG, in the search box and the list narrows to matching fields. The Typical use column describes the situation where each field matters. Use the export button to take a copy into Excel or PDF for onboarding documents or code review notes. In your own code, always read system fields as sy-subrc in lower or upper case as you wish, the notation is the same.

SY-SUBRC and the statements that set it

SY-SUBRC is set by a large number of statements, but not by all. READ TABLE returns 0 when a row is found and 4 when it is not. SELECT returns 0 for at least one row and 4 for none. CALL FUNCTION sets it according to the exceptions raised. String operations such as FIND set it to 0 or 4. Assignments and many other statements do not change it, so check the documentation of the statement before you rely on it.

Date, time and zone fields

SY-DATUM and SY-UZEIT are the date and time on the application server, based on the server time zone. SY-DATLO and SY-TIMLO give the time of the user based on the user time zone setting. For stamps stored in the database, many teams use UTC time stamps through the GET TIME STAMP statement rather than date and time pairs, which avoids daylight saving ambiguity in global systems.

Common mistakes

The most frequent error is checking SY-SUBRC after another statement has overwritten it, for example after a function call inside a loop. Another is trusting SY-TABIX after DELETE or a sort, or using SY-UNAME in background jobs without remembering that it holds the job user. Also remember that SY-DATUM is the server date, which can differ from the plant date in global deployments.

Frequently Asked Questions

What does sy-subrc = 4 mean?

It depends on the statement. For READ TABLE and SELECT it means no matching row was found. For other statements the meaning is documented in the statement reference. In general, 0 is success and any other value needs handling.

What is the difference between sy-datum and sy-datlo?

SY-DATUM is the date of the application server, using the server time zone. SY-DATLO is the local date of the user, using the time zone in the user master data. They differ when the user and the server are in different zones.

Can I change system fields?

Most SY fields can be written, but you should not set them yourself apart from rare cases such as SY-SUBRC for returning results from a form. Writing others can confuse the runtime and later statements. Treat them as read-only unless the documentation says otherwise.

How do I see all system fields?

Display the structure SYST in transaction SE11, which lists every component with its data element and length. In the debugger, the system fields appear in the SY structure view.

If your developers spend time explaining SAP internals to the business, we can discuss a grounded assistant that answers data questions without needing ABAP knowledge.