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

SAP GUI Scripting select active row

wkn
Discoverer
0 Likes
16,896

Hi,

I'm trying to automate some SAP actions with Excel.

I Recorded some Script from SAP an most is working just fine, I only have a problem selecting the active row in CS02 after positioning the right RowID.

Recording results in:

session.findById("wnd[0]/usr/tabsTS_ITOV/tabpTCMA/ssubSUBPAGE:SAPLCSDI:0152/tblSAPLCSDITCMAT").getAbsoluteRow(39).selected = true

But I can't select a row with the AbsoluteRow number since I don't know that number.

Any ideas how to select the entire line so it can be deleted?

Thanks.

View Entire Topic
Stefan-Schnell
Active Contributor
0 Likes

Hello Wim,

welcome in the SAP Community.

I am not sure that I understand your question correctly. I would to loop over the table control to get the correct entry via its description and select it.

For i = 0 To session.findById("wnd[0]/usr/tblSAPMBIBSTC537").VisibleRowCount - 1
  If session.findById("wnd[0]/usr/tblSAPMBIBSTC537/txtLOOP410-TEXT[0," & CStr(i) & "]").Text = "Familie" Then
    session.findById("wnd[0]/usr/tblSAPMBIBSTC537").getAbsoluteRow(i).selected = true
  End If
Next

Let us know your results.

Cheers
Stefan