SAP for Automotive Discussions
Connect with fellow SAP users in discussions to troubleshoot challenges, share best practices, and fuel each other's success. Join a conversation or start your own.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP GUI Scripting Select the first row after filtering

simple-1998
Discoverer
0 Kudos
613

Hi all,

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 first row after filtering material in Position

Recording results in:

session.findById("wnd[0]/usr/tblSAPLV60PTCTRL_KOPIEREN").getAbsoluteRow(466).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 first row after filtering ?

Thanks.

2 REPLIES 2

moshenaveh
Community Manager
Community Manager
0 Kudos
431

Welcome to the SAP Community! Thank you for visiting us to get answers to your questions.

Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.

First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Secondly, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html as well, as that will help you when submitting questions to the community.

Finally, I recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

script_man
Active Contributor
0 Kudos
431

Hi Simple Tran, you could test the following on this:

e.g.

myRow = session.findById("wnd[0]/usr/tblSAPLV60PTCTRL_KOPIEREN").verticalscrollbar.position
session.findById("wnd[0]/usr/tblSAPLV60PTCTRL_KOPIEREN").getAbsoluteRow(myRow).Selected = True

Regards, ScriptMan