Docsity
Docsity

Prepare-se para as provas
Prepare-se para as provas

Estude fácil! Tem muito documento disponível na Docsity


Ganhe pontos para baixar
Ganhe pontos para baixar

Ganhe pontos ajudando outros esrudantes ou compre um plano Premium


Guias e Dicas
Guias e Dicas


SAP SCRIPT DOCUMENT - AUTOMATIZAÇÃO, Resumos de Matemática

CONTEUDO - DOCUMENTAÇÃO DO SAP SCRIPT PARA AUTOMATIZAÇÃO EXCEL

Tipologia: Resumos

2020

Compartilhado em 06/01/2023

AdelioJunior
AdelioJunior 🇧🇷

1 documento

1 / 302

Toggle sidebar

Esta página não é visível na pré-visualização

Não perca as partes importantes!

bg1
DEVELOPER GUIDE | PUBLIC
Document Version: 7.60 PL1 – 2019-03-28
SAP GUI Scripting API
© 2019 SAP SE or an SAP affiliate company. All rights reserved.
THE BEST RUN
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Pré-visualização parcial do texto

Baixe SAP SCRIPT DOCUMENT - AUTOMATIZAÇÃO e outras Resumos em PDF para Matemática, somente na Docsity!

DEVELOPER GUIDE | PUBLIC

Document Version: 7.60 PL1 – 2019-03-

SAP GUI Scripting API

©^ 2019 SAP SE or an SAP

affiliate

company. All rights reserved.

THE BEST RUN

Content

2 P U B L I C

SAP GUI Scripting API

4 P U B L I C SAP GUI Scripting API

  • 1 SAP GUI Scripting API.
  • 1.1 Requirements and Remarks.
  • 1.2 Objects.
    • GuiAbapEditor Object.
    • GuiApoGrid Object.
    • GuiApplication Object
    • GuiBarChart Object
    • GuiBox Object.
    • GuiButton Object.
    • GuiCalendar Object
    • GuiChart Object.
    • GuiCheckBox Object.
    • GuiCollection Collection.
    • GuiColorSelector Object.
    • GuiComboBox Object
    • GuiComboBoxControl Object.
    • GuiComboBoxEntry Object.
    • GuiComponent Object.
    • GuiComponentCollection Collection.
    • GuiConnection Object.
    • GuiContainer Object
    • GuiContainerShell Object.
    • GuiContextMenu Object.
    • GuiCTextField Object.
    • GuiCustomControl Object
    • GuiDialogShell Object.
    • GuiEAIViewer2D Object.
    • GuiEAIViewer3D Object.
    • GuiEnum Object.
    • GuiFrameWindow Object.
    • GuiGOSShell Object.
    • GuiGraphAdapt Object.
    • GuiGridView Object.
    • GuiHTMLViewer Object.
    • GuiInputFieldControl Object.
    • GuiLabel Object.
    • GuiMainWindow Object.
    • GuiMap Object.
    • GuiMenu Object.
    • GuiMenubar Object.
    • GuiMessageWindow.
    • GuiModalWindow Object.
    • GuiNetChart Object.
    • GuiOfficeIntegration Object.
    • GuiOkCodeField Object.
    • GuiPasswordField Object.
    • GuiPicture Object.
    • GuiRadioButton Object.
    • GuiSapChart Object.
    • GuiScrollbar Object.
    • GuiScrollContainer Object.
    • GuiSession Object.
    • GuiSessionInfo Object.
    • GuiShell Object.
    • GuiSimpleContainer Object.
    • GuiSplit Object.
    • GuiSplitterContainer Object
    • GuiStage Object.
    • GuiStatusbar Object.
    • GuiStatusPane Object.
    • GuiTab Object.
    • GuiTableColumn Collection.
    • GuiTableControl Object.
    • GuiTableRow Collection.
    • GuiTabStrip Object.
    • GuiTextedit Object.
    • GuiTextField.
    • GuiTitlebar Object
    • GuiToolbar Object.
    • GuiToolbarControl.
    • GuiTree Object.
    • GuiUserArea Object.
    • GuiUtils Object
    • GuiVComponent Object.
    • GuiVContainer Object
    • GuiVHViewSwitch Object.
  • 1.3 Events.
  • Content P U B L I C SAP GUI Scripting API
    • Change Event - Additional Remarks.
  • 1.4 Enumerations.
    • GuiComponentType.
    • GuiErrorType.
    • GuiEventType.
    • GuiImageType.
    • GuiMagicDispIDs.
    • GuiMessageBoxOption.
    • GuiMessageBoxResult.
    • GuiMessageBoxType.
    • GuiScrollbarType.
    • GuiTableSelectionType.
  • 2 SAP GUI Scripting ROT Entry Helper.
  • 2.1 SapGuiAuto Object.
  • 3 SAP GUI Scripting ROT Access Helper.
  • 3.1 CSapROTWrapper Object.

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 P U B L I C 5

