Go to Robotic Automation version 22.1 documentation

SAP GUI controls

Pega Robotic Automation supports integration with the following SAP GUI controls. The specific properties, events, and methods for these controls are provided in the following tables.

 

Supported SAP controls

 

 

Menu Items

During interrogation, the Interrogation Form is the active window. The SAP GUI application hides some interface elements when it is not the active window. For example, the Main Menu bar at the top of the SAP GUI window becomes hidden. Use the following interrogation steps to interrogate these menu options.

To interrogate the menu items at the top of the SAP GUI application, perform the following steps:

  1. Right-click the main form, such as the SAP Front Session Form, in Object Explorer

  2. Select Add Menu Items. The Add Menu Items window  displays.

  3. Select the base menu items such as Menu, Edit, Favorites, Extras, System, and Help. Studio uses the Menu Item Path Match Rule to match SAP menu targets.

To add menu sub-items, perform the following steps:

  1. Click the menu items in the SAP GUI application.

  2.  Return to the Add Menu Items dialog and click Refresh. The sub-items for the menu options display.

SAP GUI controls and application focus

Other interface elements are hidden when the SAP GUI is not the active window. Here is an example:

Selection options

This icon displays for some active fields (data input fields that have focus). When you click this icon, a dialog displays a list of selection options for the current field. You cannot interrogate this icon directly since it only appears when the application is active (has focus). If you need to automate the action of clicking this icon to display the selection options for a field, use automation logic to perform the equivalent keystroke (F4). Consult the SAP GUI Help system for using keyboard methods to enter commands instead of using mouse clicks.

 

Base Control Properties, Events, and Methods

For the owner-drawn SAP targets, Studio creates a base control based on OpenSpan.Adapters.SAP.Controls. The properties, events, and methods for the base control are listed below.

Additional properties, events, and methods for the individual supported SAP control types listed above (SAP Supported Controls), are listed in the sections that follow.

Properties

Property

Description

Bottom

Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area.

BoundsRectangle

Gets the size and location of the control including its non-client elements, in pixels, relative to the parent control. Type: Rectangle

ClientRectangle

Gets the rectangle that represents the client area of the control. Type: Rectangle

Enabled

Gets or sets a value that indicates whether the control can respond to user interaction. (Boolean)

Focused

Gets a value (Boolean) indicating whether the control has input focus.

Location

Gets the location that represents the top left area of the control. Type: Point

NativeControlName

Gets the name assigned by the SAP application to the control. This property value is empty if the system cannot extract a name from SAP. This property is always empty if the SAP session connection is set to Low Speed Connection (Reduced Network Traffic). Object names are not transmitted in this mode.

ScreenRectangle

Gets the rectangle that represents the screen area of the control. Type: Rectangle

Size

Gets the size of the control. Type: Size

Text

Gets the text associated with this control. Type: String

VirtualClassName

Gets a string value representing the Virtual Class set by Studio for the target. The Virtual Class name begins with the text: "SAP_".

Visible

Gets a value that indicates whether the control is displayed. (Boolean)

Events

Event

Description

Click

Occurs when the control is clicked.

Clicking

Occurs when the control is in the process of clicking.

DoubleClick

Occurs when the control is double-clicked.

DoubleClicking

Occurs when the control is in the process of double clicking.

GotFocus

Occurs when the control receives focus.

KeyDown

Occurs when a key is pressed while the control has focus.

KeyPress

Occurs when a key is pressed while the control has focus.

KeyUp

Occurs when a key is released while the control has focus.

LostFocus

Occurs when the control loses focus.

MouseDown

Occurs when the mouse pointer is over the control and a mouse button is pressed.

MouseUp

Occurs when the mouse pointer is over the control and a mouse button is released.

RightClick

Occurs when the control is right-clicked.

RightClicking

Occurs when the control is being right-clicked.

VisibleChanged

Occurs when the visibility the control is changed.

Note: This event is not currently implemented.

Methods

Method

Description

