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

SAP GUI script python, find a row in a grid

former_member823631
Discoverer
0 Likes
2,432

Hello,

So this is my code:

for i in range (session.FindById("wnd[1]/usr/cntlGRID1/shellcont/shell").RowCount -1): if session.FindById("wnd[1]/usr/cntlGRID1/shellcont/shell[0,i]").Text == "ESZ kísérőlevél":

session.FindById("wnd[1]/usr/cntlGRID1/shellcont/shell").GetAbsoluteRow(i).Selected = True

and this grid:

And I want to select the line where the "ESZ kísérőlevél" appears.

I didn't really realize what I messed up. Any ideas?

Accepted Solutions (0)

Answers (1)

Answers (1)

script_man
Active Contributor
0 Likes

Hi Patrik,

I don't program in PYTHON, but in VB-Script it might look like this.

     for i in range (session.FindById("wnd[1]/usr/cntlGRID1/shellcont/shell").RowCount -1): 
         if session.FindById("wnd[1]/usr/cntlGRID1/shellcont/shell[0," & cstr(i) & "]").Text ==
 "ESZ kísérőlevél": 
 session.FindById("wnd[1]/usr/cntlGRID1/shellcont/shell").GetAbsoluteRow(i).Selected = True

Regards, ScriptMan