cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Loop though specific table column and select row when found

0 Likes
3,083

If I want to update specific quota I need to script to check for the Quota Arr. Number column in below displayed table. If the number is same as in excel input file (COL3) than it should select the same row as the number is found. In below example it should select row 2.

I tried below code but the script stops at: session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3,i]").text

Runtime error ‘619’:

The control could not be found by id.

i = 0

Do

session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3,i]").text
session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3," & CStr(i) & "]").caretPosition = 5

If session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3,i]").text = COL3 then

session.findById("wnd[0]/usr/tblSAPDM06QTC_0205").getAbsoluteRow(i).selected = true

Exit Do
End if

i = i + 1

Loop

Accepted Solutions (0)

Answers (1)

Answers (1)

I found the error line as well. It's stated in my post. Read my post twice before commenting 😉

Sandra_Rossi
Active Contributor
0 Likes

What I meant is that in the line below that line, you have solved the error ([3," & CStr(i) & "]"), so it's just that you didn't check twice 😉

session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3," & CStr(i) & "]").caretPosition = 5
0 Likes

Thanks! I whish it was that easy though. I just copied from something that looked similar when googled. It didn't work for my code. Much easer to find the error if you know what to look for 🙂