Parameters

Return Type

Activate

Activates the control and gives it focus.

None

Void

Focus

Causes the element to receive the focus and executes the code specified by the GotFocus event.

None

Void

GetTextBuffer

Used to get a large text buffer from a control.

Int32 bufferSize

String

PerformClick

Simulates a click by causing the Click event to fire. The event is fired asynchronously.  

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

None

Void

PerformClick

Simulates a click by causing the Click event to fire. Click is performed at the x and y location specified by the parameters. The event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

Int32 x, Int32 y

Void

PerformDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. The event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

None

Void

PerformDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Click is performed at the x and y location specified by the parameters. The event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

Int32 x, Int32 y

Void

PerformRightClick

Simulates a right-click by causing the RightClick event to fire. The event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

None

Void

PerformRightClick

Simulates a right-click by causing the RightClick event to fire. RightClick is performed at the x and y location specified by the parameters. The event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

Int32 x, Int32 y

 

Void

 

ShowContextMenu

Displays a shortcut menu associated with the control by calling PerformRightClick() method.

None

Void

ShowContextMenu

Displays a shortcut menu associated with the control by calling PerformRightClick(x,y) method.

Int32 x, Int32 y

Void

 

TextBox

Properties

Property

Description

Text

Gets or sets the text contents of the text box. (String type)

TextLength

Gets the number of characters and spaces of the text string in the text box. (Int32)

MaxLength

Gets the maximum number of characters that can be manually entered into the text box. (Int32)

Enabled

Gets or sets a value that indicates whether this text box is enabled in the user interface. (Boolean)

ReadOnly

Gets or sets a value that indicates whether the text box is read-only to a user interacting with the control. (Boolean)

IsPassword

Not supported in Windows Presentation Foundation (WPF). Gets a value indicating that the characters entered in the text box are replaced with the (PasswordChar). (Boolean)

PasswordChar

Applies when the IsPassword value is True, this property returns the text substitute character which is always "*" for SAP.

Events

Event

Description

TextChanged

Occurs when the text in the text box are updated, edited, or deleted.

Copy

Occurs when the Copy command is used to copy text from the text box.

Cut

Occurs when the Cut command is used to remove text from the text box.

Paste

Occurs when the Paste command is used to copy text from the Windows clipboard to the text box.

Methods

Method

Description

Parameters

Return Type

AppendText

Adds the text specified in the text parameter to the text box.

String text

Void

Clear

Removes the contents of the text box.

None

Void

 

CheckBox

Properties

Property

Description

Checked

Gets or set a value that indicates whether the control is in the checked state. (Boolean type)

CheckState

Gets or sets the state of the check box. (Boolean)

AutoCheck

Gets a value that indicates whether the Checked or CheckState values and the check box's appearance are automatically changed when the check box is clicked. This value is always True. (Boolean).

ThreeState

Gets a value that indicates whether the check box will allow three check states rather than two. This value is always False. (Boolean)

Events

Events

Description

CheckedChanged

Occurs when the value of the Checked property changes.

CheckStateChanged

Occurs when the value of the CheckState property changes.

 

ComboBox

Properties

Property

Description

ControlEnabled

Gets or sets a value that indicates whether the control can respond to user interaction. (Boolean)

Count

Gets the count. (int)

Items

Gets a string collection representing the collection of the items contained in the ComboBox.

SelectedIndex

Gets or sets the index specifying the currently selected item. (Int32)

Events

Events

Description

SelectedIndexChanged

Occurs when the SelectedIndex property has changed.

 

Button

Methods

Method

Description

Parameters

Return Type

PerformClick

Clicks the control.

None

Void

PerformClickXY

Clicks the control at the position defined by the x and y point parameters.

Int32 x, Int32 y

Void

 

ToolbarButton

Properties

Property

Description

ControlEnabled

Gets a value that indicates whether the ToolBarButton is enabled. (Boolean)

ControlFocused

