Sei sulla pagina 1di 21

ABAP System Fields

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, SYREPID and SYST-REPID. All system fields are addressed using SY field name and their types using SYST field name.

Alphabetical Overview
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
ABCDE APPLI BATCH BATZD BATZM BATZO BATZS BATZW BINPT BREP4 BSPLD CALLD CALLR CCURS

Type
CHAR RAW CHAR CHAR CHAR CHAR CHAR CHAR CHAR CHAR CHAR CHAR CHAR DEC

Length Use
26 2 1 1 1 1 1 1 1 4 1 1 8 9 Constants Obsolete Background processing Obsolete Obsolete Obsolete Obsolete Obsolete Batch input Obsolete Obsolete ABAP program Printing lists Obsolete

Description
Alphabet (A,B,C,...)

Program runs in the background

Program runs under batch input

Call mode of ABAP program ID for print dialog function

CCURT CDATE CFWAE CHWAE COLNO CPAGE CPROG CTABL CTYPE CUCOL CUROW DATAR DATLO DATUM DAYST DBCNT DBNAM DBSYS DCSYS DEBUG DSNAM DYNGR DYNNR ENTRY FDAYW FDPOS FFILE FLENG FMKEY FODEC FOLEN

DEC DATS CUKY CUKY INT4 INT4 CHAR CHAR CHAR INT4 INT4 CHAR DATS DATS CHAR INT4 CHAR CHAR CHAR CHAR CHAR CHAR CHAR CHAR INT1 INT4 CHAR INT4 CHAR INT4 INT4

9 8 5 5 10 10 40 4 1 10 10 1 8 8 1 10 20 10 4 1 8 4 4 72 3 10 8 10 3 10 10

Obsolete Obsolete Internal Internal Creating lists List processing ABAP program Obsolete Obsolete Screens Screens Screens Date and time Date and time Date and time Horizontal cursor position at PAI Vertical cursor position at PAI Displays user input Local date of user Current (application server) date Daylight saving time flag Current column in the list Current page number External procedure call

Database accesses Number of processed table rows ABAP program SAP System Obsolete Internal Internal ABAP program ABAP program Internal Date and time Character strings Internal Internal Obsolete Internal Internal Factory calendar weekday Offset in character strings Screen group of current screen. Number of current screen Linked logical database Name of central database system

FTYPE GROUP HOST INDEX INPUT LANGU LDBPG LILLI LINCT LINNO LINSZ LISEL LISTI LOCDB LOCOP LOOPC LPASS LSIND LSTAT MACDB MACOL MANDT MARKY MAROW MODNO MSGID MSGLI MSGNO MSGTY MSGV1 MSGV2

CHAR CHAR CHAR INT4 CHAR LANG CHAR INT4 INT4 INT4 INT4 CHAR INT4 CHAR CHAR INT4 CHAR INT4 CHAR CHAR INT4 CLNT CHAR INT4 CHAR CHAR CHAR NUMC CHAR CHAR CHAR

1 1 8 10 1 1 40 10 10 10 10 255 10 1 1 10 4 10 16 4 10 3 1 10 1 20 60 3 1 50 50

Internal Internal SAP System Loops Internal SAP System ABAP program List processing Creating lists Creating lists Creating lists List processing List processing Obsolete Obsolete Screens Internal List processing List processing Obsolete Printing lists SAP System Obsolete Printing lists SAP System Messages Messages Messages Messages Messages Messages Rows from SET MARGIN statement Index of external modes Message class Message line Message number Message type Message variable Message variable Columns from SET MARGIN statement Client number from logon Index of detail list ID for list levels Number of rows visible in table Current language Program of logical database Selected list row Page length of list Current row Column width of list Content of selected row Index of selected list Name of the application server Current loop pass

MSGV3 MSGV4 NEWPA NRPAG ONCOM OPSYS PAART PAGCT PAGNO PAUTH PDEST PEXPI PFKEY PLAYO PLAYP PLIST PNWPA PRABT PRBIG PRCOP PRDSN PREFX PRI40 PRIMM PRINI PRLOG PRNEW PRREC PRREL PRTXT REPI2

