Enter

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.
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

Format Enter

Enter “Value”

Enter “Value” process=InputScript.txt” 

Options
OnError= A function code that is executed in case of an error message, as response to the first function code. See  Special Topics->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 …
    Set
F[Material] “abc”
    Enter
“/5″ OnError=“Continue”

    // The following statements are executed in the case of an error message
    Message 
“Material abc not found”
    Set
F[Material] “xyz”
    Enter
“/5″ OnError=“Continue”

    // The following statements are executed in the case of a 2nd error message
    Message 
“Material xyz not found”
    Set
F[Material] “M-01″
    Enter
“/5″ 

 

Wait= Parameter in milliseconds between 0 and 5000. The Enter is performed after the specified number of milliseconds. 
Enter “/ScrollToLine=…”

Table= 

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 our “Special Topics”.

Tips
& 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.

Enter