Skip to Content
0
Former Member
Apr 19, 2010 at 07:21 AM

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

79 Views

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