CHAR CHAR CHAR CHAR CHAR CHAR CHAR INT4 INT4 NUMC CHAR NUMC CHAR CHAR CHAR CHAR CHAR CHAR CHAR NUMC CHAR CHAR CHAR CHAR NUMC CHAR CHAR CHAR CHAR CHAR CHAR

50 50 1 1 1 10 16 10 10 2 4 1 20 5 1 12 1 12 1 3 6 3 1 1 1 1 1 12 1 68 40

Messages Messages Internal Internal Internal SAP System Print parameters Obsolete Creating lists Internal Print parameters Print parameters Screens Internal Internal Print parameters Internal Print parameters Print parameters Print parameters Print parameters Obsolete Internal Print parameters Internal Internal Print parameters Print parameters Print parameters Print parameters Internal

Message variable Message variable

Operating system of application server Print formatting

Current page:

Output device Retention period Current GUI status

Name of spool request

Part of cover sheet Selection cover page Number of copies Name of spool dataset

Print immediately

New spool request Recipient Delete after print Text for cover sheet

REPID RSTRT RTITL SAPRL SCOLS SFNAM SFOFF SLSET SPONO SPONR SROWS STACO STARO STEPL SUBCS SUBRC SUBTY SYSID TABID TABIX TCODE TFDSN TFILL TIMLO TITLE TLENG TLOPC TMAXL TNAME TOCCU TPAGI

CHAR CHAR CHAR CHAR INT4 CHAR INT4 CHAR NUMC NUMC INT4 INT4 INT4 INT4 CHAR INT4 RAW CHAR CHAR INT4 CHAR CHAR INT4 TIMS CHAR INT4 INT4 INT4 CHAR INT4 INT4

40 1 70 4 10 30 10 14 10 10 10 10 10 10 1 10 1 8 8 10 20 8 10 6 70 10 10 10 30 10 10

ABAP program Internal Print parameters SAP System Screens Obsolete Internal Selection screens Printing lists Obsolete Screens List processing List processing Screens Internal Return value Internal SAP System Internal Internal tables ABAP program Obsolete Internal tables Date and time Screens Internal tables Internal Obsolete Obsolete Obsolete Obsolete

Current main program

Title of printing program Release status of SAP System Number of columns

Name of variant Spool number

Number of rows First displayed column Uppermost displayed row Index of current table row

Return value after ABAP statement

Name of SAP System

Current row index Current transaction code

Current number of rows Local time of user Text in header line Row size

TSTIS TTABC TTABI TVAR0 TVAR1 TVAR2 TVAR3 TVAR4 TVAR5 TVAR6 TVAR7 TVAR8 TVAR9 TZONE UCOMM ULINE UNAME UZEIT VLINE WAERS WILLI WINCO WINDI WINRO WINSL WINX1 WINX2 WINY1 WINY2 WTITL XCODE

INT4 INT4 INT4 CHAR CHAR CHAR CHAR CHAR CHAR CHAR CHAR CHAR CHAR INT4 CHAR CHAR CHAR TIMS CHAR CUKY INT4 INT4 INT4 INT4 CHAR INT4 INT4 INT4 INT4 CHAR CHAR

10 10 10 20 20 20 20 20 20 20 20 20 20 10 70 255 12 6 1 5 10 10 10 10 79 10 10 10 10 1 70

Internal Obsolete Obsolete Creating lists Creating lists Creating lists Creating lists Creating lists Creating lists Creating lists Creating lists Creating lists Creating lists Date and time Screens Constants SAP System Date and time Constants Obsolete Obsolete Obsolete Obsolete Obsolete Obsolete Obsolete Obsolete Obsolete Obsolete Creating lists Internal Flag for standard page header Text variable for headers Text variable for headers Text variable for headers Text variable for headers Text variable for headers Text variable for headers Text variable for headers Text variable for headers Text variable for headers Text variable for headers Time difference to Greenwich Mean Time Function code that triggered PAI Horizontal line with length 255 Logon name of user Current (application server) time Vertical line

XFORM XPROG ZONLO Key:

CHAR CHAR CHAR

30 40 6

Internal Internal Date and time Time zone of user

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.

Thematic Overview
The following is a thematic summary of the system fields with notes on their use: System information