1.1 Requirements and Remarks

SAP System

Scripting support is available for SAP R/3 3.1I, 4.0B, 4.5B, 4.6B, 4.6C, 4.6D, and for all products based on later

versions of SAP_BASIS.

For the releases 3.1I to 6.10 ABAP support packages and SAP kernel patches are available to add the support,

while they are already part of 6.20 and later releases. SAP Note 480149 lists the required patch levels.

SAP GUI Scripting API SAP GUI Scripting API P U B L I C 7

SAP GUI

The scripting interface can be installed with the SAP GUI release 6.20 and later releases. This document is

based on SAP GUI for Windows 7.60. Some of the functionality described here may be missing from older

versions of SAP GUI.

Remarks

SAP Notes on SAP GUI Scripting

480149 Describes the ABAP and kernel patch level requirements

587202 Limitations of SAP GUI Scripting

619459 SAP GUI Scripting support of SAP applications

692245 Additional server based security options for Scripting

839115 Load test with SAP GUI scripting

983990 SAP GUI Scripting security: Enable Scripting per system user

1441550 SAP GUI scripting: Sample applications

SAP Support Component for SAP GUI Scripting

● BC-FES-GUI

1.2 Objects

Classes

Class Module Description

GuiAbapEditor Object [page 16 ] (^) The GuiAbapEditor object represents the new ABAP editor

control available as of SAP_BASIS release 6.20 (see also SAP Note 930742). GuiAbapEditor extends GuiShell.

GuiApoGrid Object [page 29 ] (^) The GuiApoGrid object is component, which is similar to Gui

GridView, but which contains additional SCM specific func tions (used for example in transaction /sapapo/sdp94). GuiApoGrid extends GuiShell.

8 P U B L I C

SAP GUI Scripting API SAP GUI Scripting API

Class Module Description

GuiComboBoxControl Object [page 75 ] GuiComboboxControl offers a combo box that can be used inside control containers (unlike the Dynpro element repre sented by GuiComboBox). GuiComboBoxControl extends GuiShell.

GuiComboBoxEntry Object [page 78 ] Members of the Entries collection of a GuiComboBox are of type GuiComBoxEntry.

GuiComponent Object [page 78 ] GuiComponent is the base class for most classes in the Scripting API. It was designed to allow generic programming, meaning you can work with objects without knowing their ex act type.

GuiComponentCollection Collection [page 79 ] The GuiComponentCollection is used for collections ele

ments such as the children property of containers. Each

element of the collection is an extension of GuiComponent.

GuiConnection Object [page 81 ] A GuiConnection represents the connection between SAP GUI and an application server. Connections can be opened from SAPlogon or from GuiApplication’s openConnection and openConnectionByConnectionString methods. GuiCon nection extends GuiContainer. The type prefix for GuiCon nection is con, the name is con plus the connection number in square brackets.

GuiContainer Object [page 83 ] This interface resembles GuiVContainer. The only difference is that it is not intended for visual objects but rather adminis trative objects such as connections or sessions. Objects ex posing this interface will therefore support GuiComponent but not GuiVComponent. GuiContainer extends GuiCompo nent.

GuiContainerShell Object [page 84 ] A GuiContainerShell is a wrapper for a set of GuiShell ob jects. GuiContainerShell extends GuiVContainer. The type prefix is shellcont, the name is the last part of the id, shell cont[n].

GuiContextMenu Object [page 87 ] A GuiContextMenu may have other GuiContextMenu objects as children. GuiContextMenu extends GuiMenu. The type is mnu, the name is the function code that is sent to the sys tem when the menu item is selected.

GuiCTextField Object [page 88 ] If the cursor is set into a text field of type GuiCTextField a combo box button is displayed to the right of the text field. Pressing this button is equivalent to pressing the F4 key. The button is not represented in the scripting object model as a separate object; it is considered to be part of the text field. There are no other differences between GuiTextField and GuiCTextField. GuiCTextField extends GuiTextField. The type prefix is ctxt, the name is the Fieldname taken from the SAP data dictionary.

10 P U B L I C

SAP GUI Scripting API SAP GUI Scripting API

Class Module Description