Gets a value that indicates whether the ToolBarButton is focused. Note that for SAP, this value is always False. (Boolean)

Events

Event

Description

Click

Occurs when the ToolBarButton is clicked.

Clicking

Occurs when the ToolBarButton is in the process of clicking.

MouseDown

Occurs when the mouse button is pressed down on the ToolBarButton control.

MouseUp

Occurs when the mouse button is released from the ToolBarButton control.

Methods

Method

Description

Parameters

Return Type

PerformClick

Raises the Click event for the ToolBarButton.

None

Void

PerformClickXY

Raises the Click event for the ToolBarButton at the position defined by the x and y point parameters.

Int32 x, Int32 y

Void

 

RadioButton

Properties

Property

Description

AutoCheck

Gets a value that indicates whether the Checked value and the appearance of the control automatically change when the control is clicked. For SAP radio buttons, this value is always True. (Boolean)

Checked

Gets or sets a value that indicates whether the radio buttons is checked. (Boolean)

CheckState

Gets or sets the state of the RadioButton. Set to True to select the radio buttons.

ThreeState

Gets a value that indicates whether the radio buttons will allow three check states rather than two. For SAP radio buttons, this property is always False. (Boolean)

Events

Property

Description

CheckedChanged

Occurs when the value of the Checked property changes.

CheckStateChanged

Occurs when the value of the CheckState property changes.

 

TabStrip

Properties

Property

Description

Tabs

Gets a collection of the Tab objects. (String[] type)

SelectedIndex

Gets the index value of the selected tab, or sets the selected tab to the one identified by the index value.

Events

Event

Description

SelectedIndexChanged

Occurs when the selected tab changes.

 

GridView (SAP_Table) and GridView (ActiveX) (SAP_AxGridView)

The SAP client application presents data in grid format using a table and ActiveX grid. When interrogated, Studio creates either the SAP_Table for the standard table target and SAP_AxGridView for the ActiveX grid target. These controls have the following properties, methods, and events:

Properties

Property

Description

ColumnCount

Gets the number of columns currently in the grid. (Int32 type)

ColumnHeaders

Gets a list containing the column headers of the grid. The ListLoop component can be used to iterate through the ColumnHeaders output.

DataTable

