|Sample code, images||Restrictions, SAP Release, SAP GUI version, GuiXT version|
|30 Debugging a GuiXT script like an InputScript
For InputScripts you can use a number of debugging functions (line by line processing, breakpoints, variable display); simply click the “Debug” button before you execute the InputScript.
GuiXT scripts can also become quite complex, so that you may wish to use a debugger which is currently not offered by GuiXT. With the following trick you can use the InputScript debugger for GuiXT scripts as well:
Create a script “debug.txt” that contains the following lines
When you now want to debug a GuiXT script, add a first line
in the script. It will show a toolbar button “MyScriptDebug”, but will not change the script logic in any way. To debug the script, open the GuiXT debug window (GuiXT Debug button) and then click “MyScriptDebug” .
Why do we use the “/O” function (session overview – be careful: it is slash oh, not slash zero !) and an additional screen command in “debug.txt” instead of simply pressing “Enter” to start the script? The reason we avoid pressing “Enter” is that a number of transactions already perform an action on “Enter”, (an action that we don’t want here) which, for example, would lead to a different screen or to an error message instead of re-processing our GuiXT script in debug mode.