1 PARAMETERS: num TYPE i. 2 TYPE-POOLS: truxs. "类型组 3 DATA:w_filename TYPE string. 4 TYPES:BEGIN OF ty_line. 5 INCLUDE STRUCTURE t001. 6 TYPES END OF ty_line. 7 DATA: itab TYPE STANDARD TABLE OF ty_line WITH DEFAULT KEY. 8 DATA: itab1 TYPE truxs_t_text_data. 9 SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE itab. 10 11 DO num TIMES. 12 CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT' "CSV格式 13 EXPORTING 14 i_field_seperator = ';' 15 TABLES 16 i_tab_sap_data = itab 17 CHANGING 18 i_tab_converted_data = itab1 19 EXCEPTIONS 20 conversion_failed = 1 21 OTHERS = 2. 22 CONCATENATE 'C:/TEMP/' sy-datum sy-uzeit '.txt' INTO w_filename. 23 CALL FUNCTION 'GUI_DOWNLOAD' "下载 24 EXPORTING 25 filename = w_filename 26 TABLES 27 data_tab = itab1 28 EXCEPTIONS 29 OTHERS = 1. 30 ENDDO.
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/18289.html