Show TOC

Background documentationScrolling by Columns Locate this document in the navigation structure

 

To scroll a list horizontally by columns, the SCROLL statement offers several options. A column in this case means one character of the list line.

Scrolling to Specific Columns

To scroll to specific columns, use the TO COLUMN option of the SCROLL statement:

Syntax

SCROLL LIST TO COLUMN col [INDEX idx].

If you do not specify the INDEX option, the system displays the current list starting from column col. If you specify the INDEX option, the system scrolls the list of list level idx. For more information on list levels, see Interactive Lists.

Scrolling by a Specific Number of Columns

To scroll a list by a specific number of columns, use the following option of the SCROLL statement:

Syntax

SCROLL LIST LEFT|RIGHT BY n PLACES [INDEX idx].

If you do not specify the INDEX option, the statement scrolls forward or backward n columns. The INDEX option specifies a particular list level as described above.

Syntax Syntax

  1. REPORT demo_list_scroll_4 NO STANDARD PAGE HEADING LINE-SIZE 200.
  2. TOP-OF-PAGE.
  3.   WRITE: AT 161 'Top of Page', sy-pagno,
  4.                   'SY-SCOLS:', sy-scols.
  5.   ULINE.
  6. START-OF-SELECTION.
  7.   DO 200 TIMES.
  8.     WRITE sy-index.
  9.   ENDDO.
  10.   SCROLL LIST TO COLUMN 178.
End of the source code.

This program creates a one-page list with a width of 200. If the current window width (stored in sy-scols) equals 40, the output of the program looks as follows:

This graphic is explained in the accompanying text.

The list is displayed starting from column 178. The user can now scroll to the left of the list.