SAPGuiGrid Object

Description

A grid control in an SAP GUI for Windows application.

Operations

The sections below list the built-in methods and properties that you can use as operations for the SAPGuiGrid object.

Note: You can also view a list and descriptions of the SAPGuiGrid description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.

Methods

Method ActivateCellDouble-clicks the specified cell in a grid.
Method ActivateColumnDouble-clicks the specified column in a grid.
Method ActivateRowDouble-clicks the specified row in a grid.
Common Method CaptureBitmapSaves a screen capture of the object as a .png or .bmp image using the specified file name.
Common Method CheckChecks whether the actual value of an item matches the expected value.
Common Method CheckPropertyChecks whether the actual value of the specified object property matches the specified expected value within the specified timeout.
Common Method ChildObjectsReturns the collection of child objects contained within the object.
Common Method GetAllROProperties

Returns the collection of properties and current values from the object in the application.

Method ClearSelectionClears any selected rows or columns in a grid.
Method ClickCellClicks the specified cell in a grid.
Method ColumnCountRetrieves the number of columns in the grid.
Method DeselectColumnClears the selection of the specified column.
Method DeselectRowClears the selection of the specified row.
Method DeselectRowsRangeDeselects the specified rows in the grid.
Method ExtendColumnSelects an additional column in the grid.
Method ExtendRowSelects an additional row in the grid.
Method ExtendRowsRangeAdds the specified range of rows to the selected rows in the grid.
Method FindAllRowsByCellContentRetrieves all rows of all cells in the given column whose content matches the specified data.
Method FindRowByCellContentRetrieves the first row of the cell in the given column whose content matches the specified data.
Method GetCellDataReturns the data contained in the specified cell.

Method GetCellDataEx

Returns a cell's content from a row with specific content in another cell.

Common Method GetROPropertyReturns the current value of the description property from the object in the application.
Common Method GetTOPropertiesReturns the collection of properties and values used to identify the object.
Common Method GetTOPropertyReturns the value of the specified description property from the test object description.
Common Method HighlightHighlights the object in the application.
Method InputRecords an Input statement each time new or modified table cell data is sent to the SAP server.
Method IsCellEditableChecks whether the cell is editable.
Method OpenPossibleEntriesOpens the list of possible entries for a specified cell in a grid.
Common Method OutputRetrieves the current value of an item and stores it in a specified location.
Method PressEnterPresses the ENTER keyboard key when a grid control is in focus.
Common Method RefreshObjectInstructs UFT One to re-identify the object in the application the next time a step refers to this object.
Method RowCountReturns the number of rows in the grid.
Method SelectAllSelects all cells in a grid.
Method SelectCellSelects the specified cell in a grid.
Method SelectColumnSelects the specified column in the grid.
Method SelectMenuItemByIdSelects a menu item from a context menu (opened by right-clicking the grid) based on the specified SAP ID.
Method SelectRowSelects the specified row in the grid.
Method SelectRowsRangeSelects the specified range of rows in the grid.
Method SetCellDataSets the cell contents with the specified data.
Method SetCheckboxSets the specified checkbox in a grid.
Common Method SetTOPropertySets the value of the specified description property in the test object description.
Common Method ToStringReturns a string that represents the test object.
Common Method WaitPropertyWaits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.

Properties

Common Property ExistChecks whether the object currently exists in the open application.
Common Property ObjectAccesses the native methods and properties of the object.

Back to top

 

ActivateCell Method

Description

Double-clicks the specified cell in a grid.

Syntax

object.ActivateCell (Row, Column)

Arguments

ParameterDescription
Row Required. A long integer value.
The row number of the cell to activate. Row numbers begin with 1.
Column Required. A String value.
The column of the cell to activate. The column can be specified by the column's label or column number in the format "#index". Column numbers begin with 1.

Return Type

None.

Example

Back to top

 

ActivateColumn Method

Description

Double-clicks the specified column in a grid.

Syntax

object.ActivateColumn (Column)

Arguments

