*---------------------------------------------------------------------* * FORM ask_for_filename *---------------------------------------------------------------------* * [+] Asks the user to choose the output filename/directory via a * file chooser popup *---------------------------------------------------------------------* FORM ask_for_filename CHANGING p_fullpath TYPE string. DATA: lv_title TYPE string, lv_filter TYPE string, lv_ext TYPE string, lv_file TYPE string, lv_path TYPE string, lv_fullpath TYPE string, lv_action TYPE i. * popup properties lv_title = 'Save File'. lv_filter = 'PDF files (*.pdf)|*.pdf|'. lv_ext = 'pdf'. * Ask the user for the filename CALL METHOD cl_gui_frontend_services=>file_save_dialog EXPORTING window_title = lv_title file_filter = lv_filter default_extension = lv_ext CHANGING filename = lv_file path = lv_path fullpath = lv_fullpath user_action = lv_action EXCEPTIONS OTHERS = 99. IF sy-subrc = 0 AND lv_action = cl_gui_frontend_services=>action_ok. * set the value if the user clicked OK and there were no errors p_fullpath = lv_fullpath. ENDIF. ENDFORM.