Hello,
Please see note 1809258 - Internal program error; ( <program name> SAPLC13Z 0 C13Z_RAWDATA_READ )
A possibile solution is to use cl_gui_frontend_services class methods like gui_download and gui_upload, for instance:
TYPES: t_line(1) type x.
DATA: i_tab TYPE STANDARD TABLE OF t_line,
i_wa(1) type x.
OPEN DATASET lv_file_appl FOR INPUT IN BINARY MODE.
DO.
CLEAR i_wa.
READ DATASET lv_file_appl INTO i_wa.
IF SY-SUBRC <> 0.
EXIT.
ELSE.
APPEND i_wa TO i_tab.
ENDIF.
ENDDO.
CLOSE DATASET lv_file_appl.
DATA: lv_fn TYPE string.
lv_fn = lv_file_name.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = lv_fn
filetype = 'BIN'
append = ' '
CHANGING
data_tab = i_tab
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 24.
* old functioanlity
* CALL FUNCTION 'C13Z_FILE_DOWNLOAD_BINARY'
* EXPORTING
* i_file_front_end = lv_file_name
* i_file_appl = lv_file_appl
* i_file_overwrite = 'X'
** IMPORTING
** E_FLG_OPEN_ERROR = false
** E_OS_MESSAGE = lv_message
* EXCEPTIONS
* fe_file_open_error = 1
* fe_file_exists = 2
* fe_file_write_error = 3
* ap_no_authority = 4
* ap_file_open_error = 5
* ap_file_empty = 6
* OTHERS = 7
* .
This is for the download, similarly should be done for the upload.
Hope this could help. Let me know if further details are needed.
Thank you and bye,
Flavio