Get Example source ABAP code based on a different SAP table
Standard SAP Help for SCROLL
Short Reference > • SCROLL LIST ABAP Statement
ABAP Syntax SCROLL LIST [ horizontal>]> [vertical>]> [ • idx].>
ABAP Addition ... • idx>
What does it do? 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.
Without using the statement SCROLL>, the system displays a list during the 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 was 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. • • SCROLL LIST
What does it do? The list level can be specified with the addition •>, where a data object (which contains the list index) of type i> is expected for idx>. The value of idx> must be greater than or equal to 0. If the addition •> 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 was 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>Meaning> 0Screen section was scrolled. 4Complete scrolling not possible because the list margin was reached. 8Scrolling not possible because the specified list level does not exist.
Latest notes:While scrolling through the list that is being created (sy-lsind>), remember that a SCROLL> statement has no effect prior to the first output statement, since the list does not yet exist in the list buffer.
Example ABAP Coding 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.