Some times we want to download/upload the text symbol of text element into/from local file, we can use below report, It's very useful.
**********************************************************
report zz_download_text_pool.
parameters:
p_report like sy-repid, "report name handled
p_file like rlgrap-filename, "local file path
p_lang like sy-langu, "Langauge version
p_up type c radiobutton group 1, "Upload
p_down type c radiobutton group 1 default 'X'. "Download
data: it_text like textpool occurs 100 with header line.
start-of-selection.
************************
* Download
************************
If p_down = 'X'.
read textpool p_report into it_text language p_lang.
if sy-subrc = 0.
call function 'WS_DOWNLOAD'
exporting
filename = p_file
filetype = 'DAT'
tables
data_tab = it_text
exceptions
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
others = 8.
write: / 'ws_download : ', sy-subrc.
else.
write: / 'read textpool : ', sy-subrc.
endif.
else.
*************************
** Upload
*************************
call function 'WS_UPLOAD'
exporting
filename = p_file
filetype = 'DAT'
tables
data_tab = it_text
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
others = 8.
if sy-subrc = 0.
insert textpool p_report from it_text language p_lang.
write: / 'insert textpool : ', sy-subrc.
else.
write: / 'ws_upload : ', sy-subrc.
endif.
endif.