Skip to Content
0
Aug 10, 2013 at 05:39 AM

FTP_R3_TO_SERVER : Uploading binary file (.XLS)

506 Views

Hi Experts,

Im using FTP_R3_TO_SERVER FM to upload an Excel file from the user desktop.

CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = g_file
IMPORTING
filelength = g_len
CHANGING
data_tab = g_data
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
others = 19
.
IF sy-subrc <> 0.
message 'Error occured while uploading file' type 'S'.
leave LIST-PROCESSING.
ENDIF.


call function 'FTP_R3_TO_SERVER'
exporting
handle = w_hdl
fname = wrk_file "file path of destination system
character_mode = ' '
BLOB_LENGTH = BLOB_LEN
tables
blob =g_data
exceptions
tcpip_error = 1
command_error = 2
data_error = 3
others = 4.

How to find the BLOB_LEN ? Now the file is getting uploaded.. but only partial data is there.

Please help