on 06-03-2015 1:07 PM
Hi guys.
I've been trying to export SAP tables via SAP GUI scripting however it seems the recorder cannot export the tables in MHTML format. It stops at the pop-up and that's it. I did try the export to local file but there is an extra column and extra row that is unneeded. Currently, I export the tables through txt format but I encountered I problem later on when importing the file in Print Image format because apparently, the field lengths in SAP change from time to time, at least in our case. So the best approach will be to use the MHTML format. So can anyone help me how to export the table in MHTML and save it. Thanks
Hi Stefan,
Red corner brackets appear. The thin ones but not the red thick boxes from your analyzer so I guess it's not possible. Thanks anyway.
Brit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Brit,
welcome to the Scripting Languages forum.
In my case it works on this way, to export data from an ALV grid to MHTML format.
Here the code:
'Opens export dialog on SE16 with ALV grid
session.findById("wnd[0]/tbar[1]/btn[43]").press
'Selects MHTML
session.findById("wnd[1]/usr/radRB_1").setFocus
session.findById("wnd[1]/usr/radRB_1").select
session.findById("wnd[1]/tbar[0]/btn[0]").press
'Sets path and file
session.findById("wnd[1]/usr/ctxtDY_PATH").text = "C:\Users\Bambi\Documents\SAP\SAP GUI\"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").text = "export.MHTML"
'Exports data to file
session.findById("wnd[1]/tbar[0]/btn[0]").press
Please try it and let us know your results.
Cheers
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
thanks for the reply. I added the script up to the up the list view and ended up with the save prompt screen and then it stopped there. I tried to change the directory in the script but it appears I can't because it goes to a default folder then you have to go the directory folder you want and then click save. this is in contrast to the export command where you specifically identify your folder path and file name. The thing is I want to automate everything up to saving of the table and then going back to the main screen and then doing it again for another 3 tables.
The current solution I am seeing is that I have export it as a spreadsheet and then launch an excel macro to clean up the spreadsheet before importing to ACL.
Currently my script works in the .txt format and importing it to ACL as a print image but it appears that field lengths change and the import script is affected.
Hello Brit,
thanks for your reply. It is possible for you to use Scripting Tracker from here to analyze your SAP GUI for Windows environment? Open the dialog, start Scripting Tracker and scan all scripting objects.
If you see your environment like this example above, it should be possible for you to set the path, the file name and to press a button automatically. If you don't see wnd[1] in the object hierarchy of Scripting Tracker, you can't set the fields and press the buttons.
Let us know your results.
Cheers
Stefan
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.