Highlighted
Valued Contributor.
Valued Contributor.
483 views

Issue with SAPGuiGrid object

Jump to solution

Hi All

I am working on preparing automating scripts for SAP application using UFT (version 14.01)

Having issues with SAPGuiGrid object.

On one of the screen i have a table which is a SAPGuiGrid object and i need to select a row with specific text.

When i check the rowcount and columncount i am getting the correct information but when i use GetCelldata i am getting error mentioned below

[B][U]Error[/U][/B]: Cannot identify the specified item of the CalenderOverview object. Confirm that the specified item is included in the object's item collection

Below mentioned lines are working

rowcount = SAPGuiSession("Session").SAPGuiWindow("Display").SAPGuiGrid("GridViewCtrl").RowCount
column**** = SAPGuiSession("Session").SAPGuiWindow("Display").SAPGuiGrid("GridViewCtrl").ColumnCount

but for the line
Test = SAPGuiSession("Session").SAPGuiWindow("Display").SAPGuiGrid("GridViewCtrl").GetCellData(2, "ID")
I am getting the above mentioned error. here ID is the column header. I have even tried column number in the place of column header name. Still no luck.

please assist

0 Likes
1 Solution

Accepted Solutions
Highlighted
Valued Contributor.
Valued Contributor.

Re: Issue with SAPGuiGrid object

Jump to solution

solved this issue by adding "#" to column index. Somehow the column heading name seems to have a problem

below is the code:

rowcount = SAPGuiSession("Session").SAPGuiWindow("Display").SAPGuiGrid("GridViewCtrl").RowCount
columncunt = SAPGuiSession("Session").SAPGuiWindow("Display").SAPGuiGrid("GridViewCtrl").ColumnCount 

For i = 1 to rowcount
    For j = 1 to columncunt
        k = "#"&j
        test = SAPGuiSession("Session").SAPGuiWindow("Display").SAPGuiGrid("GridViewCtrl").GetCellData(i, k)
        If test = "Q1" Then
            msgbox "PASS"
        End If
    
    Next

Next

View solution in original post

0 Likes
1 Reply
Highlighted
Valued Contributor.
Valued Contributor.

Re: Issue with SAPGuiGrid object

Jump to solution

solved this issue by adding "#" to column index. Somehow the column heading name seems to have a problem

below is the code:

rowcount = SAPGuiSession("Session").SAPGuiWindow("Display").SAPGuiGrid("GridViewCtrl").RowCount
columncunt = SAPGuiSession("Session").SAPGuiWindow("Display").SAPGuiGrid("GridViewCtrl").ColumnCount 

For i = 1 to rowcount
    For j = 1 to columncunt
        k = "#"&j
        test = SAPGuiSession("Session").SAPGuiWindow("Display").SAPGuiGrid("GridViewCtrl").GetCellData(i, k)
        If test = "Q1" Then
            msgbox "PASS"
        End If
    
    Next

Next

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.