问题
I am trying to automate some steps in SAP with Python. I am able to do it for other type of SAP codes except for one where the Excel Export is only chosen through the menu bar "list", then "export", then "spreadsheet". Then a dialog box pops up with the request of the location and name of the file.
The issue I ran into with this case is that the Python code does not bring up steps above like it does with other SAP portion. I use the record Macro of SAP to save it in VBscript and put that into the python code.
session.findById("wnd[0]").maximize
session.findById("wnd[0]/mbar/menu[0]/menu[4]/menu[1]").select
session.findById("wnd[1]/usr/ctxtDY_PATH").text = "directory"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "filename"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 8
session.findById("wnd[1]/tbar[0]/btn[0]").press
The second line of this code results in nothing. Even though it should activate the menu bar, etc.
Your help in resolving this is appreciated.
来源:https://stackoverflow.com/questions/58368541/exporting-with-sap-using-python