cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Scripting in Python select context menu item error

Hello!

I'm a bit newer to SAP scripting in Python but would like to make SAP scripting in Python more prolific in my organization because of the multi-threading and other advantages it has over VBA. Perhaps too much background 🙂

Anyway, I am currently getting an error when converting VBA scripting to Python when trying to select context menu item specifically the code below:

session.findById('wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell').contextMenu() session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").selectContextMenuItem("&FIND")

is getting the following error

com_error: (-2147352567, 'Exception occurred.', (619, 'SAP Frontend Server', 'The control could not be found by id.', 'C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\sapfront.HLP', 393215, 0), None)

Was curious if anyone has come across this before and has a solution.. probably something very simple I'm sure but I've been searching everywhere and trying all different options such as selecting by position but to no luck!

Appreciate any and all advice!

Thank you,


Katy

View Entire Topic
0 Kudos

Hello, Katy

Facing the same problem here, but with no success until now. When I run a code such as

session.findById(path).pressContextButton()

session.findById(path).selectContextMenuItem("&FIND")

in my python script, it just keeps running and makes the window unaccesable to write a path tin order to upload a file.

Do you a have an answer to this issue already?

Cordially

Dennyson Santos

former_member763929
Participant
0 Kudos

Thanks for coming to SAP Community for answers. Please post your question as a new question here:

Since you're new in asking questions here, check out our tutorial about asking and answering questions (if you haven't already), as it provides tips for preparing questions more effectively, that draw responses from our members.

Please note, that your post here won't be answered.