1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
TYPES BEGIN OF download_t. TYPES data TYPE string. TYPES END OF download_t. DATA t_download TYPE TABLE OF download_t WITH HEADER LINE. CONSTANTS: con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab. "conv itab to csv LOOP AT tt_record. CONCATENATE * tt_record-new_hash tt_record-external_card_nu tt_record-object_id tt_record-txt30 * tt_record-balance INTO t_download-data SEPARATED BY ';'. APPEND t_download. CLEAR t_download. ENDLOOP. DATA filename TYPE string. DATA path TYPE string. DATA fullpath TYPE string. CLEAR filename. CALL METHOD cl_gui_frontend_services=>gui_download EXPORTING * filename = filename filename = 'C:\test\sapar\es.csv' filetype = 'ASC' * write_field_separator = 'X' CHANGING data_tab = t_download[]. |
Еще один пример:
http://www.an-sap-consultant.com/2010/12/abap-download-tab-delimited-file-using.html