ParameterDescription
Column Required. A String value.
The column to activate. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.

Return Type

None.

IMPORTANT

Activating the column selects the entire column, or in certain cases, displays another window.

Example

Back to top

 

ActivateRow Method

Description

Double-clicks the specified row in a grid.

Syntax

object.ActivateRow (Row)

Arguments

ParameterDescription
Row Required. A long integer value.
The row number to activate. Row numbers begin with 1.

Return Type

None.

IMPORTANT

We recommend using an SAPGuiGrid.SelectRow statement before using this method.

Example

Back to top

 

ClearSelection Method

Description

Clears any selected rows or columns in a grid.

Syntax

object.ClearSelection

Return Type

None.

IMPORTANT

This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the UFT One User Guide.

Example

Back to top

 

ClickCell Method

Description

Clicks the specified cell in a grid.

Syntax

object.ClickCell (Row, Column)

Arguments

ParameterDescription
Row Required. A long integer value.
The row number of the cell to click.
Row numbers begin with 1.
Column Required. A String value.
The column of the cell to click. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

IMPORTANT

This method is generally recorded when a button is pressed within a cell or if another item is pressed, resulting in a communication with the SAP server.

Example

Back to top

 

ColumnCount Method

Description

Retrieves the number of columns in the grid.

Syntax

object.ColumnCount

Return Type

A Variant.

Example

Back to top

 

DeselectColumn Method

Description

Clears the selection of the specified column.

Syntax

object.DeselectColumn (Column)

Arguments

ParameterDescription
Column Required. A String value.
The column to deselect. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

Example

Back to top

 

DeselectRow Method

Description

Clears the selection of the specified row.

Syntax

object.DeselectRow (Row)

Arguments

ParameterDescription
Row Required. A long integer value.
The number of the row to deselect.
Row numbers begin with 1.

Return Type

None.

IMPORTANT

This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the UFT One User Guide.

Example

Back to top

 

DeselectRowsRange Method

Description

Deselects the specified rows in the grid.

Syntax

object.DeselectRowsRange (From, To)

Arguments

ParameterDescription
From Required. A long integer value.
The number of the first row to deselect.
Row numbers begin with 1.
To Required. A long integer value.
The number of the last row to deselect.
Row numbers begin with 1.

Return Type

None.

IMPORTANT

This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or Editor. For more information, see the UFT One User Guide.

Example

Back to top

 

ExtendColumn Method

Description

Selects an additional column in the grid.

Syntax

object.ExtendColumn (Column)

Arguments

ParameterDescription
Column Required. A String value.
The column to add to the selection. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

Example

Back to top

 

ExtendRow Method

Description

Selects an additional row in the grid.

Syntax

object.ExtendRow (Row)

Arguments

ParameterDescription
Row Required. A long integer value.
The number of the row to add to the selection.
Row numbers begin with 1.

Return Type

None.

Example

Back to top

 

ExtendRowsRange Method

Description

Adds the specified range of rows to the selected rows in the grid.

Syntax

object.ExtendRowsRange (From, To)

Arguments

ParameterDescription
From Required. A long integer value.
The number of the first row to add to the selection.
Row numbers begin with 1.
To Required. A long integer value.
The number of the last row to add to the selection.
Row numbers begin with 1.

Return Type

None.

Example

Back to top

 

FindAllRowsByCellContent Method

Description

Retrieves all rows of all cells in the given column whose content matches the specified data.

Syntax

object.FindAllRowsByCellContent (Col, CellText)

Arguments

ParameterDescription
Col Required. A Variant.
The column in which you want to search. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.
CellText Required. A Variant.
The data for which you want to search.

Return Type

A Variant.

Example

Back to top

 

FindRowByCellContent Method

Description

Retrieves the first row of the cell in the given column whose content matches the specified data.

Syntax

object.FindRowByCellContent (Col, CellText, [StartFromRow])

Arguments

ParameterDescription
Col Required. A Variant.
The column in which you want to search. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.
CellText Required. A Variant.
The data for which you want to search.
StartFromRow Optional. A Variant.
The row in which you want the search to start. Row numbers begin with 1.
Default value = 1

