ABAPAT_USER-COMMAND - AT USER-COMMAND

CPI1466 during Backup   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.

AT USER-COMMAND

Short Reference



Syntax

AT USER-COMMAND.

Effect

This statement defines an event block whose event is triggered by theABAPruntime environment if, during the display of a screen list, a function with a self-defined function code was chosen.

Note

Self-defined function codes are all those that include character combinations, except for the following:

  • The function codes "PICK" and "PFnn" ("nn"stands for 01 to 24) do not cause the event AT USER-COMMAND, but the events AT LINE-SELECTION and AT PFnn.
  • All function codes that start with the character "%" are interpreted as system functions and do not cause the event AT USER-COMMAND. The system functions for lists are listed in the following table 1.
  • The function codes in the following table 2, likewise, do not cause the event AT USER-COMMAND, but are handled by the list processor.


Table 1

Function codeFunction
%CTXCall a context menu
%EXExit
%PCSave to file
%PRIPrint
%SCSearch for ...
%SC+Find next
%SLSearch in office
%STSave to report tree

Table 2

Function codeFunction
BACKBack
P-Scroll to previous page
P--Scroll to first page
P+Scroll to next page
P++Scroll to last page
PFILE nameStore list lines in a text file named "abap.lst" in standard character representation in the standard directory of theapplicationserver. If a name is entered using name, this is converted to lowercase letters and used as the file name.
PL-Scroll to first line of the page
PL-nScroll n lines back
PL+Scroll to last line of the page
PL+nScroll n lines up
PNOPNo effect
PP-Scroll back one page
PP-nScroll n pages back
PP+Scroll one page forward
PP+nScroll n pages forwad
PPnScroll to beginning of page n
PRI, PRINTPrint
PS--Scroll to first column
PS++Scroll to last column
PS-Scroll one column to the left
PS-nScroll n columns to the left
PS+Scroll one column to the right
PS+nScroll n columns to the right
PSnScroll to column n
PZnScroll to line n
RWCancel

Example

This program works with a self-defined GUI status MYLIST. The function that is linked there with the function code MY_SELECTION causes the event AT USER-COMMAND during list display and also creates details lists.

REPORT demo_at_user_command.

START-OF-SELECTION.
  SET PF-STATUS 'MYLIST'.
  WRITE 'List line'.

AT USER-COMMAND.
  IF sy-lsind = 20.
    SET PF-STATUS 'MYLIST' EXCLUDING 'MY_SELECTION'.
  ENDIF.
  CASE sy-ucomm.
    WHEN 'MY_SELECTION'.
      WRITE: / 'You worked on list', sy-listi,
             / 'You are on list', sy-lsind.
    ...
  ENDCASE.


ABAP Short Reference   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.


Length: 8555 Date: 20120518 Time: 194431     triton ( 48 ms )