SAP GUI on other device 'The control could not be found by id.'

157 Views Asked by At

I am using anaconda python 3 and SAP GUI 770. I am trying to create an SAP GUI automate program and create an application on other devices.

When the program arrive export spreadsheet method it stops working with this error:

pywintypes.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)

and when saving the file I have material Document list dialog window and the other device has windows dialog window

material Document List dialog

Code:

session.findById("wnd[1]/usr/ctxtDY_PATH").text = folderdir
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = filename
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 3
session.findById("wnd[1]/tbar[0]/btn[0]").press()
1

There are 1 best solutions below

0
macikeci On

I found a solution. I just paste this line and it's all good now. I hope to help somebody with this.

session.findById("wnd[0]/mbar/menu[0]/menu[1]/menu[1]").select()
session.FindById("wnd[1]/tbar[0]/btn[0]").Press()
session.findById("wnd[1]/usr/ctxtDY_PATH").text = folderdir
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = filename
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 3
session.findById("wnd[1]/tbar[0]/btn[0]").press()