Quantcast
Channel: SCN : All Content - Scripting Languages
Viewing all articles
Browse latest Browse all 522

Is there a good way to get an xpath reference from SAP for use in SAP GUI?

$
0
0

I am doing a fair bit of SAP GUI scripting with VBA.

 

Most of the time I record an SAP GUI script via the recorder and edit it appropriately. However, increasingly often as I am familiar with SAP GUI and begin modifying existing scripts, I want to know the x-path reference for menu items so I can incorporate them in my scripts.

 

For example, my most recent pursuit was a confirmation yes/no button which resulted with:

 

    m_Session.findById("wnd[1]/usr/btnSPOP-OPTION1").press

 

in exploring the SAP interface I've not been able to find a good way to get this path (wnd[1]/usr/btnSPOP-OPTION1) from SAP. I know I can go into m_Session on the VBA side with the properties explorer and eventually get the path in a format like - "/app/con[0]/ses[0]/wnd[1]/usr/btnSPOP-OPTION1" - which kind of works. This is a huge hassle to gothrough in many cases 4+ layers to get there though. Plus many of the SAP field names aren't exactly the most clear and it takes a while to figure out what the correct one is.

 

I'd like to be able to do something similar to the F1 (help) --> technical information query which can give some of the information I want.

 

Is this possible to get from SAP? Or should I just write a "SAP GUI scraper" in VBA which reports out ALL x-paths contained within the session object and try to get enough information to make this meaningful?


Viewing all articles
Browse latest Browse all 522

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>