SAP GUI Scripting API
Purpose
In SAP R/3 4.6C active elements ("controls") were introduced in SAP GUI and consumed by many applications. Since existing automation approaches at that point of time where not able to handle controls and, therefore, could no longer be used to automate user interaction with modern applications, SAP GUI Scripting was created.- Automatic testing of SAP functionality
- Customized front-end applications replacing the SAP GUI
- Tools to customize applications on the SAP GUI level -> GuiXT
- E-Learning applications that guide a user through SAP transactions
Integration
Many of the available SAP GUI controls were designed exclusively with user interaction in mind. As their business functionality is closely coupled with the user interface, they cannot be instantiated outside the SAP GUI in a batch-like fashion.
We therefore decided not to add the business functionality of the SAP GUI controls to a low-level integration component. Instead the controls run within the SAP GUI, which itself exposes a new interface allowing the automation of tasks.
Features
We developed an object model representing the SAP GUI at runtime as a hierarchy of objects. Most of these expose an interface to an element of the user interface. These interfaces can be used to perform all the actions a user could do with the given element. In addition we offer outgoing interfaces through which an external application can receive notifications about events occurring within the SAP GUI.The SAP GUI Scripting API is available in SAP GUI for Windows and SAP GUI for Java. However, SAP GUI for Java does not support the complete set of objects / methods / properties available in SAP GUI for Windows. An example is the GuiOfficeIntegration object, which is only available in SAP GUI for Windows ("SAP Desktop Office Integration").
- Listening to the actions a user performs in the SAP GUI and record them as a script
- Running a script that emulates user interaction
- Logging the SAP system information, such as response time
Runtime hierarchy overview
Top-level administrative objects
All objects defined in the scripting component's object model are available at runtime as members of a hierarchical tree with the root object being GuiApplication.
The children of the GuiMainWindow are easily identified as the following examples show:
Please note that the availability of some of these objects depends on the design mode used. The titlebar, for example, is not available in classic design, as can be seen in the following screenshot.