Batch input ABAP programming

Information on the current SAP System Information on the user session Date and time information Information on the current ABAP program Background processing

Constants Character strings Loops Internal tables Database accesses Return value Screens Screens Selection screens Lists

Messages Internal system fields Obsolete system fields

System Information
Information on the Current SAP 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 the SAP System, for example 30D, 46A SY-SYSID Name of the SAP System, for example B20, I47

Information on the User Session


SY-LANGU One-digit language key, for example D, E, F. Either logon language of user or set using the SET LOCALE LANGUAGE statement. SY-MANDT Client number the user logged on with, for example 000, 400. For database accesses with Open SQL, SY-MANDT is used as the first key field of the WHERE clause. SY-MODNO Indexes external modes. Zero in first mode. In new modes, opened using the Create Mode function or by calling a transaction using /o, it is raised by 1. If previous modes were deleted, the free numbers are used first. Modes opened using CALL TRANSACTION STARTING NEW TASK start back at 0. SY-UNAME Logon name of user, for example KELLERH, BC400-01.

Date and Time Information


The following system fields are always set automatically. If necessary, the GET TIME statement synchronizes the application server time with that of the database server and writes it to the system field SY-UZEIT. SY-DATUM and the system fields for the local time zone, that is SYTIMLO, SY-DATLO, and SY-ZONLO are also reset. 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.

SY-CALLD is set to X in a program called using CALL TRANSACTION, CALL DIALOG, or SUBMIT AND RETURN. SY-CALLD is set to space in a program called using LEAVE TO TRANSACTION, entering a transaction code on a screen, and processing batch input folders. With SUBMIT (without RETURN) SY-CALLD retains the previous value.

SY-CPROG In externally called procedures, the name of the calling program, otherwise the name of the current program. If an externally called procedure calls another external procedure, SY-CPROG keeps the name of the first main program and is not given the name of the main program of the further caller. SY-DBNAM With executable programs this is the linked logical database. SY-DYNGR Screen group of current screen. You can assign several screens to a common screen group. You can use this, for example, to modify all of the screens in the group in a uniform way. SY-DYNNR Number of current screen During the selection screen processing, SY-DYNNR contains the screen number of the current selection screen. During list processing, SY-DYNNR contains the number of the container screen. While a subscreen is being processed, SY-DYNNR contains its screen number. This also applies to tabstrips. 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 procedures main program. If SY-REPID was transferred to an external procedure as an actual parameter before Release 6.10, the formal parameter was not given the name of the caller, but the name of the procedures main program. SY-REID had to be transferred to an auxiliary variable before the call or you had to use SY-PROG.

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. OPTIONS FROM in the CALL TRANSACTION USINGstatement can set SY-BINPT to empty for the whole program execution, as well as at the end of the BDC data. In CATT procedures, SY-BINPT is always empty.

ABAP Programming
Constants
SY-ABCDE Contains the Alphabet. Can be used to access individual letters independently of the codepage by specifying offset. SY-ULINE Contains a horizontal line with length 255. Can be used when creating the list. SY-VLINE Contains a vertical line (|). Can be used when creating the list

Loops
SY-INDEX SY-INDEX contains the number of loop passes in DO and WHILE loops, including the current loop pass.

Character Strings
SY-FDPOS Found location for operations with character-type fields.

If the operators CO, CN, CA, NA, CS, NS, CP, NP are used in comparisons, SY-FDPOS is assigned offset values depending on the comparison result. SEARCH FOR sets SY-FDPOS to the offset of the found search string.

Internal Tables
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.

APPENDsets SY-TABIX to the index of the last table row, that is the total number of entries in the target table. COLLECTsets SY-TABIX to the index of the existing or appended table row. With hashed tables, SY-TABIX is set to 0. LOOP ATsets SY-TABIX to the index of the current table row at the beginning of every loop pass. After leaving a loop, SY-TABIX is set to the value it had before entering the loop. With hashed tables, SY-TABIX is set to 0. READ TABLE sets SY-TABIX to the index of the table row read. If no row is found with binary search while reading, SY-TABIX contains the index of the next-highest row or the total number of rows +1. If no row is found with linear search while reading, SY-TABIX is undefined. SEARCH itab FOR sets SY-TABIX to the index of the table row, in which the search string was found.

