FORM export_to_file.
DATA p_file1 LIKE rlgrap-filename.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
mask = ',*.*,*.*.'
IMPORTING
filename = p_file1
EXCEPTIONS
OTHERS = 1.
IF sy-subrc EQ 0.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = p_file1
filetype = 'ASC'
TABLES
data_tab = it_cls
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11.
IF SY-SUBRC EQ 0.
message i001 with '文件成功导出'.
ENDIF.
ELSE.
MESSAGE e001 WITH '没有得到文件名'.
ENDIF.
ENDFORM. " export_to_file
*注意 ecc6中已经修改成 gui_download
*使用DAT 有 TAB 分割
DATA p_file1 LIKE rlgrap-filename.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
mask = ',*.*,*.*.'
IMPORTING
filename = p_file1
EXCEPTIONS
OTHERS = 1.
IF sy-subrc EQ 0.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = p_file1
filetype = 'ASC'
TABLES
data_tab = it_cls
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11.
IF SY-SUBRC EQ 0.
message i001 with '文件成功导出'.
ENDIF.
ELSE.
MESSAGE e001 WITH '没有得到文件名'.
ENDIF.
ENDFORM. " export_to_file
*注意 ecc6中已经修改成 gui_download
*使用DAT 有 TAB 分割