GuiCustomControl Object [page 91 ] The GuiCustomControl is a wrapper object that is used to place ActiveX controls onto dynpro screens. While GuiCus tomControl is a dynpro element itself, its children are of Gui ContainerShell type, which is a container for controls. Gui CustomControl extends GuiVContainer. The type prefix is cntl, the name is the fieldname taken from the SAP data dic tionary.

GuiDialogShell Object [page 93 ] The GuiDialogShell is an external window that is used as a container for other shells, for example a toolbar. GuiDialog Shell extends GuiVContainer. The type prefix is shellcont, the name is the last part of the id, shellcont[n].

GuiEAIViewer2D Object [page 96 ] (^) The GuiEAIViewer2D control is used to view 2-dimensional

graphic images in the SAP system. The user can carry out redlining over the loaded image. The scripting wrapper for this control records all user actions during the redlining process and reproduces the same actions when the re corded script is replayed.

GuiEAIViewer2D extends GuiShell.

GuiEAIViewer3D Object [page 98 ] (^) The GuiEAIViewer3D control is used to view 3-dimensional

graphic images in the SAP system. GuiEAIViewer3D extends GuiShell.

GuiEnum Object [page 101 ] (^) GuiEnum is the base class for some enumerators used in

SAP GUI Scripting.

GuiFrameWindow Object [page 101 ] A GuiFrameWindow is a high level visual object in the run time hierarchy. It can be either the main window or a modal popup window. See the GuiMainWindow and GuiModal Window sections for examples. GuiFrameWindow itself is an abstract interface. GuiFrameWindow extends GuiVContainer. The type prefix is wnd, the name is wnd plus the window number in square brackets.

GuiGOSShell Object [page 108 ] The GuiGosShell is only available in New Visual Design mode. GuiGOSShell extends GuiVContainer. The type prefix is shellcont, the name is the last part of the id, shellcont[n].

GuiGraphAdapt Object [page 110 ] For the graphic adapter control only basic members from GuiShell are available. Recording and playback is not possi ble.

GuiGridView Object [page 113 ] The grid view is similar to the dynpro table control, but sig nificantly more powerful. GuiGridView extends GuiShell.

GuiHTMLViewer Object [page 128 ]

The GuiHTMLViewer is used to display an HTML document inside SAP GUI. GuiHTMLViewer extends GuiShell.

SAP GUI Scripting API SAP GUI Scripting API P U B L I C 11

Class Module Description

GuiPasswordField Object [page 166 ] The only difference between GuiTextField and GuiPassword Field is that the Text property cannot be read for a password field. The returned text is always empty. GuiPasswordField extends GuiTextField. The type prefix is pwd, the name is the fieldname taken from the SAP data dictionary.

GuiPicture Object [page 169 ] (^) The picture control displays a picture on an SAP GUI screen.

GuiPicture extends GuiShell.

GuiRadioButton Object [page 173 ] GuiRadioButton extends GuiVComponent. The type prefix is rad, the name is the fieldname taken from the SAP data dic tionary.

GuiSapChart Object [page 177 ] For the SAP chart control only basic members from GuiShell are available. Recording and playback is not possible.

GuiScrollbar Object [page 179 ] The GuiScrollbar class is a utility class used for example in GuiScrollContainer or GuiTableControl.

GuiScrollContainer Object [page 179 ] This container represents scrollable subscreens. A sub screen may be scrollable without actually having a scrollbar, because the existence of a scrollbar depends on the amount of data displayed and the size of the GuiUserArea. GuiScroll Container extends GuiVContainer. The type prefix is ssub, the name is generated from the data dictionary settings.

GuiSession Object [page 181 ] (^) The GuiSession provides the context in which a user per

forms a certain task such as working with a transaction. It is therefore the access point for applications, which record a user’s actions regarding a specific task or play back those actions. GuiSession extends GuiContainer. The type prefix is ses, the name is ses plus the session number in square brackets.

GuiSessionInfo Object [page 192 ] GuiSessionInfo is a member of all GuiSession objects. It makes available technical information about the session. Some of its properties are displayed in the right corner of the SAP GUI status line.

GuiShell Object [page 195 ] GuiShell is an abstract object whose interface is supported by all the controls. GuiShell extends GuiVContainer. The type prefix is shell, the name is the last part of the id, shell[n].

GuiSimpleContainer Object [page 198 ] This container represents non-scrollable subscreens. It does not have any functionality apart from to the inherited interfa ces. GuiSimpleContainer extends GuiVContainer. The type prefix is sub, the name is generated from the data dictionary settings.

GuiSplit Object [page 201 ] GuiSplit extends GuiShell.