SY-TFILL With the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL is filled with the row number of the addressed internal table. SY-TLENG With the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, the system fills SY-TLENG with the row size of the addressed internal table.

Database Accesses
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.

DELETEsets SY-DBCNT to the number of lines deleted. FETCHsets SY-DBCNT to the number of lines already read by the current cursor. INSERTsets SY-DBCNT to the number of lines inserted. MODIFYsets SY-DBCNT to the number of lines processed. UPDATE sets SY-DBCNT to the number of lines changed.

Return Value
SY-SUBRC Return value set by the following ABAP statements. In general, a content of 0 means that the statement was executed without problems.

ASSIGNsets SY-SUBRC to 0 if assignment to field symbol is possible, otherwise 4. ASSIGN dref->* sets SY-SUBRC to 0 if dereferencing is possible, otherwise 4. AUTHORITY-CHECK sets SY-SUBRC to 0 if the user has the necessary authorization, otherwise 4, 8, 12, 16, 24, 28, 32, or 36 depending on the cause. CALL DIALOG with USING sets SY-SUBRC to 0, if processing was successful, otherwise <>0. CALL FUNCTION sets SY-SUBRC according to the exception handling. CALL METHOD sets SY-SUBRC according to the exception handling.

CALL SELECTION-SCREEN sets SY-SUBRC to 0 if the user chose Enter or Execute and 4 if the user chose Cancel. CALL TRANSACTION with USING sets SY-SUBRC to 0 if processing was successful, otherwise <>0. CATCH SYSTEM-EXCEPTIONS sets SY-SUBRC if there are runtime errors after the ENDCATCH statement. The value is specified in the program. COMMIT WORK sets SY-SUBRC to 0. COMMIT WORK AND WAIT sets SY-SUBRC to 0 if update was successful, otherwise <>0. COMMUNICATION INIT DESTINATION RETURNCODE sets SY-SUBRC as specified. CONCATENATE sets SY-SUBRC to 0 if the result fits into target variable, otherwise 4. CREATE OBJECT sets SY-SUBRC if the exceptions of the instance constructor are handled. CREATE OBJECT in OLE2 sets SY-SUBRC to 0 if an external object was created, otherwise 1,2, 3 with different causes. DELETEsets SY-SUBRC to 0 if operation was successful, otherwise 4 or <> 0 depending on cause. DEMAND MESSAGES INTO sets SY-SUBRC to 0 if a message table is empty, otherwise <> 0. DESCRIBE LIST sets SY-SUBRC to 0 if row or list exists, otherwise 4 or 8. EXEC SQL - ENDEXEC sets SY-SUBRC to 0 in almost all cases. Only if no set was read with FETCH is SY-SUBRC 4. FETCHsets SY-SUBRC to 0 if at least one row was read, otherwise 4. GENERATE SUBROUTINE POOL sets SY-SUBRC to 0 if generation was successful, otherwise 8. GET CURSOR sets SY-SUBRC to 0 if the cursor is correctly positioned, otherwise 4. GET PARAMETER sets SY-SUBRC to 0 if value found in SAP Memory, otherwise 4. IMPORTsets SY-SUBRC to 0 if import of data objects was successful, otherwise 4. INSERTsets SY-SUBRC to 0 if operation was successful, otherwise 4. LOAD REPORT sets SY-SUBRC to 0 if operation was successful, otherwise 4 or 8 depending on cause. LOOPsets SY-SUBRC to 0 if loop over extract was passed at least once, otherwise 4. LOOP ATsets SY-SUBRC to 0 if loop over internal table was passed at least once, otherwise 4. MODIFYsets SY-SUBRC to 0 if operation was successful, otherwise 4. MODIFY LINE sets SY-SUBRC to 0 if list row was changed, otherwise <> 0. MODIFYsets SY-SUBRC to 0 if operation was successful, otherwise 4. OLE2 automation, bundled commands set SY-SUBRC to 0 if all were successfully executed, otherwise 1, 2, 3, 4 depending on cause. OPEN DATASET sets SY-SUBRC to 0 if the file was opened, otherwise 8.

