IF not down_f[] is INITIAL.
Case Down_mode. The download mode is placed under the selected path. TXT in the document
When ' X '.
Call FUNCTION ' Ws_download '
Exporting
CODEPAGE = file_encoding
FILENAME = P_file
* filetype = ' ASC '
* trunc_trailing_blanks = ' X '
TABLES
Data_tab = Down_f
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.
When SPACE.
* Call FUNCTION ' List_to_asci '
* Exporting
* List_index = List_index
* TABLES
* Listasci = Down_f
* LISTOBJECT = Abap_list
* EXCEPTIONS
* List_index_invalid = 1
* OTHERS = 2.
* IF SY-SUBRC <> 0.
* Clear msg_str. Msg_str = ' Error in convert ASCII '.
* MESSAGE msg_str TYPE ' E '.
* ENDIF.
*
Call FUNCTION ' Gui_download '
Exporting
CODEPAGE = file_encoding
filename = filename
FILETYPE = ' ASC '
trunc_trailing_blanks = ' X '
TABLES
Data_tab = Down_f
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.
When OTHERS.
Endcase.
IF SY-SUBRC = 0.
MESSAGE TEXT-004 TYPE ' S '.
ENDIF.
ENDIF.
ABAP Download TXT file