If you want to download iDocs as files, there are several standard SAP options. But, if you want to convert an iDoc in your SAP system as an XML, capabilities and limited. You may need to download an iDoc created in the system in XML format for multiple reasons. You may want to communicate iDoc
This will show you how to popup the save file dialog from selection screen. You can facilitate selection of file without manually entering file path. Selection: Result dialog: DATA: gv_filename TYPE string, gv_path TYPE string, gv_result TYPE i. SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-004. PARAMETERS: p_path TYPE string LOWER CASE. “File path SELECTION-SCREEN END OF BLOCK b4. AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path. * Display save dialog window CALL METHOD cl_gui_frontend_services=>file_save_dialog EXPORTING * window_title = ‘ ‘ default_extension = ‘txt’ default_file_name = ‘file_name’ initial_directory = ‘C:’ CHANGING filename = gv_filename path = gv_path fullpath = p_path user_action = gv_result.