AT LINE-SELECTION.
This statement defines an event block whose event is triggered by the
ABAP runtime environment during
the display of a screen list - provided the scren cursor is on a list line and you select a function using the function code PICK. Through the definition of this event block, the
standard list status is automatically
enhanced in such a way that the function code F2 and, with it, the double-click mouse function is linked up to the function code PICK.
If the function key F2 is linked with a function code
different than PICK, each double click will trigger its
even, usually AT USER-COMMAND, and not AT LINE-SELECTION.
This program works with the standard list status. A line selection with the left mouse key causes the event AT LINE-SELECTION and creates details lists.
REPORT demo_at_line_selection.
START-OF-SELECTION.
WRITE 'Click me!' COLOR = 5 HOTSPOT.
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.