Application Development and Automation 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: 
Read only

File upload from FTP server

Former Member
0 Likes
1,611

Hi,

I have requirement to upload file from FTP server

Using the function module FTP_CONEECT but it is getting failed

Is there any other way to do it Or any parameters I am missing

Thanks in advance

Sachin

Hi,

I have requirement to upload file from FTP server

Using the function module FTP_CONEECT but it is getting failed

Is there any other way to do it Or any parameters I am missing

Thanks in advance

Sachin

7 REPLIES 7
Read only

Former Member
0 Likes
873

Hi Sachin,

The FM FTP_CONNECT is only connect to a ftp server by specifying RFC destination, user name and password. It will not help u upload file from ftp location...

-Muktar

Read only

Former Member
0 Likes
873

Use the FM's in this order

1. CALL FUNCTION 'FTP_CONNECT'

2. CALL FUNCTION 'FTP_COMMAND'

3. CALL FUNCTION 'FTP_DISCONNECT'

Usage:

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

user = user

password = password

host = host

rfc_destination = rfc_destination

IMPORTING

handle = wa_handle

EXCEPTIONS

not_connected = 1

OTHERS = 2.

CALL FUNCTION 'FTP_COMMAND'

EXPORTING

handle = wa_handle

command = 'ASCII'

TABLES

data = result_itab

EXCEPTIONS

tcpip_error = 1

command_error = 2

data_error = 3

OTHERS = 4.

CALL FUNCTION 'FTP_DISCONNECT'

EXPORTING

handle = wa_handle

EXCEPTIONS

OTHERS = 1.

-Muktar

Read only

0 Likes
873

Thanks for reply

But I am getting error "Attempt to set up connection to ftp://.........failed"

parameters I am passing to 'FTP_CONNECT' are

USER ABC.

PASSWORD *****

HOST ftp://..................................

RFC_DESTINATION SAPFTPA

But if i try to log on by IE i can log into the server with same user ID and password

Is there any issue with RFC_DESTINATION?

Read only

0 Likes
873

Hi Sachin...

Go to Tcode SM59 and check the rfc destination...

-Muktar

Read only

0 Likes
873

Do we need to create new RFC destination ? if yes how should we create new one

I am using the same that is available in SAP

Read only

0 Likes
873

Hi Sachin,

Go to SM59-> select the rfc destination you are using and test connection... you will know if the rfc is working fine..

-Muktar

Read only

Former Member
0 Likes
873

hi,

go thro this link

http://www.sap-basis-abap.com/sapac008.htm

hope it helps..

Regards,

Vijayalakshmi B