SAPGUI Command Interface

This example illustrates the main features of the SAPGUI command interface. In order to see all the details of the command interface, you need to display it using the complete view.

Header Data

If the ResetGUI contains 'X', the transaction specified in ProcessedScreen[1] will be started anew – that is, it has a similar effect to putting a ‘/n’ before the transaction code. SAPGUI commands only replay properly if each successive command starts at exactly the same point at which the last command stopped. Everything that you record in a single attempt fulfills this condition but if you record a test script in sections, this might not be the case. For example, where several transactions have been recorded separately, you can set the ResetGUI flag in the first SAPGUI command following each change of transaction.

ConnectionID and SessionID uniquely identify the sessions during replay. When everything should run in the same session, all the SAPGUI command interfaces must have the same SessionID and ConnectionID. You can change these values in several commands simultaneously using Edit ® Parameter/Command Interfaces ® Replace IDs in SAPGUI Interfaces.

SystemInfo is only for logging purposes. It is overwritten during replay with the data of the replay system and front end.

ProcessedScreen Node


·        If the flag is not set, ProcessedScreen will not be executed.

·        If 'X', ProcessedScreen will be executed.

·        If 'O', ProcessedScreen will only be executed if the screen actually appears.

Transaction contains the transaction code.

Program contains the program name.

ScreenNumber contains the screen number.

Message contains the recorded messages.

InitialState contains the recorded initial states of the GUI elements.

UserChangedState contains the changes, made by the user, to the state of the GUI elements.

UserChangedState Node

If you want a field to be available for parameterization in the command interface, you must edit it during recording. In the SAP GUI for Windows, you can replace a value with the same value again – this is handled as if you had really changed the value.

Message Node

If AsPopup contains 'X', the message is a popup.

Messages can be handled by enclosing SAPGUI commands in a MESSAGE..ENDMESSAGE block.

InitialState Node

The complete hierarchy of GUI elements down to the element to be checked is shown in the InitialState node. At each level there is a Check node where you can turn on ('X' ) or off the checks for all underlying GUI elements.

You can parameterize CheckValue.

In the log, the actual value of the GUI element appears beside the Value node.

Usually, it is better to use the GETGUI command to read values from the GUI.