1 SAP GUI Scripting API
Total Page:16
File Type:pdf, Size:1020Kb
DEVELOPER GUIDE | PUBLIC Document Version: 7.60 PL4 – 2019-11-25 SAP GUI Scripting API company. All rights reserved. All rights company. affiliate THE BEST RUN 2019 SAP SE or an SAP SE or an SAP SAP 2019 © Content 1 SAP GUI Scripting API........................................................ 5 1.1 Requirements and Remarks......................................................7 1.2 Objects....................................................................8 GuiAbapEditor Object.......................................................15 GuiApoGrid Object.........................................................29 GuiApplication Object ......................................................37 GuiBarChart Object ........................................................47 GuiBox Object............................................................51 GuiButton Object..........................................................53 GuiCalendar Object ........................................................55 GuiChart Object...........................................................61 GuiCheckBox Object.......................................................65 GuiCollection Collection.....................................................68 GuiColorSelector Object.....................................................69 GuiComboBox Object ...................................................... 72 GuiComboBoxControl Object.................................................75 GuiComboBoxEntry Object...................................................78 GuiComponent Object......................................................78 GuiComponentCollection Collection............................................79 GuiConnection Object...................................................... 81 GuiContainer Object .......................................................83 GuiContainerShell Object....................................................84 GuiCTextField Object.......................................................86 GuiCustomControl Object ...................................................89 GuiDialogShell Object.......................................................91 GuiEAIViewer2D Object.....................................................94 GuiEAIViewer3D Object.....................................................96 GuiEnum Object.......................................................... 99 GuiFrameWindow Object....................................................99 GuiGOSShell Object.......................................................106 GuiGraphAdapt Object.....................................................108 GuiGridView Object........................................................111 GuiHTMLViewer Object.....................................................126 GuiInputFieldControl Object.................................................130 GuiLabel Object..........................................................132 GuiMainWindow Object.....................................................139 SAP GUI Scripting API 2 PUBLIC Content GuiMap Object...........................................................145 GuiMenu Object..........................................................147 GuiMenubar Object....................................................... 149 GuiMessageWindow.......................................................151 GuiModalWindow Object....................................................153 GuiNetChart Object.......................................................156 GuiOfficeIntegration Object..................................................159 GuiOkCodeField Object.....................................................162 GuiPasswordField Object................................................... 164 GuiPicture Object.........................................................167 GuiRadioButton Object.....................................................171 GuiSapChart Object.......................................................175 GuiScrollbar Object........................................................177 GuiScrollContainer Object...................................................177 GuiSession Object........................................................ 179 GuiSessionInfo Object..................................................... 190 GuiShell Object.......................................................... 193 GuiSimpleContainer Object..................................................196 GuiSplit Object...........................................................198 GuiSplitterContainer Object .................................................201 GuiStage Object......................................................... 203 GuiStatusbar Object...................................................... 206 GuiStatusPane Object..................................................... 210 GuiTab Object............................................................211 GuiTableColumn Collection..................................................213 GuiTableControl Object.....................................................215 GuiTableRow Collection.................................................... 219 GuiTabStrip Object........................................................221 GuiTextedit Object........................................................224 GuiTextField............................................................ 229 GuiTitlebar Object ........................................................233 GuiToolbar Object........................................................ 235 GuiToolbarControl........................................................237 GuiTree Object...........................................................241 GuiUserArea Object.......................................................254 GuiUtils Object ..........................................................257 GuiVComponent Object....................................................259 GuiVContainer Object .....................................................264 GuiVHViewSwitch Object...................................................266 1.3 Events...................................................................269 Change Event - Additional Remarks............................................272 SAP GUI Scripting API Content PUBLIC 3 1.4 Enumerations..............................................................275 GuiComponentType.......................................................275 GuiErrorType............................................................276 GuiEventType........................................................... 278 GuiImageType...........................................................279 GuiMagicDispIDs.........................................................279 GuiMessageBoxOption.....................................................289 GuiMessageBoxResult.....................................................289 GuiMessageBoxType......................................................290 GuiScrollbarType.........................................................290 GuiTableSelectionType.....................................................291 2 SAP GUI Scripting ROT Entry Helper........................................... 292 2.1 SapGuiAuto Object..........................................................292 3 SAP GUI Scripting ROT Access Helper..........................................294 3.1 CSapROTWrapper Object.....................................................294 SAP GUI Scripting API 4 PUBLIC Content 1 SAP GUI Scripting API Purpose In SAP R/3 4.6C active elements ("controls") where 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. Examples of affected use cases 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. 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"). Available uses for the scripting component include SAP GUI Scripting API SAP GUI Scripting API PUBLIC 5 ● Listening to the actions a user performs in the SAP GUI and record them as a script ● Running a script that