Open SQL commands set SY-SUBRC to 0 if operation was successful, otherwise <>0. OVERLAYsets SY-SUBRC to 0 if at least one character is overlayed, otherwise 4. READ DATASET sets SY-SUBRC to 0 if the read operation was successful, otherwise 4 or 8 depending on cause. READ LINE sets SY-SUBRC to 0 if list row exists, otherwise <> 0. READ TABLE sets SY-SUBRC to 0 if the table row was found, otherwise 2, 4, 8 depending on cause. REPLACEsets SY-SUBRC to 0 if search string could be replaced, otherwise <> 0. ROLLBACK WORK always sets SY-SUBRC to 0. SCROLLsets SY-SUBRC to 0 if scrolling in list successful, otherwise 4 or 8 depending on cause. SEARCHsets SY-SUBRC to 0 if search string was found, otherwise 4. SELECTsets SY-SUBRC to 0 if at least one row was read, otherwise 4 or even 8 with SELECT SINGLE FOR UPDATE. SET COUNTRY sets SY-SUBRC to 0 if country ID was found in table T005X, otherwise 4. SET BITsets SY-SUBRC to 0 if bit was set, otherwise <> 0. SET TITLEBAR sets SY-SUBRC to 0 if title exists, otherwise 4. SHIFT UP TO sets SY-SUBRC to 0 if position was found in character string, otherwise 4. SPLITsets SY-SUBRC to 0 if size of target fields is sufficient, otherwise 4. UPDATEsets SY-SUBRC to 0 if operation successful, otherwise 4. WRITE TO sets SY-SUBRC to 0 if assignment successful, otherwise 4.

Screens
Screens
System fields are set at the PAI event for every screen. These can be also used for interactive list processing, except for SY-DATAR, SY-LOOPC, and SY-STEPL. SY-CUCOL Horizontal cursor position Counting starts at column 2 SY-CUROW Vertical cursor position Counting starts at row 1 SY-DATAR Set to X at time of PAI if at least one screen input field was changed by the user or other data transfer, otherwise empty. 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 Index of current row in a screen table (table control). Is set at every loop pass. Outside a loop, for example during the POV event for a table row, SY-STEPL is not set appropriately. SY-TITLE Text that appears in the title bar of the screen. For selection screens and lists this is the program name, otherwise SAP. Can be set during PBO usingSET TITLEBAR. SY-UCOMM Function code that triggered the event PAI. Every user action that triggers PAI is assigned a unique function code, with one exception: ChoosingENTER triggers PAI and different function codes can be transferred to SY-UCOMM:

If there is an entry in the command field of the standard toolbar, this is transferred to SYUCOMM as the function code. If there is no entry in the command field and a function code is assigned to the ENTER key, this function code is transferred to SY-UCOMM. If the command field does not contain an entry and no function code is assigned to the ENTERkey, it is empty and the content of SY-UCOMM is not affected.

Selection Screens
SY-SLSET Variant used to fill the selection screen.

Creating Lists
When creating a list you can use the following system fields to navigate. They help to ensure that output statements do not overwrite any existing output and that the system does not try to write outside the list. The current output position is always in the system fields SY-COLNO and SYLINNO and is rest for every output statement. The remaining system fields contain further values for the list creation. SY-COLNO Current column during list creation. Counting starts at 1. SY-COLNO is set by the following output statements:

WRITE, ULINE, SKIPset SY-COLNO to the next output position. BACKsets SY-COLNO to 1. POSITION col sets SY-COLNO to col. If collies outside the page, the subsequent output statements are ignored. NEW-LINE sets SY-COLNO to 1. NEW-PAGE sets SY-COLNO to 1.

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.

LINE-COUNT in the statements REPORT, PROGRAM, FUNCTION POOL sets SY-LINCT for the current program.

LINE-COUNT in the SUBMIT statement sets SY-LINCT for the called program.

SY-LINNO Current row during the list creation. Counting begins at 1 and includes the page header. SYLINNO is set by the following output statements:

