Search rows in a webtable for text, then output the value

Hi,

I’m hoping someone can help me. I have a WebTable in a SAP application that I am trying to search through to find a specific text value, once found, to output the value of every cell on the row the text was found in.

For instance, I have a table with 4 columns and many rows, one or more of the columns contain the text I want, I need the script to loop through each row until it finds the text I am looking for, then output the text value in each cell on that row. The loop would end once it find a row with no data.


Any help would be much appreciated.

Thanks in advance,
Sean
Parents
  • Verified Answer

    Try looking at it again, sometimes it'll skip over the webtable in the steps....Also sometimes if you click right on the text it will show up as a webelement.


    Use an object spy and attach a screenshot of said object spy on the object.


    Anyways You could always just iterate through with two for loops.

    for i = 1 to rowcount
    for j = i to columncount
    if WebTable.GetCelldata(i,j) = "yourText" Then
    'iterate through that row and concatenate
    Exit For
    Exit For
    End If
    Next
    Next



    Something along those lines as far as pseudocode goes
Reply
  • Verified Answer

    Try looking at it again, sometimes it'll skip over the webtable in the steps....Also sometimes if you click right on the text it will show up as a webelement.


    Use an object spy and attach a screenshot of said object spy on the object.


    Anyways You could always just iterate through with two for loops.

    for i = 1 to rowcount
    for j = i to columncount
    if WebTable.GetCelldata(i,j) = "yourText" Then
    'iterate through that row and concatenate
    Exit For
    Exit For
    End If
    Next
    Next



    Something along those lines as far as pseudocode goes
Children
No Data