ABAP system fields are always available in ABAP programs. The runtime system fills them according to context. They can then be used in programs to query the system status. System fields are variables but you should always treat them as though they were constants, and only read them. If you change their values, important information for the flow of the program may be lost. In exceptional circumstances, system fields may be overwritten in an ABAP program to control the system – for example, SY-LSIND (for navigating to a detail list).
With one exception the names and data types of the system fields are stored in the ABAP Dictionary in the SYST structure and realized as components of the predefined structure SY in ABAP programs.
The system field SY-REPID is not part of SYST or SY. Instead, every program contains the predefined constants SY-REPID and SYST-REPID, which both contain the name of the corresponding program. Furthermore, there are two predefined types of the same name, SY-REPID and SYST-REPID.
All system fields are addressed using SY field name and their types using SYST field name.
The following table lists the definitions of the structure SYST in the ABAP Dictionary alphabetically. The character in the first column indicates how you can use the corresponding system field in ABAP programs. Name is the name of the component, Type is the Dictionary data type, and Length is the field length defined in the Dictionary. The Use column shows in which environment the system fields are set. The Description indicates the content.
Name |
Type |
Length |
Use |
Description |
|
ABCDE |
CHAR |
26 |
Constants |
||
APPLI |
RAW |
2 |
Obsolete |
||
BATCH |
CHAR |
1 |
Background processing |
||
BATZD |
CHAR |
1 |
Obsolete |
||
BATZM |
CHAR |
1 |
Obsolete |
||
BATZO |
CHAR |
1 |
Obsolete |
||
BATZS |
CHAR |
1 |
Obsolete |
||
BATZW |
CHAR |
1 |
Obsolete |
||
BINPT |
CHAR |
1 |
Batch input |
Program runs under batch input |
|
BREP4 |
CHAR |
4 |
Obsolete |
||
BSPLD |
CHAR |
1 |
Obsolete |
||
CALLD |
CHAR |
1 |
ABAP Program |
||
CALLR |
CHAR |
8 |
Printing Lists |
||
CCURS |
DEC |
9 |
Obsolete |
||
CCURT |
DEC |
9 |
Obsolete |
||
CDATE |
DATS |
8 |
Obsolete |
||
CFWAE |
CUKY |
5 |
Internal |
||
CHWAE |
CUKY |
5 |
Internal |
||
COLNO |
INT4 |
10 |
Creating Lists |
Current column in the list |
|
CPAGE |
INT4 |
10 |
List processing |
Current page number |
|
CPROG |
CHAR |
40 |
ABAP Program |
External procedure call |
|
CTABL |
CHAR |
4 |
Obsolete |
||
CTYPE |
CHAR |
1 |
Obsolete |
||
CUCOL |
INT4 |
10 |
Screens |
Horizontal cursor position at PAI |
|
CUROW |
INT4 |
10 |
Screens |
Vertical cursor position at PAI |
|
DATAR |
CHAR |
1 |
Screens |
||
DATLO |
DATS |
8 |
Date and time |
Local date of user |
|
DATUM |
DATS |
8 |
Date and time |
Current (application server) date |
|
DAYST |
CHAR |
1 |
Date and time |
Daylight saving time flag |
|
DBCNT |
INT4 |
10 |
Database accesses |
Number of processed table rows |
|
DBNAM |
CHAR |
20 |
ABAP Program |
Linked logical database |
|
DBSYS |
CHAR |
10 |
R/3 System |
Name of central database system |
|
DCSYS |
CHAR |
4 |
Obsolete |
||
DEBUG |
CHAR |
1 |
Internal |
||
DSNAM |
CHAR |
8 |
Internal |
||
DYNGR |
CHAR |
4 |
ABAP Program |
Screen group of current screen |
|
DYNNR |
CHAR |
4 |
ABAP Program |
Number of current screen |
|
ENTRY |
CHAR |
72 |
|||
FDAYW |
INT1 |
3 |
Date and time |
||
FDPOS |
INT4 |
10 |
Character strings |
Offset in character strings |
|
FFILE |
CHAR |
8 |
Internal |
||
FLENG |
INT4 |
10 |
Internal |
||
FMKEY |
CHAR |
3 |
Obsolete |
||
FODEC |
INT4 |
10 |
Internal |
||
FOLEN |
INT4 |
10 |
Internal |
||
FTYPE |
CHAR |
1 |
Internal |
||
GROUP |
CHAR |
1 |
|||
HOST |
CHAR |
8 |
R/3 System |
||
INDEX |
INT4 |
10 |
Loops |
||
INPUT |
CHAR |
1 |
Internal |
||
LANGU |
LANG |
1 |
R/3 System |
||
LDBPG |
CHAR |
40 |
ABAP Program |
Program of logical database |
|
LILLI |
INT4 |
10 |
List processing |
Selected list row |
|
LINCT |
INT4 |
10 |
Creating Lists |
Page length of list |
|
LINNO |
INT4 |
10 |
Creating Lists |
Current row |
|
LINSZ |
INT4 |
10 |
Creating Lists |
Column width of list |
|
LISEL |
CHAR |
255 |
List processing |
Content of selected row |
|
LISTI |
INT4 |
10 |
List processing |
Index of selected list |
|
LOCDB |
CHAR |
1 |
Obsolete |
||
LOCOP |
CHAR |
1 |
Obsolete |
||
LOOPC |
INT4 |
10 |
Screens |
Number of rows visible in table |
|
LPASS |
CHAR |
4 |
Internal |
||
LSIND |
INT4 |
10 |
List processing |
Index of detail list |
|
LSTAT |
CHAR |
16 |
List processing |
ID for list levels |
|
MACDB |
CHAR |
4 |
|||
MACOL |
INT4 |
10 |
Printing Lists |
Columns from SET MARGIN statement |
|
MANDT |
CLNT |
3 |
R/3 System |
Client number from logon |
|
MARKY |
CHAR |
1 |
Obsolete |
||
MAROW |
INT4 |
10 |
Printing Lists |
Rows from SET MARGIN statement |
|
MODNO |
CHAR |
1 |
R/3 System |
Index of external modes |
|
MSGID |
CHAR |
20 |
Messages |
Message class |
|
MSGLI |
CHAR |
60 |
Messages |
Message line |
|
MSGNO |
NUMC |
3 |
Messages |
Message number |
|
MSGTY |
CHAR |
1 |
Messages |
Message type |
|
MSGV1 |
CHAR |
50 |
Messages |
Message variable |
|
MSGV2 |
CHAR |
50 |
Messages |
Message variable |
|
MSGV3 |
CHAR |
50 |
Messages |
Message variable |
|
MSGV4 |
CHAR |
50 |
Messages |
Message variable |
|
NEWPA |
CHAR |
1 |
|||
NRPAG |
CHAR |
1 |
Internal |
||
ONCOM |
CHAR |
1 |
|||
OPSYS |
CHAR |
10 |
R/3 System |
Operating system of application server |
|
PAART |
CHAR |
16 |
Print parameters |
||
PAGCT |
INT4 |
10 |
Obsolete |
||
PAGNO |
INT4 |
10 |
Creating Lists |
Current page: |
|
PAUTH |
NUMC |
2 |
Internal |
||
PDEST |
CHAR |
4 |
Print parameters |
Output device |
|
PEXPI |
NUMC |
1 |
Print parameters |
Retention period |
|
PFKEY |
CHAR |
20 |
Screens |
Current GUI status |
|
PLAYO |
CHAR |
5 |
Internal |
||
PLAYP |
CHAR |
1 |
Internal |
||
PLIST |
CHAR |
12 |
Print parameters |
Name of spool request |
|
PNWPA |
CHAR |
1 |
Internal |
||
PRABT |
CHAR |
12 |
Print parameters |
Part of cover sheet |
|
PRBIG |
CHAR |
1 |
Print parameters |
Selection cover page |
|
PRCOP |
NUMC |
3 |
Print parameters |
Number of copies |
|
PRDSN |
CHAR |
6 |
Print parameters |
Name of spool dataset |
|
PREFX |
CHAR |
3 |
Obsolete |
||
PRI40 |
CHAR |
1 |
Internal |
||
PRIMM |
CHAR |
1 |
Print parameters |
Print immediately |
|
PRINI |
NUMC |
1 |
Internal |
||
PRLOG |
CHAR |
1 |
Internal |
||
PRNEW |
CHAR |
1 |
Print parameters |
New spool request |
|
PRREC |
CHAR |
12 |
Print parameters |
Recipient |
|
PRREL |
CHAR |
1 |
Print parameters |
Delete after print |
|
PRTXT |
CHAR |
68 |
Print parameters |
Text for cover sheet |
|
REPI2 |
CHAR |
40 |
|||
REPID |
CHAR |
40 |
ABAP Program |
Current main program |
|
RSTRT |
CHAR |
1 |
Internal |
||
RTITL |
CHAR |
70 |
Print parameters |
Title of printing program |
|
SAPRL |
CHAR |
4 |
R/3 System |
||
SCOLS |
INT4 |
10 |
Screens |
Number of columns |
|
SFNAM |
CHAR |
30 |
Obsolete |
||
SFOFF |
INT4 |
10 |
Internal |
||
SLSET |
CHAR |
14 |
Selection screens |
Name of variant |
|
SPONO |
NUMC |
10 |
Printing Lists |
Spool number |
|
SPONR |
NUMC |
10 |
Obsolete |
||
SROWS |
INT4 |
10 |
Screens |
Number of rows |
|
STACO |
INT4 |
10 |
List processing |
First displayed column |
|
STARO |
INT4 |
10 |
List processing |
Uppermost displayed row |
|
STEPL |
INT4 |
10 |
Screens |
Index of current table row |
|
SUBCS |
CHAR |
1 |
Internal |
||
SUBRC |
INT4 |
10 |
Return value |
Return value after ABAP statement |
|
SUBTY |
RAW |
1 |
Internal |
||
SYSID |
CHAR |
8 |
R/3 System |
Name of R/3 System |
|
TABID |
CHAR |
8 |
|||
TABIX |
INT4 |
10 |
Internal Tables |
Current row index |
|
TCODE |
CHAR |
20 |
ABAP Program |
Current transaction code |
|
TFDSN |
CHAR |
8 |
Obsolete |
||
TFILL |
INT4 |
10 |
Internal Tables |
Current number of rows |
|
TIMLO |
TIMS |
6 |
Date and time |
Local time of user |
|
TITLE |
CHAR |
70 |
Screens |
Text in header line |
|
TLENG |
INT4 |
10 |
Internal Tables |
Row size |
|
TLOPC |
INT4 |
10 |
Internal |
||
TMAXL |
INT4 |
10 |
Obsolete |
||
TNAME |
CHAR |
30 |
Obsolete |
||
TOCCU |
INT4 |
10 |
Obsolete |
||
TPAGI |
INT4 |
10 |
Obsolete |
||
TSTIS |
INT4 |
10 |
Internal |
||
TTABC |
INT4 |
10 |
Obsolete |
||
TTABI |
INT4 |
10 |
Obsolete |
||
TVAR0 |
CHAR |
20 |
Creating Lists |
Text variable for headers |
|
TVAR1 |
CHAR |
20 |
Creating Lists |
Text variable for headers |
|
TVAR2 |
CHAR |
20 |
Creating Lists |
Text variable for headers |
|
TVAR3 |
CHAR |
20 |
Creating Lists |
Text variable for headers |
|
TVAR4 |
CHAR |
20 |
Creating Lists |
Text variable for headers |
|
TVAR5 |
CHAR |
20 |
Creating Lists |
Text variable for headers |
|
TVAR6 |
CHAR |
20 |
Creating Lists |
Text variable for headers |
|
TVAR7 |
CHAR |
20 |
Creating Lists |
Text variable for headers |
|
TVAR8 |
CHAR |
20 |
Creating Lists |
Text variable for headers |
|
TVAR9 |
CHAR |
20 |
Creating Lists |
Text variable for headers |
|
TZONE |
INT4 |
10 |
Date and time |
Time difference to Greenwich Mean Time |
|
UCOMM |
CHAR |
70 |
Screens |
||
ULINE |
CHAR |
255 |
Constants |
Horizontal line with length 255 |
|
UNAME |
CHAR |
12 |
R/3 System |
Logon name of user |
|
UZEIT |
TIMS |
6 |
Date and time |
Current (application server) time |
|
VLINE |
CHAR |
1 |
Constants |
||
WAERS |
CUKY |
5 |
|||
WILLI |
INT4 |
10 |
Obsolete |
||
WINCO |
INT4 |
10 |
Obsolete |
||
WINDI |
INT4 |
10 |
Obsolete |
||
WINRO |
INT4 |
10 |
Obsolete |
||
WINSL |
CHAR |
79 |
Obsolete |
||
WINX1 |
INT4 |
10 |
Obsolete |
||
WINX2 |
INT4 |
10 |
Obsolete |
||
WINY1 |
INT4 |
10 |
Obsolete |
||
WINY2 |
INT4 |
10 |
Obsolete |
||
WTITL |
CHAR |
1 |
Creating Lists |
Flag for standard page header |
|
XCODE |
CHAR |
70 |
|||
XFORM |
CHAR |
30 |
Internal |
||
XPROG |
CHAR |
40 |
Internal |
||
ZONLO |
CHAR |
6 |
Date and time |
The system field is set by the runtime environment. Its content can be evaluated in the ABAP program but not changed. |
|
The system field is set by the runtime environment. Its content can be changed in the ABAP program to influence the runtime environment. |
|
The system field must be set in the ABAP program. It can then be evaluated by the runtime environment or the program. |
|
The system field is only for internal use and must not be used in ABAP programs. |
|
The system field is obsolete and its content is not set. It cannot be used in ABAP programs. |
The following is a thematic summary of the system fields with notes on their use:
System information
ABAP programming
Screens
Internal system fields
Obsolete system fields
Information on the Current R/3 System
SY-DBSYS
Central database system, for example INFORMIX, ORACLE
SY-HOST
Application server, for example HS0333, PAWDF087
SY-OPSYS
Operating system of application server, for example HP-UX, SINIX
SY-SAPRL
Release status of R/3 System, for example 30D, 46A
SY-SYSID
Name of R/3 System, for example B20, I47
Information on the User Session
SY-LANGU
SY-MANDT
SY-MODNO
SY-UNAME
Logon name of user, for example KELLERH, BC400-01.
Date and Time Information
SY-DATLO
Local date of user, for example 19981129, 19990628.
SY-DATUM
Current (application server) date, for example 19981130, 19990627.
SY-DAYST
During daylight saving time X, otherwise empty.
SY-FDAYW
Factory calendar weekday, Sunday 0 … Saturday 6.
SY-TIMLO
Local time of user, for example 154353, 225312.
SY-TZONE
Time difference to Greenwich Mean Time (UTC) in seconds, for example 3600, 10800.
SY-UZEIT
Current (application server) time, for example 164353, 215312.
SY-ZONLO
Time zone of user, for example CET, UTC.
Information on the Current ABAP Program
SY-CALLD
SY-CALLD contains SPACE if the program is the first and only program in a call chain. SY_CALLD contains 'X' if the program is a called program in a call chain (see ABAP Calls Overview).
SY-CPROG
SY-DBNAM
With executable programs this is the linked logical database.
SY-DYNGR
SY-DYNNR
SY-LDBPG
With executable programs, the database program of the linked logical database.
SY-REPID
Name of current ABAP program. With externally called procedures this is the name of the procedure’s main program.
As of Release 6.10, SY-REPID is a separate constant that is no longer part of the structure SYST or SY. It can be transferred to external procedures directly.
SY-TCODE
Name of current transaction code.
Background Processing
SY-BATCH
SY-BATCH is set to X in an ABAP program running in the background. Otherwise it is empty.
Batch Input
SY-BINPT
SY-BINPT is set to X during processing of batch input folders and in ABAP programs called with CALL TRANSACTION USING. Otherwise it is empty.
SY-ABCDE
SY-ULINE
Contains a horizontal line with length 255. Can be used when creating the list.
Contains a vertical line (|). Can be used when creating the list
SY-INDEX
SY-INDEX contains the number of loop passes in DO and WHILE loops, including the current loop pass.
SY-FDPOS
Found location for operations with character-type fields.
SY-TABIX
Current line in an internal table. With the following statements SY-TABIX is set for index tables. With hashed tables, SY-TABIX is not filled or it is set to 0.
SY-TFILL
SY-TLENG
SY-DBCNT
SQL statements set the content of SY-DBCNT to the number of database lines processed. With SELECT loops in Open SQL, SY-DBCNT is set after the ENDSELECT statement. In Native SQL, SY-DBCNT is set after the ENDEXEC statement.
SY-SUBRC
Return value set by the following ABAP statements. In general, a content of 0 means that the statement was executed without problems.
Screens
SY-CUCOL
Horizontal cursor position Counting starts at column 2
Vertical cursor position Counting starts at row 1
SY-DATAR
SY-LOOPC
Number of rows currently displayed in a screen table (table control).
SY-PFKEY
GUI status of current screen. Can be set at PBO using SET PF-STATUS.
SY-SCOLS
Number of columns in current screen.
SY-SROWS
Number of rows in current screen.
SY-STEPL
SY-TITLE
SY-UCOMM
Function code that triggered the event PAI. Every user action that triggers PAI is assigned a unique function code, with one exception: Choosing Enter triggers PAI and different function codes can be transferred to SY-UCOMM:
SY-SLSET
Variant used to fill the selection screen.
Creating Lists
SY-COLNO
Current column during list creation. Counting starts at 1. SY-COLNO is set by the following output statements:
SY-LINCT
Page length of list. SY-LINCT is 0 for a standard list of any length and has a value unequal to 0 for lists with fixed page length.
SY-LINNO
Current row during the list creation. Counting begins at 1 and includes the page header. SY-LINNO is set by the following output statements:
SY-LINSZ
Line width of list Without further influence this is the standard window width: If SY-SCOLS >= 84, SY-LINSZ = SY-SCOLS; if SY-SCOLS < 84, SY-LINSZ = 84.
To change the width of the output list, use the LINE-SIZE option of the REPORT or NEW PAGE statement.
SY-PAGNO
Current page during the list creation.
SY-TVAR0 ...
SY-TVAR9SY-WTITL
List Processing
SY-CPAGE
SY-LILLI
Line from which the event was triggered Counting begins at 1 and includes the page header.
SY-LISEL
Contents of the line from which the event was triggered
SY-LISTI
Index of the list from which the event was triggered
SY-LSIND
SY-LSTAT
SY-STACO
SY-STARO
Printing Lists
SY-CALLR
SY-PRDSN
Contains the name of the spool file during printing.
SY-SPONO
Contains the name of the spool number during printing.
The SET MARGIN statement fills the system fields SY-MAROW and SY-MACOL, which determine the number of lines on the upper margin and the number of columns on the left margin when printing.
Print Parameters
Messages
SY-MSGID
SY-MSGID contains the message ID.
SY-MSGNO
SY-MSGNO contains the message number.
SY-MSGTY
SY-MSGTY contains the message type.
SY-MSGV1,…,SY-MSGV4
SY-MSGV1 to SY-MSGV4 contain the field contents that are used for the message’s placeholders.
Special Actions that Fill Message Fields
Internal system fields are only for internal use in the ABAP runtime environment and are defined in the kernel. Under no circumstances must they be overwritten in ABAP programs and they should also not be read (processed).
SY-CFWAE
SY-CHWAE
SY-DEBUG
SY-DSNAM
SY-ENTRY
SY-FFILE
Flat file (USING/GENERATING DATASET).
SY-FLENG
SY-FODEC
Number of decimal places of a field.
SY-FOLEN
SY-FTYPE
SY-GROUP
SY-INPUT
SY-LPASS
SY-NEWPA
SY-NRPAG
SY-ONCOM
On Commit flag. This system field is set to different values depending on the call status of an ABAP program. Of these, only the value of ‘P’ is guaranteed. If at all, SY-ONCOM must only be queried for ‘P’.
SY-PAUTH
SY-PLAYO
SY-PLAYP
SY-PNWPA
SY-PRI40
SY-PRINI
SY-PRLOG
SY-REPI2
SY-RSTRT
SY-SFOFF
SY-SUBCS
Call status of an executable program.
SY-SUBTY
Call type of an executable program.
SY-TABID
SY-TLOPC
SY-TSTIS
SY-XCODE
SY-XFORM
SY-XPROG
SYSTEM-EXIT program.
In the transition from R/2 to R/3, some system fields were carried over that are no longer filled. These system fields are obsolete and can no longer be used.
SY-APPLI
In R/2, ID for which SAP applications are installed. Not filled in R/3.
SY-BATZD
In R/2, ID for daily background scheduling. Not filled in R/3.
SY-BATZM
In R/2, ID for monthly background scheduling. Not filled in R/3.
SY-BATZO
In R/2, ID for single background scheduling. Not filled in R/3.
SY-BATZS
In R/2, ID for immediate background scheduling. Not filled in R/3.
SY-BATZW
In R/2, ID for weekly background scheduling. Not filled in R/3.
SY-BREP4
In R/2, root name of request report for background processing. Not filled in R/3.
SY-BSPLD
In R/2, ID for immediate spool output for background processing. Not filled in R/3.
SY-CCURS
In R/2, rate specification/result field from CURRENCY CONVERSION. Not filled in R/3.
SY-CCURT
In R/2, table rate from CURRENCY CONVERSION. Not filled in R/3.
SY-CDATE
In R/2, rate date from CURRENCY CONVERSION. Not filled in R/3.
SY-CTABL
In R/2, rate table from CURRENCY CONVERSION. Not filled in R/3.
SY-CTYPE
In R/2, rate type from CURRENCY CONVERSION. Not filled in R/3.
SY-DCSYS
Dialog system of R/2 System Not filled in R/3.
SY-FMKEY
Previously, current function code menu. Not filled in R/3.
SY-LOCDB
Local database, not implemented.
Local database operation, not implemented.
SY-MACDB
Previously, name of file for matchcode access. Not filled in R/3.
SY-MARKY
SY-PAGCT
In R/2, maximum number of pages per list. Not filled in R/3.
SY-PREFX
ABAP prefix for background jobs. Not filled in R/3.
SY-SFNAM
SY-SPONR
SY-TFDSN
Previously, name of external storage file for extracts. Not filled in R/3.
SY-TMAXL
Previously, maximum number of entries in an internal table. Not filled in R/3.
SY-TNAME
Previously, name of an internal table after an access. Not filled in R/3.
SY-TOCCU
SY-TPAGI
Previously, ID whether an internal table is stored in the paging area. Not filled in R/3.
SY-TTABC
Previously, index of last read row in an internal table. Not filled in R/3.
SY-TTABI
Previously, offset of internal tables in roll area. Not filled in R/3.
SY-WAERS
Previously, company code currency after reading booking segment. Not filled in R/3.
SY-WILLI
In R/2, number of selected list row for detail list in window. Use SY-LILLI.
SY-WINCO
In R/2, cursor position for detail list in window. Use SY-CUCOL.
SY-WINDI
In R/2, index of list for detail list in window. Use SY-LSIND.
SY-WINRO
In R/2, cursor position for detail list in window. Use SY-CUROW.
SY-WINSL
In R/2, content of selected row for detail list in window. Use SY-LISEL.
SY-WINX1
In R/2, window coordinate for detail list in window. No correspondence in R/3.
SY-WINX2
In R/2, window coordinate for detail list in window. No correspondence in R/3.
SY-WINY1
In R/2, window coordinate for detail list in window. No correspondence in R/3.
SY-WINY2
In R/2, window coordinate for detail list in window. No correspondence in R/3.