Exporting with SAP using Python

北慕城南 提交于 2020-04-11 11:43:31

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!