Any ideas, why @bingshui-hl is still getting Windows Popup instead of SAP popup?
Any ideas, why @bingshui-hl is still getting Windows Popup instead of SAP popup?
I tried it with the oldest SAP release from my archive 7.40 PL0 to ensure that this is not a question of the ALV grid release. But it works as in your video.
The TAC SE16N is in my case part of the package WUSL which is part of the component SAP_FIN. In my case it is this:
What release of SAP_FIN do you use? What release of SAP_FIN do you use @bingshui-hl?
I remember dark a discussion in the SAP forum a long time ago about the change from Windows dialog boxes to SAP dialog boxes in case of scripting in 2014 with SAP GUI for Windows 7.30 PL8. And as far as I can remember correct the using of SAP dialog boxes is also dependent from the backend version. Maybe you should take a look at it. That would be my only suggestion.
You can find the version in the menu System > Status… and the press the button with the magnifier glas.
Let us know your result.
Attached is my SAP_FIN.
About the discuss in SAP forum, it’s mentioned by Lev and I have tried out with checkbox and without, neither work.
your component is up to date.
Please try the following steps:
I tried this way on an older SAP system an on a current SAP system, but with the same version of the SAP GUI for Windows and with different themes. The older SAP system opens a native Windows Save as dialog, the newer SAP system opens the scriptable SAP dialog.
So it seems which dialog is opened has something to do with a backend component or configuration.
It seems that has nothing to do with SE16 (or SE16N) itself.
Please let us know your results of the steps above. It is very interesting to know the behavior of your system.
Thanks and best regards
I’m applying SE16 authorization, then I will give you feedback.
I am facing same problem like BingShui. I tried your instruction. I can click on the export button and the save as dialog prompt as normal. How can we proceed?
If I manually run the sequence manually and input the export file name manually, data will be exported to Excel successfully and the UIPath will prompt error as below
thank you very much for your reply. I will take a look at it and post my result here.
Hello Bingshui, Lim and Lev,
it is definitely a question of the version of the SAP_BASIS component.
I analyzed the ABAP code and I found the difference in the method FILE_SAVE_DIALOG from the class CL_GUI_FRONTEND_SERVICES, which is called from the function module XML_EXPORT_DIALOG from the method DOWNLOAD from the class CL_SALV_EXPORT_XML_DIALOG.
Here the differentiating ABAP code:
call method IS_SCRIPTING_ACTIVE receiving result = rt_value EXCEPTIONS others = 1. if rt_value = 1. * check the registry key call method cl_gui_frontend_services=>registry_get_dword_value exporting root = cl_gui_frontend_services=>HKEY_CURRENT_USER key = 'Software\SAP\SAPGUI Front\SAP Frontend Server\Scripting' value = 'ShowNativeWinDlgs' importing reg_value = RCCU exceptions others = 1. call method cl_gui_frontend_services=>registry_get_dword_value exporting root = cl_gui_frontend_services=>HKEY_LOCAL_MACHINE key = 'Software\SAP\SAPGUI Front\SAP Frontend Server\Scripting' value = 'ShowNativeWinDlgs' importing reg_value = RCLM exceptions others = 1. call method cl_gui_cfw=>flush. if RCCU = 0 or ( RCCU ne 1 and RCLM ne 1 ) . RT_VALUE = 'X'. call FUNCTION 'GUI_FILE_SAVE_DIALOG' exporting WINDOW_TITLE = WINDOW_TITLE DEFAULT_EXTENSION = DEFAULT_EXTENSION DEFAULT_FILE_NAME = DEFAULT_FILE_NAME WITH_ENCODING = WITH_ENCODING INITIAL_DIRECTORY = INITIAL_DIRECTORY FILE_FILTER = FILTER importing FULLPATH = FULLPATH FILE_ENCODING = FILE_ENCODING USER_ACTION = USER_ACTION. endif. endif.
As you can see at first a method is called which detects is scripting is active or not. If it is active it call the function module GUI_FILE_SAVE_DIALOG instead of FileSaveDialog of the SAPInfo Control module, which calls the native Windows dialog. This works independently from the SAP GUI for Windows version and from its settings.
Bingshui and Lim, which version of the SAP_BASIS package do you use?
You can detect the version as I described above.
Now we know the reason and we see that the behavior of the SAP GUI for Windows it is also dependent from the SAP backend, in this case from the SAP_BASIS component.
The function Module XML_EXPORT_DIALOG contains an input parameter I_APPLICATION, if a related application can be detected it will be opened after the download. The method GET_PC_APPLICATION of the class CL_SALV_GUI_DATA_PUBLISHER do that.
method get_pc_application. check cl_salv_gui_data_publisher=>c_gui_type_windows EQ gui_type. if platform eq cl_gui_frontend_services=>platform_mac or platform eq cl_gui_frontend_services=>platform_macosx or platform eq cl_gui_frontend_services=>platform_linux. "Linux exit. endif. if frontend eq cl_alv_bds=>mc_excel_frontend or frontend eq cl_alv_bds=>mc_xlsx_frontend or frontend eq cl_alv_bds=>mc_mhtml_frontend. data excel_file type string. call method cl_gui_frontend_services=>registry_get_value exporting root = cl_gui_frontend_services=>hkey_classes_root key = 'ExcelWorksheet\protocol\StdFileEditing\server' value = '' importing reg_value = excel_file. endif. value = excel_file. endmethod.
As we can see it detects, in case of Excel download, via a registry entry the Excel application and the FM XML_EXPORT_DIALOG starts the application via cl_gui_frontend_services=>execute.
What does this mean: An automation workflow that downloads Excel data from an SAP back-end system behaves differently in dependency if an Excel application is installed or not.
thanks for your reply.
Now we know that between SAP_BASIS release 740 PL3 and 751 PL19 a change has been made to the dialog for XML export in ALV whether SAP GUI Scripting is used or not. This is a very important insight @LevKushnir.
How many records do you want to export from your table?
I tried the same approach as you and it works so far, as long as the dialog appears within the timeout of 30 seconds. The Save as… dialog is a normal window and can also be treated with the same automatisms. The only difference here is that the SAP backend prepares the data for export. If you have a lot of data, this also takes a lot of time. If you exceed the timeout, the error message will appear.
So I assume you want to export a larger amount of data and you are reaching the timeout before the SAP backend prepared the data. If this is the case you can find a great discussion, to handle this kind of requirement, here: How to Pause Automation Until Required Window Appears.
@bingshui-hl could that also been the reason for you?
Let us know your results.
my component version as attached
Maybe I’m not descript my problem clearly, my Save as dialog can popup， after that I want to us “type into” active to write file name in Save as dialog. my exact problem is type into active not work. The process stay at Save as dialog， no stop and no error message.
Hello Stefan and Lev
Good news, I use right “click” instead " Select Menu Item" active to download data, than the process go smoothly.
In my sample code, only < 10 records to be export. The Save As dialog actually prompted almost immediately after the menu selection. The problem is the automation process just stop when the Save As dialog box prompt, and then nothing happened. the TypeInto (change file name) and Click (Save) event is not carry out. seems like the robot is not able to control the Save As dialog box…
Do you also use SAP activities? Or you can try others instead.
For the menu i am using SAP activity. after the Save As dialog box, i just use the normal TypeInto and Click activities.
What other activities i can use to download data from SAP into Excel file in UIPath?
right click the data you want to download, select local file/spreadsheet…
use click instead SAP activities.
I see. Ok i will try this out. Thanks for your advise.
Hello Bingshui and Lim,
I tried that and it works without any problems. Here my approach.
The Save as… dialog is in the context of the download of XML files from an SAP system no problem.
Please post the parts of you XAML file which contains the error, so we can take a look at it.
I am able to call the Save As dialog box using the right mouse click method. However still i cannot input the file name. I use TypeInto event to change the file name directly but nothing happen. Then i use the Send Hot Key event (Alt+n) to move the cursor to the file name column. But the robot automatically save the default file name “Export.xlsx” and system prompt me “Export.xlsx” already existed error although i actually use TypeInto event to replace the filename. Did you change the file name when you export to Excel? how do you did it?
Good day all,
It is working by using the right click options.
thank you for your help.