SCROLL LIST [horizontal]
[vertical]
[INDEX idx].
This statement scrolls the display area of a list stored in the list buffer to the position specified in horizontal and/or vertical. At least one of these additions must be specified, in which all horizontal specifications refer to the columns of a displayed list. The corresponding section is displayed when the list is next displayed.
Withou using the statement SCROLL, a list is displayed
during its initial display starting from the first column of the first row. If the user navigates from
a details list back to a lower list level, the list is displayed with the section in which it wa last
displayed. The SCROLL-statement sets a new first column,
a new first row, or both. Each SCROLL-statement sets only the size specified in it, without changing the other positions.
... INDEX idx
The list level can be specified with the addition INDEX,
where a data object (which includes the list index) of the type i
is expected for idx. The value of
idx must be greater than or equal to 0. If the addition INDEX
is not specified, then the list level 0 (the basic list itself) is selected during the creation of the basic list, and the list level at which the event is triggered
(sy-listi) is selected during the processing of a list event. If the list level specified in idx is not available,
sy-subrc is set to the value 8.
System Fields
sy-subrc | Relevance |
0 | Screen section was successfully scrolled. |
4 | Complete scrolling not possible because the list margin was reached . |
8 | Scrolling not possible because the specified list level does not exist. |
While scrolling through the list just created (sy-lsind),
please note that a SCROLL-statement has no effect prior to the first output statement, since the list does not yet exist in the list buffer.
By double-clicking the basic list, you can scroll down this list in the AT LINE-SELECTION event block to the page entered in a selection screen. The lines on the page retain their original position with reference to the page header by using sy-staro. However, you do not need to explicitly set the column to sy-staco, since this position is retained during vertical scrolling.
REPORT LINE-COUNT 100 LINE-SIZE 100
NO STANDARD PAGE HEADING.
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
PARAMETERS page TYPE i.
SELECTION-SCREEN END OF SCREEN 500.
START-OF-SELECTION.
DO 10000 TIMES.
WRITE sy-index.
ENDDO.
TOP-OF-PAGE.
ULINE.
WRITE sy-pagno.
ULINE.
AT LINE-SELECTION.
CALL SELECTION-SCREEN 500 STARTING AT 10 10.
SCROLL LIST TO COLUMN sy-staco
TO PAGE page LINE sy-staro.