Return Type

A Variant.

If no content matches the specified value, the return value is NULL.

Example

Back to top

 

GetCellData Method

Description

Returns the data contained in the specified cell.

Syntax

object.GetCellData (Row, Column)

Arguments

ParameterDescription
Row Required. A long integer value.
The row number of the cell for which you want to retrieve data.
Row numbers begin with 1.
Column Required. A String value.
The column of the cell for which you want to retrieve data. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

A Variant.

Example

Back to top

 

GetCellDataEx Method

Description

Returns a cell's content from a row with specific content in another cell.

This method performs the equivalent of FindRowByCellContent and GetCellData, retrieving the content of the specified column from the first row found with the specified content.

Syntax

object.GetCellDataEx (Column, ByColumn, ByValue, [StartFromRow])

Arguments

ParameterDescription
Column Required. A String value.
The column of the cell for which you want to retrieve data. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.
ByColumn Required. A Variant.
The column in which you want to search for the value specified in the ByValue argument. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.
ByValue

Required. A String.

The value for which to search in the column specified in the ByColumn argument.

StartFromRow Optional. A Variant.
The row in which you want the search to start. Row numbers begin with 1.
Default value = 1

Return Type

A Variant.

Example

Back to top

Input Method

Description

Records an Input statement each time new or modified table cell data is sent to the SAP server.

Syntax

object.Input (DataSheet, [ScrollMethod])

Arguments

ParameterDescription
DataSheet Required. A String value.
The name of the input data sheet containing the data for the grid.
ScrollMethod Optional. A tagSCROLL_METHOD Value.
The keyboard key that UFT One uses to scroll or add rows to the grid if the input data sheet includes rows that exceed the number of rows currently displayed in the application.
Possible values:
82 or PAGEDOWN: (default) Sends a Page Down key command to scroll the grid.
0 or ENTER: Sends an Enter key command to scroll the grid.
For details on when to use this argument, refer to the "Automatically parameterizing table and grid cell values" topic in the SAP Solutions Add-in section of the UFT One Help Center.
Default value = micPageDown

Return Type

None.

IMPORTANT

This method is recorded only if the Auto-parameterize table and grid controls option is selected in the SAP pane of the Options dialog box.

When the Auto-parameterize table and grid controls option is selected, an Input statement is recorded each time new or modified grid cell data is sent to the SAP server. The statement represents all cell values that were set prior to sending the data to the server.

For each recorded Input method, a corresponding input data sheet is automatically inserted in the test's Data Table as a sub-sheet of the action data sheet containing the recorded cell values. Columns are added to the data sheet only for cells containing input data.

Once the new input data sheet has been created by recording the Input statement, you can add or modify the data set, and add additional data sets for each action iteration.

During the test run, this method inserts the values from the input data sheet specified by the SheetName argument into the grid.

During each action iteration, the values of all cells in the relevant data set of the input data sheet are inserted into the grid according to the row position and column name.

Notes:

You must record the Input method using the Auto-parameterize table and grid controls option to create the input data sheet. You cannot create the required input data sheet manually.

A SelectCell method is automatically recorded after each Input statement.

When the Auto-parameterize table and grid controls option is not selected, a SetCellData statement is recorded for each value you set in a grid cell.

For a detailed explanation of how to work with the Input statement and how to edit or add data sets to the input data sheet, refer to the "Automatically parameterizing table and grid cell values" topic in the SAP Solutions Add-in section of the UFT One Help Center.

Example

Back to top

 

IsCellEditable Method

Description

Checks whether the cell is editable.

Syntax

object.IsCellEditable (Row, Col)

Arguments

ParameterDescription
Row Required. A long integer value.
The row number of the cell to check.
Row numbers begin with 1.
Col Required. A Variant.
The column of the cell to check. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.

Return Type

A Variant.

Example

Back to top

 

OpenPossibleEntries Method

Description

