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 |
DATA lv_file TYPE string VALUE 'C:\PATHTOFILE'. OPEN DATASET lv_file FOR INPUT IN BINARY MODE. CHECK sy-subrc = 0. DATA lv_binary TYPE xstring. READ DATASET lv_file INTO lv_binary. CLOSE DATASET lv_file. CHECK lv_binary IS NOT INITIAL. DATA lt_xstring TYPE STANDARD TABLE OF solix. DATA lv_output_length TYPE i. CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING buffer = lv_binary IMPORTING output_length = lv_output_length TABLES binary_tab = lt_xstring. cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_output_length filename = 'test.txt' filetype = 'BIN' CHANGING data_tab = lt_xstring EXCEPTIONS OTHERS = 24 ). |