Purpose With Enter you can simulate a user action within an InputScript. If you use Enter without specifying anything else, the InputAssistant simulates pressing the Enter button. You can also specify an internal function code which corresponds to a menu entry or a pushbutton. Instead of using the internal function code you can name the pushbutton in the format P[xxx]  where xxx is the pushbutton text.
Examples Enter

Enter "=BU"
The internal function code "=BU" is activated.

Enter "/nSE38" process="ShowABAPSource.txt"
The transaction SE38 is started and InputScript ShowABAPSource.txt is executed

Enter P[Documents]
The pushbutton "Documents" is pressed. This can be a pushbutton within the screen, a toolbar button or a tab in a tabbed dialog. If a toolbar button is shown as icon-only you can address it via its tooltip.

Format Enter

Enter "Value"

Enter "Value" process="InputScript.txt"

OnError= A function code that is executed in case of an error message, as response to the first function code. See  File Handling in InputScripts, Example 2 for an example. Typically, the  OnError=  function code is  "/N" (Cancel transaction) or "/12" (Cancel). The Script is continued with the Screen command that is active after executing the  OnError function code. The  variable V[_lasterror] contains the error text.

OnError="Continue"  This is the most flexible way to handle error messages, but you have to program all further actions in your InputScript. In the case of an error message, the script is continued with the statement after the Enter statement. The variable V[_lasterror] contains the error text. Among other things you can now correct certain values with "Set", and then enter a new function code.  Please observe:

  • Some of the  normal entry fields might be read-only in the case of an error.
  • All statements between Enter ... OnError="Continue" and the next Screen command are executed only if an error message is produced by  Enter.  Otherwise they are skipped. 
  • It is also possible to use  Enter ... OnError="Continue" several times within one Screen block, e.g. to try several input values. Example:

  Screen ...
F[Material] "abc"
"/5" OnError="Continue"

// The following statements are executed in the case of an error message
"Material abc not found"
F[Material] "xyz"
"/5" OnError="Continue"

// The following statements are executed in the case of a 2nd error message
"Material xyz not found"
F[Material] "M-01"

Wait= Parameter in milliseconds between 0 and 60000 (1 minute). The Enter is performed after the specified number of milliseconds.  
-visible The current screen is displayed. Most often used in conjunction with wait=.
Enter "/ScrollToLine=..."


Scrolling in a table on the screen. Specify the table name and a line number, starting with 1.  

In list output, scrolling is possible as well; no table name needs to be specified in this case.

Enter control="controlname" item="itemnid" event="eventno"


Clicking a button or selecting a menu in a special control (like object services). Please use the "Input Recording" to create the control, item and event. Example:

Enter control="DIALOGCTRL.Toolbar" item="CREATE_ATTA" event="2"

For simple actions, this command allows to automate some of SAP's special controls. More complex control handling is possible with "SAP GUI scripting"; please see  Overview SAP GUI Scripting

Enter "/searchhelp"  techname=... 


Calls SAP searchhelp. Additional parameters as in InputField.
& Tricks
  • If no Enter is specified for the current screen, the processing of the InputScript is terminated. The user can then continue with the transaction himself.
  • See Pushbutton for a description of how to get the internal code.
  • If you activate Options->Visible Auto Processing for a test of your InputScript, you only press the Enter button in each screen in order to simulate the function code that you specified in the InputScript.
  • Note: if  Enter is always executed, the system will loop. In this case you can stop it by selecting  Options->Visible Auto Processing.
Components GuiXT