Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FTP : New '.txt' file generated on server with no data

Former Member
0 Kudos

Hello,

I'm using FTP_R3_TO_SERVER Function Module to generate a file with some data on sever.

The I have wrriten is as follows,

gd_slen = STRLEN( p_pwd ).

CALL FUNCTION 'HTTP_SCRAMBLE'

EXPORTING

SOURCE = p_pwd

sourcelen = gd_slen

key = gd_key

IMPORTING

destination = p_pwd.

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

user = p_user

password = p_pwd

host = p_host

rfc_destination = p_dest

IMPORTING

handle = gd_hdl.

CALL FUNCTION 'FTP_COMMAND'

EXPORTING

handle = gd_hdl

command = 'ascii'

TABLES

data = it_result

EXCEPTIONS

tcpip_error = 1

command_error = 2

data_error = 3.

CALL FUNCTION 'FTP_R3_TO_SERVER'

EXPORTING

handle = gd_hdl

fname = gd_fname

blob_length = l_count

character_mode = 'X'

TABLES

text = it_final

EXCEPTIONS

TCPIP_ERROR = 1

COMMAND_ERROR = 2

DATA_ERROR = 3.

if sy-subrc = 0.

write: / 'File uploaded:', gd_fname.

endif.

it_final is an internal tabel which contains data which i need to keep in the file.

Now my problem is, when I execute this code , file is generated on server with 0 bytes (no data), where as my Internal table contains data with few line item.

What could be the problem? is it related to coding or some other settings?

Thanks,

Yogesh

1 REPLY 1

Former Member
0 Kudos

Hello All,

Just to update on this. 'm getting Exeption TCPIP_ERROR after the function module FTP_R3_TO_SERVER.

Here file is getting created with 0 bytes data.

Thanks,

Yogesh