Highlighted
Absent Member.
Absent Member.
3796 views

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

Jump to solution
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
0 Likes
14 Replies
Highlighted
Absent Member.
Absent Member.
Trincy. Thank you again. This worked to write the data to the next line of the DataTable without overwriting any lines of the previous output. However, because after the first account has finished i need it to grab the next account on the datatable to do the same procedure, the script attempts to grab the account from the same row it ended on with output. IE, if the table data stopped at Row 5, the script tries to grab the next account number from row 5 of the DataTable, whereas the correct number is on row 2 not 5. I had to remove the Next statement after the "For Iterations" statement due to syntax.
0 Likes
Highlighted
Absent Member.
Absent Member.
Sean,

Just set the the row before you fetch account number...



For Iterations=1 to DataTable.GetRowCount

DataTable.SetCurrentRow(Iterations)
accountnumber = DataTable("GetAcctNumber", dtLocalSheet)


Because you are setting the row to "RowNum+r" later, the webtable values should be fine.
Highlighted
Absent Member.
Absent Member.
Trincy Et All,

Than you very much for your help; my script is a success because of the help you provided.

-Sean
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.