Gets a DataTable containing the rows and columns of the grid. The DateGrid control can be used to send the data from the SAP grid to a Windows form (connect the DataTable output to the DataSource property of the DataGrid component.

RowCount

Gets the number of rows currently in the grid. (Int32 type)

ScrollMaximumVertical

 Sets the minimum value for vertical scrolling. (zero based)

ScrollMinimumVertical

Sets the maximum value for vertical scrolling. (zero based)

ScrollPositionVertical

Gets or sets the current scroll position or line number. (zero based)

SelectedColumn

Gets the index of the selected column (the first column is index 0). (Int32 type)

SelectedRow

Gets the index of the selected row (the first row is index 0). (Int32 type)

Events

Event

Description

GridCellClicked

Occurs when a user clicks on cell or the PerformClick method is called for the cell.

GridCellDoubleClicked

Occurs when a user double-clicks on cell or the PerformClick method is called for the cell.

GridCellSelected

Occurs when a user selects a cell via  mouse-click or keyboard command. For the SAP_AxGridView control, this event is raised after a delay.

Methods

Note: For the methods that require an expression input, use the expression formats defined for the DataTable.Select method or DataColumn.Expression. See the Microsoft MSDN topics DataTable.Select Method (String) and DataColumn.Expression Property for more information.

For instance, in the FindRow(expression) method, the format for the expression is: [Column Name]='value'. For example, to search for the value "Monica" in the column "FirstName", the expression would be: [FirstName]='Monica'.

Method

Description

Parameters

Return Type

ClickCell

Raises the double-click event on the cell specified by the row and column index values.

Note: In cases where the grid has been programmed to not accept clicking on cells, you will receive an error when calling this method.

Int32 row, Int32 column

Void

ClickCell

Raises the double-click event on the cell specified by the row index value and column name.

Note: In cases where the grid has been programmed to not accept clicking on cells, you will receive an error when calling this method.

Int32 row, String columnName

Void

ClickCell

Raises the double-click event on the cell specified by the column index and cell value which satisfies the expression.

If more than one cell matches the expression, Studio raises the click event on the cell for the first matching occurrence.

Note: In cases where the grid has been programmed to not accept clicking on cells, you will receive an error when calling this method.

String expression, Int32 column

Void

ClickCell

Raises the double-click event on the cell specified by the column name and cell value which satisfies the expression.

If more than one cell matches the expression, Studio raises the click event on the cell for the first matching occurrence.

Note: In cases where the grid has been programmed to not accept clicking on cells, you will receive an error when calling this method.

String expression, String columnName

Void

DoubleClickCell!

Raises the double-click event on the cell specified by the row and column index values.

Int32 row, Int32 column

Void

DoubleClickCell

Raises the double-click event on the cell specified by the row index value and column name.

Int32 row, String columnName

Void

DoubleClickCell

Raises the double-click event on the cell specified by the column index and cell value which satisfies the expression.

If more than one cell matches the expression, Studio raises the double-click event on the cell for the first matching occurrence.

String expression, Int32 column

Void

DoubleClickCell

Raises the double-click event on the cell specified by the column name and cell value which satisfies the expression.

If more than one cell matches the expression, Studio raises the double-click event on the cell for the first matching occurrence.

String expression, String columnName

Void

EnsureVisible

Not implemented for the SAP_Table.

Use this method to scroll through the grid until the cell identified by the row and column index values is visible.

Int32 row, Int32 column

Boolean

EnsureVisible

Not implemented for the SAP_Table.

Use this method to scroll through the grid until the cell identified by the row index and column name is visible.

Int32 row, String columnName

Boolean

EnsureVisible

Not implemented for the SAP_Table.

Use this method to scroll through the grid until the cell identified by the column index and cell value which satisfies the expression is visible. If more than one cell matches the expression, Studio scrolls to the cell for the first matching occurrence.

String expression, Int32 column

Boolean

EnsureVisible

Not implemented for the SAP_Table.

Use this method to scroll through the grid until the cell identified by the column name and cell value which satisfies the expression is visible. If more than one cell matches the expression, Studio scrolls to the cell for the first matching occurrence.

String expression, String columnName

Boolean

FindRow

Searches the grid for the column and value specified by the expression and returns the index of the first row where a match is found.

String expression

Int32

FindRow

Searches the column specified by the column index parameter for the value specified by the string value parameter and returns the index of the first row where a match is found.

Int32 column, String value

Int32

FindRow

Searches the column specified by the column name parameter for the value specified by the string value parameter and returns the index of the first row where a match is found.

String columnName, String value

Int32

FindRows

Returns a list of row indexes that match the given expression which defines the column and value. For example, the expression: [Author] LIKE 'A*' returns the indices for all rows in the Author column that start with the letter A.

String expression

Int32[]

GetCellValue

Returns the value of cell identified by the row index and column index parameters.

Note: For the SAP_Table, this method only applies to the following cell types: TextField, ComboBox, and CheckBox.

Int32 row, Int32 column

String

GetCellValue

Returns the value of cell identified by the row index and column name parameters.

Note: For the SAP_Table, this method only applies to the following cell types: TextField, ComboBox, and CheckBox.

Int32 row, String columnName

String

GetCellValue

Searches the column (designated by the column index parameters) for cell matching the input expression parameter and then returns the value of the cell. Note that if more than one cell matches the expression, Studio returns the value of the cell for the first matching occurrence.

Note: For the SAP_Table, this method only applies to the following cell types: TextField, ComboBox, and CheckBox.

String expression, Int32 column

String

GetCellValue

Searches the column (designated by the column name parameters) for cell matching the input expression parameter and then returns the value of the cell. Note that if more than one cell matches the expression, Studio returns the value of the cell for the first matching occurrence.

Note: For the SAP_Table, this method only applies to the following cell types: TextField, ComboBox, and CheckBox.

String expression, String columnName

String

ScrollDown

Scrolls the view down a given number of lines.

nLines

Void

ScrollUp

Scrolls the view up a given number of lines.

nLines

Void

SelectCell

Not implemented for the SAP_AxGridView.

Focuses the control located at the specified row and column

Int32 row, Int32 column

Void

SelectCell

Not implemented for the SAP_AxGridView.

Focuses the control located at the specified row and column

Int32 row, String columnName

Void

SelectCell

Not implemented for the SAP_AxGridView.

Focuses the cell in the first row that matches the given expression and column index.

String expression, Int32 column

Void

SelectCell

Not implemented for the SAP_AxGridView.

Focuses the cell in the first row that matches the given expression and column name.

String expression, String columnName

Void

SelectColumn

Focuses (or removes focus) for the column identified by the column index parameter. To focus the column, set the focus parameter to True. To remove focus from the column, set the focus parameter to False.

Note: The system does not convert a text string of True or False as input for the Boolean value parameter.  

Int32 column, Boolean value

Void

SelectColumn

Focuses (or removes focus) for the column identified by the column name parameter. To focus the column, set the focus parameter to True. To remove focus from the column, set the focus parameter to False.

Note: The system does not convert a text string o True or False as input for the Boolean value parameter.

String columnName, Boolean value

Void

SelectRow

Focuses or removes focus for the row identified by the row index parameter. To focus the row, set the focus parameter to True. To remove focus from the row, set the focus parameter to False.

Note: The system does not convert a text string o True or False as input for the Boolean value parameter.

Int32 row, Boolean value

Void

SelectRow

Focuses (or removes focus) for the row identified by the expression parameter. To focus the row, set the focus parameter to True. To remove focus from the row, set the focus parameter to False.

Note: The system does not convert a text string of True or False as input for the Boolean value parameter.

String expression, Boolean value

Void

SetCellValue

Sets the value of cell, identified by the row index and column index, to the string value.

Note: For the SAP_AxGridView, calling this method may change the style of the cell. For the SAP_Table, this method only applies to the following cell types: TextField, ComboBox, and CheckBox.

Int32 row, Int32 column, String value

Void

SetCellValue

Sets the value of cell, identified by the row index and column name, to the string value.

Note: For the SAP_AxGridView, calling this method may change the style of the cell. For the SAP_Table, this method only applies to the following cell types: TextField, ComboBox, and CheckBox.

Int32 row, String columnName, String value

Void

SetCellValue

Set the value of cell in the first row that matches the given expression and column index.

Note: For the SAP_AxGridView, calling this method may change the style of the cell. For the SAP_Table, this method only applies to the following cell types: TextField, ComboBox, and CheckBox.

String expression, Int32 column, String value

Void

SetCellValue

Set the value of cell in the first row that matches the given expression and column name.

Note: For the SAP_AxGridView, calling this method may change the style of the cell. For the SAP_Table, this method only applies to the following cell types: TextField, ComboBox, and CheckBox.

String expression, String columnName, String value

Void

 

TreeView (ActiveX)

The SAP Advanced Treelist (SAPTreeList) target when interrogated in Studio creates the SAP_AxTreeView control. The control has these properties, methods, and events:

Properties

Property

Description

Count

Applies to the TreeView and TreeViewNode (treeNodeProxy) controls.

Gets the total number of TreeView nodes. For the treeNodeProxy control, this property gets the number of child nodes under the specific node. (Int32 type)

IsExpanded

Applies to the TreeViewNode (treeNodeProxy) control.

Gets a True value if the TreeNode is expanded. (Boolean)

IsSelected

Applies to the TreeViewNode (treeNodeProxy) control.

Gets a True value if the treeNodeProxy is selected. (Boolean)

Nodes

Applies to the TreeView and TreeViewNode (treeNodeProxy) controls.

Gets a collection of TreeView nodes (IList[] type).

Parent

Applies to the TreeViewNode (treeNodeProxy) control.

Gets the parent node of the currently selected node. (TreeNode type)

PathSeparator

Applies to the TreeView control.

Gets the character used to delineate child nodes in the path string identifying a particular node. This property also displays in the Properties window.

RootNode

Applies to the TreeView control.

Gets the main (root) node for the TreeView. (TreeNode type)

SelectedNode

Applies to the TreeView control.

Gets the currently selected TreeView node (TreeNode type).

Text

Applies to the TreeViewNode (treeNodeProxy) control.

Gets the text for the currently selected TreeView node. (String type)

 Events

Event

Description

NodeClicked

Occurs when the user clicks on a TreeView node.

NodeDoubleClicked

Not implemented for SAP_AxTreeView.

NodeSelected

Not implemented for SAP_AxTreeView.

  Methods

Method

Description

Parameters

Return Type

ClickNode

Not implemented for SAP_AxTreeView.

String path

Boolean

ClickNodeByRegex

Not implemented for SAP_AxTreeView.

String regex

Boolean

ClickNodeByText

Not implemented for SAP_AxTreeView.

String text

Boolean

CollapseAll

Applies to the TreeView and TreeViewNode (treeNodeProxy) controls.  

Use this method to collapse all currently expanded nodes.

None

Void

Collapse

Applies to the TreeViewNode (treeNodeProxy) controls.

Use this method to collapse the currently selected node.

None

Void

CollapseNode

Use this method to collapse the node selected by the input path parameter, such as SAP menu/Office.

String path

Boolean

CollapseNodeByRegex

Use this method to collapse the node selected by specifying the node text in regex syntax.

String regex

Boolean

CollapseNodeByText

Use this method to collapse the node selected by the node text input parameter, such as Office.

String text

Boolean

DoubleClickNode

Not implemented for SAP_AxTreeView.

String path

Boolean

DoubleClickNodeByRegex

Not implemented for SAP_AxTreeView.

String regex

Boolean

DoubleClickNodeByText

Not implemented for SAP_AxTreeView.

String text

Boolean

EnsureVisible

Applies to the TreeView and TreeViewNode (treeNodeProxy) controls.

Use this method to expand the nodes in the TreeView so the node identified by the path parameter is visible.

String path

Boolean

Expand

Applies to the TreeViewNode (treeNodeProxy) controls.

Use this method to expand all nodes under the currently selected node.

None

Void

ExpandAll

Applies to the TreeView and TreeViewNode (treeNodeProxy) controls.

Use this method to expand all nodes in the tree (for the TreeView control) or expand all nodes under the currently selected node (for the treeNodeProxy control).

None

Void

ExpandNode

Use this method to expand a node using the path parameter.

String path

Boolean

ExpandNodeByRegex

Use this method to expand a node selected by specifying the node text in regex syntax.

String regex

Boolean

ExpandNodeByText

Use this method to expand a node selected by the node text input parameter.

String text

Boolean

GetRootItemTextByIndex

Not implemented for SAP_AxTreeView.

Int32 index

Boolean

Select

Not implemented for SAP_AxTreeView.

Applies to the TreeViewNode (treeNodeProxy) controls.

None

Void

SelectNode

Use this method to select a node using the path parameter.

String path

Boolean

SelectNodeByRegex

Use this method to select a node using by specifying node text in regex syntax.

String regex

Boolean

SelectNodeByText

Use this method to select a node using the node text input parameter.

String text

Boolean

SelectRootItemByIndex

Not implemented for SAP_AxTreeView.

Int32 index

Boolean

Toggle

Not implemented for SAP_AxTreeView.

Applies to the TreeViewNode (treeNodeProxy) controls.

None

Void

 


Privacy | Trademarks | Terms of Use | Feedback

Updated: 01 July 2024

© 2016 - 2024 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label