SAP/ABAP
파일 upload - upload 파일 종류 file filter
DrkLion
2009. 9. 18. 14:18
DATA: lv_file TYPE string,
lv_filter type string,
lt_file_table TYPE filetable WITH HEADER LINE ,
lv_rc TYPE i.
lv_file = p_file.
lv_filter =
'Excel Files (*.xls)|*.xls|Excel 2007 Files (*.xlsx)|*.xlsx|All Files (*.*)|*.*|'.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Window Title'
default_filename = lv_file
file_filter = lv_filter
CHANGING
file_table = lt_file_table[]
rc = lv_rc
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.