Opens the list of possible entries for a specified cell in a grid.

Syntax

object.OpenPossibleEntries (Row, Column)

Arguments

ParameterDescription
Row Required. A long integer value.
The row number of the cell for which you want to open the Possible Entries dialog box.
Row numbers begin with 1.
Column Required. A String value.
The column of the cell for which you want to open the Possible Entries dialog box. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

Example

Back to top

 

PressEnter Method

Description

Presses the ENTER keyboard key when a grid control is in focus.

Syntax

object.PressEnter

Return Type

None.

Example

Back to top

 

RowCount Method

Description

Returns the number of rows in the grid.

Syntax

object.RowCount

Return Type

A Variant.

Example

Back to top

 

SelectAll Method

Description

Selects all cells in a grid.

Syntax

object.SelectAll

Return Type

None.

Example

Back to top

 

SelectCell Method

Description

Selects the specified cell in a grid.

Syntax

object.SelectCell (Row, Column)

Arguments

ParameterDescription
Row Required. A long integer value.
The row number of the cell to select.
Row numbers begin with 1.
Column Required. A String value.
The column of the cell to select. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

Example

Back to top

 

SelectColumn Method

Description

Selects the specified column in the grid.

Syntax

object.SelectColumn (Column)

Arguments

ParameterDescription
Column Required. A String value.
The column to select. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.

Return Type

None.

Example

Back to top

 

SelectMenuItemById Method

Description

Selects a menu item from a context menu (opened by right-clicking the grid) based on the specified SAP ID.

Syntax

object.SelectMenuItemById (MenuItemId)

Arguments

ParameterDescription
MenuItemId Required. A String value.
The internal SAP ID for the menu item.

Return Type

None.

IMPORTANT

When a context menu opens from a grid, UFT One always records a SelectColumnmethod, SelectRow method, or SelectCellmethod, and then records the SelectMenuItemById method. If you want to add a SelectMenuItemById method manually in the Editor, be sure to include one of the Select* methods mentioned above before the SelectMenuItemById method.

Example

Back to top

 

SelectRow Method

Description

Selects the specified row in the grid.

Syntax

object.SelectRow (Row)

Arguments

ParameterDescription
Row Required. A long integer value.
The number of the row to select.
Row numbers begin with 1.

Return Type

None.

Example

Back to top

 

SelectRowsRange Method

Description

Selects the specified range of rows in the grid.

Syntax

object.SelectRowsRange (From, To)

Arguments

ParameterDescription
From Required. A long integer value.
The number of the first row to select.
Row numbers begin with 1.
To Required. A long integer value.
The number of the last row to select.
Row numbers begin with 1.

Return Type

None.

Example

Back to top

 

SetCellData Method

Description

Sets the cell contents with the specified data.

Syntax

object.SetCellData (Row, Column, Data)

Arguments

ParameterDescription
Row Required. A long integer value.
The row number of the cell for which you want to specify data.
Row numbers begin with 1.
Column Required. A String value.
The column of the cell for which you want to specify data. The column can be specified by the column's label or column number in the format "#index".
Column numbers begin with 1.
Data Required. A String value.
The data to set for the specified cell.
The possible values for the data depends on the type of cell. For example, the values may be "ON" or "OFF" for a check box or radio button cell, or may be limited to the available values of a combo box.

Return Type

None.

IMPORTANT

This method is recorded only when the Auto-parameterize tables and grids option is not selected in the SAP pane of the Options dialog box.

Example

Back to top

 

SetCheckbox Method

Description

Sets the specified checkbox in a grid.

Syntax

object.SetCheckbox (Row, Col, Value)

Arguments

ParameterDescription
Row Required. A long integer value.
The row number of the cell whose check box state you want to set.
Row numbers begin with 1.
Col Required. A String value.
The column of the cell whose check box state you want to set. The column can be specified by the column's label or column number in the format " #index".
Column numbers begin with 1.
Value Required. A String value.
The state of the check box.
     "ON"
     "OFF"

Return Type

None.

Example

Back to top

See also: