Entering content frameScrolling in Detail Lists Locate the document in its SAP Library structure

You can scroll in a detail list using the SCROLL statement. The Scrolling in Lists section contains a full description of the statement and how to use it for basic lists.

When you use the SCROLL statement with detail lists, you must remember the following:

Another way of scrolling interactive lists from within the program is to use the SET USER-COMMAND statement in conjunction with the corresponding predefined function codes (P...).

Example

REPORT demo_list_scroll NO STANDARD PAGE HEADING LINE-SIZE 50.

SET PF-STATUS 'SELECT'.

WRITE 'Create a secondary list by choosing SELECT'.

AT USER-COMMAND.
  NEW-PAGE LINE-SIZE 200.
  CASE sy-ucomm.
    WHEN 'SELE'.
      SET PF-STATUS 'SCROLLING'.
      DO 200 TIMES. WRITE sy-index. ENDDO.
      SCROLL LIST RIGHT BY 48 PLACES INDEX sy-lsind.
      sy-lsind = sy-lsind - 1.
    WHEN 'LEFT'.
      SCROLL LIST LEFT BY 12 PLACES.
    WHEN 'RGHT'.
      SCROLL LIST RIGHT BY 12 PLACES.
  ENDCASE.

This program creates a basic list of one line with the status SELECT. In the status SELECT, the function code SELE (text (SELECT) is assigned to function key F2 and to a pushbutton in the application toolbar.

After choosing SELECT, the system triggers the AT USER-COMMAND event and creates a detail list with status SCROLLING. In the status SCROLLING, the function codes LEFT (text LEFT) and RGTH (text RIGHT) are assigned to the function keys F5 and F6 and to the application toolbar. The detail list is 200 characters wide. The SCROLL statement scrolls the detail list (SY-LSIND = 1) by 48 columns to the right after it has been created. Then, SY-LSIND is decreased by 1 and the scrolled list replaces the basic list.

By clicking on LEFT and RIGHT, the user can scroll to the left and to the right in the displayed list. The SCROLL statements are programmed for the corresponding function codes within the AT USER-COMMAND event.

 

 

 

 

Leaving content frame