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