WRITE, ULINE, SKIPraise SY-LINNO by 1 in the case of a line break. BACK sets SY-LINNO to the first row after the page header. BACKin connection with RESERVE sets SY-LINNO to the first row of a block of lines. NEW-LINE raises SY-LINNO by 1. SKIP TO LINE lin sets SY-LINNO to lin. If lin does not lie between 1 and the page length, the system ignores the statement.

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 REPORTor NEW PAGE statement.

LINE-SIZE in the statements REPORT, PROGRAM, FUNCTION POOL sets SY-LINSZ for the current program. LINE-SIZE in the SUBMIT statement sets SY-LINSZ for the called program.

SY-PAGNO Current page during the list creation.

WRITE, ULINE, SKIPraise SY-PAGNO by 1 in the case of a line break. NEW-PAGE raises SY-PAGNO by 1, but only if at least one output follows both on the current page and after the NEW-PAGE statement. NEW-SECTION of the NEW-PAGE PRINT ON statement sets SY-PAGNO to 1.

SY-TVAR0 ... SY-TVAR9 In the program, you can assign values to these system fields. During the TOP-OF-PAGE event, the system replaces the placeholders of the programs list and column headers with the contents of the system fields SY-TVAR0 to SYTVAR9. SY-WTITL Is set to N in the statements REPORT, PROGRAM, and FUNCTION-POOLif the NO STANDARD PAGE HEADING addition is used, otherwise empty.NEW-PAGE does not set SY-WTITL.

List Processing
At each interactive list event and for READ LINE, the system automatically fills the following system fields: SY-CPAGE Page number of the first displayed page of the list from which the event was triggered. Counting starts at 1 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 Index of the list that is being created (basic list: 0, detail list > 0). Each time an interactive list event occurs, the system automatically increases SY-LSIND by 1. SY-LSIND can be changed in the ABAP program to navigate between detail lists. Changes to SY-LSIND are not taken into account until the end of the list event. Therefore, any manipulation of SY-LISND should be done using the last command of the processing block. SY-LSTAT ID for list levels within the program. SY-LSTAT can be filled with values during list creation in the ABAP program. The value valid when the list is completed is saved with the list. In the case of an interactive list event, SY-LSTAT is set to the value it was assigned during the creation of the list from which the event takes place. SY-LSTAT is no longer maintained and should therefore no longer be used. SY-STACO Number of the first displayed column of the list from which the event was triggered. Counting starts at 1. SY-STARO Number of the upper-most displayed row of the upper-most page of the list, from which the event was triggered. Counting begins at 1. This does not include the page header.

Printing Lists
When printing lists, the spool and runtime systems require certain internal information, which is available in the following system fields and is set during print activation. SY-CALLR Contains a value that displays where printing was started, for example NEW-PAGE for programcontrolled printing or RSDBRUNT for printing from the selection screen. SY-PRDSN Contains the name of the spool file during printing. SY-SPONO Contains the name of the spool number during printing. SY-MAROW, SY-MACOL The SET MARGINstatement 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 The print parameters are transferred to the spool system by the runtime system in a structure of dictionary type PRI_PARAMS. Before this structure was used, its purpose was served by system fields. Today a subset of the PRI_PARAMS structure is still written to system fields with the same names when printing is activated. This information is redundant and should not be used.

Messages
If you execute the MESSAGE statement, the following system fields are set. If you execute the MESSAGE RAISING statement in function modules and methods, these fields are also set in the calling program, if it handles the exception. 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 messages placeholders. Special Actions that Fill Message Fields

If you request database locks using the ENQUEUE function module, the field SY-MSGV1 contains the name of the user who holds the lock, in the case of the FOREIGN_LOCK exception. IN the case of CALL TRANSACTION or CALL DIALOG with the USING addition, a message displayed during the called screen sequence is returned in the fields SY-MSGID, SY-MSGTY, SY-MSGNO, SY-MSGV1, ... , SY-MSGV4. During Remote Function Call (RFC), error messages are transferred from the remote system to the calling system and SY-MSGID, SY-MSGTY, SY-MSGNO,SY-MSGV1, SYMSGV2, SY-MSGV3, SY-MSGV4 are set. If short dumps or type X messages occur, the system also sets the fields.