GuiSplitterContainer Object [page 204 ] The GuiSplitterContainer represents the dynpro splitter ele ment, which was introduced in the Web Application Server ABAP in NetWeaver 7.1. The dynpro splitter element is simi lar to the activeX based splitter control, but it is a plain dyn pro element.

SAP GUI Scripting API SAP GUI Scripting API P U B L I C 13

Class Module Description

GuiStage Object [page 206 ] For the stage control only basic members from GuiShell are available. Recording and playback is not possible.

GuiStatusbar Object [page 209 ] GuiStatusbar represents the message displaying part of the status bar on the bottom of the SAP GUI window. It does not include the system and login information displayed in the rightmost area of the status bar as these are available from the GuiSessionInfo object. GuiStatusbar extends GuiVCom ponent. The type prefix is sbar.

GuiStatusPane Object [page 212 ] (^) The parent of the GuiStatusPane objects is the status bar

(see also GuiStatusbar Object). The GuiStatusPane objects reflect the individual areas of the status bar, for example "pane[0]" refers to the section of the status bar where the messages are displayed.

GuiTab Object [page 213 ] The GuiTab objects are the children of a GuiTabStrip object. GuiTab extends GuiVContainer. The type prefix is tabp, the name is the id of the tab’s button taken from SAP data dic tionary.

GuiTableColumn Collection [page 215 ] GuiTableColumn represents a column in a table control. Gui TableColumn extends GuiComponentCollection.

GuiTableControl Object [page 217 ] The table control is a standard dynpro element, in contrast to the GuiCtrlGridView, which looks similar. GuiTableControl extends GuiVContainer. The type prefix is tbl, the name is the fieldname taken from the SAP data dictionary.

GuiTableRow Collection [page 221 ] GuiTableRow represents a row in a table control. GuiTa bleRow extends GuiComponentCollection.

GuiTabStrip Object [page 223 ] A tab strip is a container whose children are of type GuiTab. GuiTabStrip extends GuiVContainer. The type prefix is tabs, the name is the fieldname taken from the SAP data diction ary.

GuiTextedit Object [page 226 ] GuiTextField extends GuiVComponent. The type prefix is txt, the name is the fieldname taken from the SAP data diction ary.

GuiTextField [page 231 ] GuiTextField extends GuiVComponent. The type prefix is txt, the name is the fieldname taken from the SAP data diction ary.

GuiTitlebar Object [page 235 ] The titlebar is only displayed and exposed as a separate ob ject in New Visual Design mode. GuiTitlebar extends GuiV Container. The type prefix and name of GuiTitlebar are titl.

14 P U B L I C

SAP GUI Scripting API SAP GUI Scripting API

1.2.1 GuiAbapEditor Object

The GuiAbapEditor object represents the new ABAP editor control available as of SAP_BASIS release 6.20 (see

also SAP Note 930742). GuiAbapEditor extends GuiShell.

Methods

Method

Syntax Description

All methods of the GuiVComponent Object [page 262 ]:

● DumpState ● SetFocus ● Visualize

All methods of the GuiContainer Object [page 83 ]:

● FindById

All methods of the GuiVContainer Object [page 267 ]:

● FindAllByName ● FindAllByNameEx ● FindByName ● FindByNameEx

All methods of the GuiShell Object [page 195 ]:

● SelectContextMenuItem ● SelectContextMenuItemByPosition ● SelectContextMenuItemByText

AutoBraceEnabled

Public Function AutoBraceEnabled() As

Byte

Returns True if the auto brace facility is currently switched on.

AutoComplete

Public Sub AutoComplete()

Invokes the auto complete list box.

AutoCorrectEnabled

Public Function AutoCorrectEnabled()

As Byte

Returns True if the auto correct facility is currently switched on.

16 P U B L I C

SAP GUI Scripting API SAP GUI Scripting API

Method

Syntax Description

AutoExpand

Public Sub AutoExpand()

Invokes the auto expand code template mechanism.

AutoIndentEnabled

Public Function AutoIndentEnabled()

As Byte

Returns True if the auto indent facility is currently switched on.

Capitalize

Public Sub Capitalize()

Makes the first alphabetic character of each word in the se lected text uppercase. All other characters are made lower case.

ClipboardCopy

Public Sub ClipboardCopy()

Performs a clipboard copy operation on the currently se lected text.

ClipboardCut

Public Sub ClipboardCut()

Performs a clipboard cut operation on the currently selected text.

ClipboardPaste

Public Sub ClipboardPaste()

Pastes the current contents of the clipboard beginning from the current cursor position.

ClipboardRingPaste

