List Events

Following List events are frequently used in list reports.

TO_OF_PAGE.

TO_OF_PAGE event is used to define page header in list.

END-OF_PAGE.

END-OF-PAGE event creates page footer in list.

AT LINE-SELECTION.

At LINE-SELECTION event triggers whenever line is clicked in a list. Function code Pick is updated in system variable.
 
AT USER-COMMAND.

At USER-COMMAND event triggers whenver self-defined user function code is chosen.

below is simple example for using list events.

REPORT yua_list_event LINE-COUNT 10.
TOP-OF-PAGE.
  WRITE:  'Page Header ' CENTERED COLOR 1.
END-OF-PAGE.
ULINE.
START-OF-SELECTION.
  SET USER-COMMAND 'SLFCODE'.
  WRITE 'Basic List' COLOR = 5 HOTSPOT.

 AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'MYCOMM'.
      WRITE:/ 'Welcome to List Report page2'.
      WRITE:/ 'Details List from USER-COMMAND Page1,'.
       WRITE: 'SY-LSIND', sy-lsind.
      SET CURSOR LINE 1.
       SET USER-COMMAND 'PICK'.
  ENDCASE.
NEW-PAGE.

END-OF-SELECTION.
AT LINE-SELECTION.
  WRITE: / 'You clicked list', sy-listi,
         / 'You are on list', sy-lsind.
   IF sy-lsind < 20.
    SKIP.
    WRITE: 'More ...' COLOR = 5 HOTSPOT.
  ENDIF.





No comments:

Post a Comment

Code Inspector

The Code Inspector tests single objects or object sets (programs, function groups, classes, interfaces, Dictionary objects) for performanc...