Internal system 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 Undocumented SY-CHWAE Undocumented SY-DEBUG Undocumented SY-DSNAM Name of spool output file. SY-ENTRY Undocumented SY-FFILE Flat file (USING/GENERATING DATASET). SY-FLENG Length of a field. SY-FODEC Number of decimal places of a field. SY-FOLEN Output length of a field.

SY-FTYPE Data type of a field. SY-GROUP Bundling SY-INPUT Undocumented SY-LPASS Undocumented SY-NEWPA Undocumented SY-NRPAG Undocumented 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. The value 'P' means that the program is already executing a subroutine started using PERFORM ON COMMIT and therefore a further subroutine call using PERFORM ... ON COMMIT would cause a runtime error. SY-PAUTH Undocumented SY-PLAYO Undocumented SY-PLAYP Undocumented SY-PNWPA Undocumented SY-PRI40 Undocumented SY-PRINI Undocumented SY-PRLOG Undocumented SY-REPI2 Undocumented SY-RSTRT Undocumented SY-SFOFF Undocumented SY-SUBCS Call status of an executable program.

SY-SUBTY Call type of an executable program. SY-TABID Undocumented SY-TLOPC Undocumented SY-TSTIS Undocumented SY-XCODE Extended function code Is filled, like SY-UCOMM, by user actions on lists. Before the length of SY-UCOMM was increased from 4 to 70 characters, SY-XCODE was used internally to evaluate lengthy entries in the command field of the lists standard toolbar. Use SY-UCOMM in application programs. SY-XFORM SYSTEM-EXIT subroutine. SY-XPROG SYSTEM-EXIT program.

Obsolete System Fields


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. No longer filled. SY-BATZD In R/2, ID for daily background scheduling. No longer filled. SY-BATZM In R/2, ID for monthly background scheduling. No longer filled. SY-BATZO In R/2, ID for single background scheduling. No longer filled. SY-BATZS In R/2, ID for immediate background scheduling. No longer filled. SY-BATZW In R/2, ID for weekly background scheduling. No longer filled. SY-BREP4 In R/2, root name of request report for background processing. No longer filled. SY-BSPLD In R/2, ID for immediate spool output for background processing. No longer filled. SY-CCURS In R/2, rate specification/result field from CURRENCY CONVERSION. No longer filled.

SY-CCURT In R/2, table rate from CURRENCY CONVERSION. No longer filled. SY-CDATE In R/2, rate date from CURRENCY CONVERSION. No longer filled. SY-CTABL In R/2, rate table from CURRENCY CONVERSION. No longer filled. SY-CTYPE In R/2, rate type from CURRENCY CONVERSION. No longer filled. SY-DCSYS Dialog system of R/2 System No longer filled. SY-FMKEY Previously, current function code menu. No longer filled. SY-LOCDB Local database, not implemented. SY-LOCOP Local database operation, not implemented. SY-MACDB Previously, name of file for matchcode access. No longer filled. SY-MARKY Current line character for the MARK statement. However, the language element MARK will only be supported for a short time. SY-PAGCT In R/2, maximum number of pages per list. No longer filled. SY-PREFX ABAP prefix for background jobs. No longer filled. SY-SFNAM Undocumented SY-SPONR In R/2, you could process spool files using the TRANSFER statement, set by SY-SPONR. No longer filled. SY-TFDSN Previously, name of external storage file for extracts. No longer filled. SY-TMAXL Previously, maximum number of entries in an internal table. No longer filled. SY-TNAME Previously, name of an internal table after an access. No longer filled. SY-TOCCU With the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TOCCU was filled with the value of the initial main memory requirements for the addressed internal table. No longer filled.

SY-TPAGI Previously, ID whether an internal table is stored in the paging area. No longer filled. SY-TTABC Previously, index of last read row in an internal table. No longer filled. SY-TTABI Previously, offset of internal tables in roll area. No longer filled. SY-WAERS Previously, company code currency after reading booking segment. No longer filled. 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 longer used. SY-WINX2 In R/2, window coordinate for detail list in window. No longer used. SY-WINY1 In R/2, window coordinate for detail list in window. No longer used. SY-WINY2 In R/2, window coordinate for detail list in window. No longer used.

Potrebbero piacerti anche