Public Sub ClipboardRingPaste( _

ByVal Index As Long _

Pastes an entry from the editor's clipboard ring to the editor. Index : One-based index of the clipboard entry as it appears in the ABAP editor context menu.

CodeHintsEnabled

Public Function CodeHintsEnabled() As

Byte

Returns True if code hints are currently enabled.

CommentSelectedLines

Public Sub CommentSelectedLines()

Encloses the selected lines in comments.

CorrectCapsEnabled

Public Function CorrectCapsEnabled()

As Byte

Returns True if the correct caps function is currently switched on.

Delete

Public Sub Delete()

Deletes the character, which proceeds the current cursor position. Equivalent to pressing the key.

SAP GUI Scripting API SAP GUI Scripting API P U B L I C 17

Method

Syntax Description

GetAutoCompleteIconType

Public Function

GetAutoCompleteIconType( _

ByVal Index As Long _

) As String

Returns the index of the image associated with the auto complete entry specified in Index. Returns -1 if no image is associated.

GetAutoCompleteSubIconType

Public Function

GetAutoCompleteSubIconType( _

ByVal Index As Long _

) As String

Returns the index of the sub image associated with the auto complete entry specified in Index. Returns -1 if no sub image is associated.

GetAutoCompleteToolbarButtonToolTip

Public Function

GetAutoCompleteToolbarButtonToolTip( _

ByVal Index As Long _

) As String

Returns the tooltip text, which is displayed by the autocom plete toolbar button specified in Index.

GetAutoCompleteToolTipDelay

Public Function

GetAutoCompleteToolTipDelay() As Long

Returns the number of milliseconds, which elapse between highlighting an entry in the autocomplete listbox and the ap pearance of the corresponding tooltip window.

GetCurrentToolTipText

Public Function

GetCurrentToolTipText() As String

Retrieves the text in the currently displayed code hint or au tocomplete listbox tooltip window. Multiple lines are sepa rated with \n characters.

GetCursorColumnPosition

Public Function

GetCursorColumnPosition() As Long

Returns the column number in which the cursor currently re sides.

GetCursorLinePosition

Public Function

GetCursorLinePosition() As Long

Returns the number of the line upon which the cursor cur rently resides.

GetFirstVisibleLine

Public Function GetFirstVisibleLine()

As Long

Returns the line number of the top-most visible line in the current editor session.

GetHTMLClipboardContents

Public Function

GetHTMLClipboardContents() As String

Returns a string containing the current contents of the clip board in HTML format. Returns an empty string if the clip board does not contain anything in HTML format.

SAP GUI Scripting API SAP GUI Scripting API P U B L I C 19

Method

Syntax Description

GetLastVisibleLine

Public Function GetLastVisibleLine()

As Long

Returns the line number of the bottom-most visible line in the current editor session.

GetLineCount

Public Function GetLineCount() As Long

Returns the total number of lines contained in the document in the current session.

GetLineText

Public Function GetLineText( _

ByVal Line As Long _

) As String

Returns a string containing the contents of the line number specified as a parameter.

GetNumberedBookmarks

Public Function

GetNumberedBookmarks( _

ByVal Line As Long _

) As Object

Returns a collection of bookmark numbers assigned to the line number passed as a parameter. The number of the bookmark can range from 0 to 9. If no numbered bookmark is assigned then the collection is empty.

GetRTFClipboardContents

Public Function

GetRTFClipboardContents() As String

Returns a string containing the current contents of the clip board in Rich Text format. Returns an empty string if the clip board does not contain anything in Rich Text format.

GetSelectedAutoComplete

Public Function

GetSelectedAutoComplete() As Long

Returns the zero based index of the currently selected entry in the auto completion list box. The method will return -1 if no entry is selected.

GetSelectedText

Public Function GetSelectedText() As

String

Returns a string containing the text currently highlighted or selected in the editor session. If the selected text spans more than one line then any line terminator characters will be included in the string returned by this method.

GetStructureBlockEndLine

Public Function

GetStructureBlockEndLine( _

ByVal Line As Long _

) As Long

Returns the end line of the structure block relevant to the line number passed to the method. If the line does not reside within a structure block at all then the method returns -1.

GetStructureBlockStartLine

Public Function

GetStructureBlockStartLine( _

ByVal Line As Long _

) As Long

Returns the start line of the structure block relevant to the line number passed to the method. If the line resides within a nested block then the start line of the innermost block will be returned. If the line does not reside within a structure block at all then the method returns -1.

20 P U B L I C

SAP GUI Scripting API SAP GUI Scripting API