Purpose With On an InputScript can be processed if the user presses Enter or a function key. On is used in a GuiXT script.
Examples On "Enter" Process="nextproduct.txt"

On "/11" fcode="/0" process="update.txt"

Format On "fc" process="script"

On "fc" process="script" fcode="newfc"

"fc" can be one of the following strings:

  • "Enter"
  • "/n" where n is the number of a function key
  • "=fcode" "=fcode" is the function code assigned to a pushbutton
  • P[buttonname] a pushbutton within the screen or in the toolbar
  • "/Menu=i,j,k,l" where i,j,k,l represent a menu entry. Please use the Input Recording option in order to generate the correct menu path

fcode="newfc" the code newfc is invoked. This can be a code from the menu, e.g. SCMP, or a transaction code like /NFB01 or /OMM02.

Please note: If  fcode= is not specified, the original function is retained, but with On "=fcode" and pushbuttons within the screen, only Enter is triggered. It is therefore recommended to always specify fcode=.

Special Controls On control="controlname" item="itemid" event="eventno"  fcode="newfc" process="script" 

Handles simple events in special controls (button click, menu item selection), e.g. in "Object services". Please use the "Input Recording" to create the control, item and event . They are identical with the specifications in  "Enter".   

The notation item="*"  handles a control action for all items, e.g. a click on any node in the tree view.

Following system variables are set:

V[_control_name]  Name, e.g. "TableTreeControl"
V[_control_event]  Operation id  e.g. "21"
V[_control_item0]  Parameter, ze.g. a node id  "0000008"
V[_control_item1]  further parameter
V[_control_item2]  further parameter
V[_control_item3]  further parameterr
V[_control_XML_string] The XML string the control sends to the SAP application. Example:

<?xml version= 1.0 encoding= sap* ?> <DATAMANAGER> <EVENTS> <EVENT EVENTID = 21 SHELLID = 122 > <PARAM PID = 0 VALUE = 000008 /> </EVENT> </EVENTS> <CONTROLS> <CONTROL SHELLID = 122 > <PROPERTY VALUE = 000008 NAME = ABAPSelNodeKey /> </CONTROL> </CONTROLS> </DATAMANAGER>

Tips
&Tricks

A combination of function keys with the  Ctrl and Shift keys can be represented by a number between 13 and 48

Shift = +12
Ctrl  = +24

The  Enter key can be represented by /0.

Shift+F1      /13                    Ctrlt+F1      /25                   Shift+Ctrl+F1      /37
Shift+F2      /14                    Ctrlt+F2      /26                   Shift+Ctrl+F2      /38
Shift+F3      /15                    Ctrlt+F3      /27                   Shift+Ctrl+F3      /39
Shift+F4      /16                    Ctrlt+F4      /28                   Shift+Ctrl+F4      /40
Shift+F5      /17                    Ctrlt+F5      /29                   Shift+Ctrl+F5      /41
Shift+F6      /18                    Ctrlt+F6      /30                   Shift+Ctrl+F6      /42
Shift+F7      /19                    Ctrlt+F7      /31                   Shift+Ctrl+F7      /43
Shift+F8      /20                    Ctrlt+F8      /32                   Shift+Ctrl+F8      /44
Shift+F9      /21                    Ctrlt+F9      /33                   Shift+Ctrl+F9      /45
Shift+F10    /22                    Ctrlt+F10    /34                   Shift+Ctrl+F10    /46
Shift+F11    /23                    Ctrlt+F11    /35                   Shift+Ctrl+F11    /47
Shift+F12    /24                    Ctrlt+F12    /36                   Shift+Ctrl+F12    /48

Example:

On "/39" fcode="/0" process="warning.txt"

Result: When the user presses  Ctrl+Shift+F3, the Enter key is simulated and the script warning.txt is processed.

Components GuiXT + InputAssistant