cancel
Showing results for 
Search instead for 
Did you mean: 

VBA SAP, How to get row coordinates of the material classification which is selected by search

0 Kudos
145

Dear All,

I have searched long time before I asked you for help.

I am searching for Material Characrteristic coordinates to use them for pasting the value.

How to get location/coordinates of marked place?

Please see the code I am using during manual maintance (macro recording)

session.findById("wnd[0]/usr/subSUBSCR_BEWERT:SAPLCTMS:5000/tabsTABSTRIP_CHAR/tabpTAB1/ssubTABSTRIP_CHAR_GR:SAPLCTMS:5100/tblSAPLCTMSCHARS_S/ctxtRCTMS-MWERT[1,4]").Text = col3

col3 is variable which i put in the place (MWERT[1,4])

Location of transport condition characteristic is differen for every material, in this case it is MWERT[1,4]. How to get it every time and put into the code:

session.findById("wnd[0]/usr/subSUBSCR_BEWERT:SAPLCTMS:5000/tabsTABSTRIP_CHAR/tabpTAB1/ssubTABSTRIP_CHAR_GR:SAPLCTMS:5100/tblSAPLCTMSCHARS_S/ctxtRCTMS-MWERT[x,y]").Text = col3 (x,y) - new coordinates took by vba.

I tried myKey = session.ActiveWindow.GuiFocus.ID - it doesn't give me coordinates of the characteristc value which is focused.

I tried .getFocusedNodeKey() but also it is not working session.findById("wnd[0]/usr/subSUBSCR_BEWERT:SAPLCTMS:5000/tabsTABSTRIP_CHAR/tabpTAB1/ssubTABSTRIP_CHAR_GR:SAPLCTMS:5100/tblSAPLCTMSCHARS_S/ctxtRCTMS-MWERT").getFocusedNodeKey()

I tried few others configurations and test myself but nothing worth to mention.

Thank you in advance for you help.

Lukas

anne-petteroe
Community Manager
Community Manager
0 Kudos

Hello Lukasz,

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!

All the best,
Anne

Accepted Solutions (0)

Answers (0)