"1,GET FILENAME
CALL FUNCTION 'F4_FILENAME'.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
default_extension = 'XLS'
default_file_name = <lv_filename>
CHANGING
filename = <lv_filename>
path = <lv_path>
fullpath = <lv_fullpath>
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = <lv_filename>
def_path = <lv_path>
mask = ',*.xls,*.xls,'
mode = 'S' " O = open , S = save
* title = text-003
IMPORTING
filename = <lv_filename>
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
"2 文件操作
CALL METHOD cl_gui_frontend_services=>file_exist
EXPORTING
file = <path>
RECEIVING
result = <rc_result>
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
not_supported_by_gui = 4
OTHERS = 5.
'FILE_DELETE'
'FILE_COPY'
'FILE_OPEN_DIALOG'
'FILE_SAVE_DIALOG'
'EXECUTE'