SAP LIST SYSTEMFIELDS

Get Example source ABAP code based on a different SAP table
  


ARTICLE

Lists - System Fields
The sections below give an overview of the system fields relevant for list processing. The list that is currently being created is called the 'current' list (like the current page, or current line). A list that has just been displayed, possibly involving a list event, is known as the 'displayed' list. 'Absolute' means that the list itself is referred to and not the state of the list screen. A row selected by a list event on which the cursor is positioned, or which is read by READ LINE, is called the 'selected' row.

System Fields when Creating Lists
These system fields are set after every interactive list event and by the statement READ LINE. System FieldMeaning sy-pagnoPage number of the current page of the current list. Counting begins at 1. sy-linnoNumber of the current row on the current page. Counting begins at 1. sy-colnoNumber of the column on which the cursor is positioned on the current list. Counting begins at 1. sy-linctNumber of rows per page of the current list, if it was specified by the LINE-COUNT addition of the statement REPORT or NEW-PAGE . Otherwise, sy-linct has the value zero. sy-linszRow width of the current list. Set by the LINE-SIZE addition of the REPORT or NEW-PAGE statement. sy-title List header. Set in the text elements of a program or by SET TITLEBAR. sy-srowsCurrent number of rows in the display window. Counting begins at 1. sy-scolsCurrent number of columns in the display window. Counting begins at 1.

System Fields After List Events System FieldMeaning sy-lsindList level of the current list; (basic list: 0, first detail list: 1, ..., twentieth detail list: 20). sy-lsind can be set in the program to replace the current list with the list of the set level. sy-lilliAbsolute number of a selected row in the displayed list. Counting begins at 1. sy-listiList level of the displayed list. sy-liselContents of the selected row. sy-curowNumber of the row in the window, on which the cursor of the displayed list was positioned. Counting begins at 1. sy-cucolNumber of the column in the window, on which the cursor of the displayed list was positioned. Counting begins at 2. sy-cpageNumber of the first displayed page of the displayed list. Counting begins at 1. sy-staroNumber of the first row on the first displayed page of the displayed list. Counting starts at 1, the rows of the page header are included. sy-stacoNumber of the first displayed column of the displayed list. Counting begins at 1. sy-ucommFunction code that triggered the event on the displayed list. sy-pfkeyGUI status of the list currently being displayed.

Note
The program SHOWLISY displays the current values of the system fields above. Changes to the values caused by scrolling, changing the window size, selecting a list row, and so on, can be monitored.