Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Monday 15 February 2021

SAPGuiTable Object

ActivateCell Method : - It Double-clicks the specified cell in a sap table.

Syntax: -  object.ActivateCell (Row, Column)

SAPGuiSession("Session").SAPGuiWindow("Display").SAPGuiTable("SAP").ActivateCell "1","Material"


ClickCell Method: -It clicks on the specified cell in a table.

Syntax: object.ClickCell (Row, Column)

SAPGuiSession("Session").SAPGuiWindow("Purchase").SAPGuiTable("SAP").ClickCell 1,"Status"


ColumnCount Method: - It Retrieves the number of columns in the table.

Syntax: object.ColumnCount

TableColumns = SAPGuiSession("Session").SAPGuiWindow("StandardPO").SAPGuiTable("SAP").ColumnCount

DeselectColumn Method: -It Clears the selection of the specified column.

Syntax: object.DeselectColumn (Column)


SAPGuiSession("Session").SAPGuiWindow("Confirmation").SAPGuiTable("SAP").DeselectColumn "Confirmation"


DeselectRow Method:-It Clears the selection of the specified row.

Syntax: object.DeselectRow (Row)
Note: DeselectRow method to clear the selection of rows 8 and 11 in the "SAP" table
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiButton("Select all").Click
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiTable("SAP").DeselectRow 8
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiTable("SAP").DeselectRow 11
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiTable("SAP").SelectCell 16, "#1"
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiButton("Continue (Enter)").Click
DeselectRowsRange Method:- It Clears the selection of the specified rows in the table.
Syntax: object.DeselectRowsRange (From, To)

Note: DeselectRowsRange method to clear the selection of rows 10 through 13 in the SAP table.
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiButton("Select all").Click
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiTable("SAP").DeselectRowsRange 10, 13
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiButton("Continue(Enter)").Click
ExtendColumn Method:- It Selects an additional column in the table.

Syntax: object.ExtendColumn (Column)

Note : ExtendColumn method to select three columns in a table and sort them in ascending order.
SAPGuiSession("Session").SAPGuiWindow("Confirmation").SAPGuiTable("SAP").SelectColumn "Confirmation"
SAPGuiSession("Session").SAPGuiWindow("Confirmation").SAPGuiTable("SAP").ExtendColumn "Order"
SAPGuiSession("Session").SAPGuiWindow("Confirmation").SAPGuiTable("SAP").ExtendColumn "Operation"
SAPGuiSession("Session").SAPGuiWindow("Confirmation").SAPGuiButton("Sort in ascending").Click 
ExtendRow Method:- It Selects an additional row in the table.

Syntax: object.ExtendRow (Row)

Note: ExtendRow method to select rows 2 and 4 in addition to row 1 in the SAP table.
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiTable("SAP").SelectRow 1
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiTable("SAP").ExtendRow 2
SAPGuiSession("Session").SAPGuiWindow("View").SAPGuiTable("SAP").ExtendRow 4

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

Syntax : object.FindAllRowsByCellContent (Col, CellText)

Example : 
FindAllRowsByCellContent method to find all rows in which the city Tokyo is displayed in the "Arrival city" column. It then searches these rows to determine if Tokyo also appears in the
'"Depart. city" column (each row represents one leg of a flight itinerary). It then reports all instances in which Tokyo appears as both the arrival city and the departure city to the run results, since the flight information
'is incorrect (one flight leg cannot arrive to and depart from the same location). Finally, it closes the SAP windows session.
Dim rows_num
Set rows_num = SAPGuiSession("").SAPGuiWindow("").SAPGuiTable("").FindAllRowsByCellContent("Arrivalcity","TOKYO")
For   Each num In rows_num
    If SAPGuiSession("").SAPGuiWindow("").SAPGuiTable("").GetCellData(num,"Depart.city")="TOKYO" Then
        Reporter.ReportEvent micWarning, "The table contains incorrect data","In row"_
        &num&" we found that the Arrival city and the Departure city are the same - the flight information is incorrect!"
    End   If
Next
FindRowByCellContent Method : Retrieves the first row of the cell in the given
column whose content matches the specified data.