Send comments on this topic.
Introduction
SAP GUI Scripting API
Purpose
Ever since the release of SAP system version 4.6C, there has been only very limited support for emulating user
interaction with a SAP system. Existing technologies, such as ITOLE or Guilib, connect to the SAP system at the
protocol level and have never been able to emulate the behavior of the compound controls introduced with 4.6C.
For this reason, applications relying on emulating user input worked only on the decreasing number of transactions
using only standard dynpro elements.
Examples of affected applications are:
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 such as Guilib. 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.
Available uses for the scripting component include
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.
GuiApplication represents the process in which the SAP system activity takes place. Because of this there should
always be only one GuiApplication object within a process. The children of GuiApplication are all the connections of
class GuiConnection to the SAP systems available for scripting.
Connections are opened manually from the SAPLogon dialog or using the openConnection and
openConnectionByConnectionString methods of GuiApplication from a script. As soon as a connection has been
established a first session is created as a child of the connection. Up to 5 additional sessions can be created. Again,
this can be done manually using the 'Create Session' menu item or toolbar button, or from a script using the
CreateSession method of GuiSession.
While GuiApplication represents the overall SAP GUI application, a GuiSession represents a specific task being
performed. For any given session there is exactly one transaction currently executed, and most tasks performed in
SAP GUI can be performed within the context of one GuiSession.
These considerations determine the event model of the scripting component. A user's interactions are best recorded
or logged in the context of one session, therefore the GuiSession exposes an outgoing interface that allows an
application to listen to the user interaction.
Send comments on this topic.
Introduction
SAP GUI Scripting API
Purpose
Ever since the release of SAP system version 4.6C, there has been only very limited support for emulating user
interaction with a SAP system. Existing technologies, such as ITOLE or Guilib, connect to the SAP system at the
protocol level and have never been able to emulate the behavior of the compound controls introduced with 4.6C.
For this reason, applications relying on emulating user input worked only on the decreasing number of transactions
using only standard dynpro elements.
Examples of affected applications are:
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 such as Guilib. 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.
Available uses for the scripting component include
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.
GuiApplication represents the process in which the SAP system activity takes place. Because of this there should
always be only one GuiApplication object within a process. The children of GuiApplication are all the connections of
class GuiConnection to the SAP systems available for scripting.
Connections are opened manually from the SAPLogon dialog or using the openConnection and
openConnectionByConnectionString methods of GuiApplication from a script. As soon as a connection has been
established a first session is created as a child of the connection. Up to 5 additional sessions can be created. Again,
this can be done manually using the 'Create Session' menu item or toolbar button, or from a script using the
CreateSession method of GuiSession.
While GuiApplication represents the overall SAP GUI application, a GuiSession represents a specific task being
performed. For any given session there is exactly one transaction currently executed, and most tasks performed in
SAP GUI can be performed within the context of one GuiSession.
These considerations determine the event model of the scripting component. A user's interactions are best recorded
or logged in the context of one session, therefore the GuiSession exposes an outgoing interface that allows an
application to listen to the user interaction.
评论1
最新资源