Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

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 SY-LINNO 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, SKIP set SY-COLNO to the next output position.
• BACK sets SY-COLNO to 1.
• POSITION <col> sets SY-COLNO to <col>. If <col> lies 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. SY-LINNO is set by the following output statements:
• WRITE, ULINE, SKIP raise SY-LINNO by 1 in the case of a line break.
• BACK sets SY-LINNO to the first row after the page header. BACK in 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 REPORT or 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, SKIP raise 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 program's 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-POOL if 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 program-controlled 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 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.