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

FTP_Connect

Former Member
0 Likes
1,722

Dear Friends,

I know there are lots of thread for FTP_Connect but still my query is not resolved so I thought I should post a new query.

I am trying to use FTP_Connect FM for doing FTP to another server. I am passing all the requisite parameters to this function module i.e. User Name, Password, Hots name and FRC destination but still not able to connect to the server.

When I try to connect from the OS level or from command prompt I am able to login onto the FTP server and do the operation but not from SAP.

I would request If anyone has done this in thepast and someone can sincerely advise me on this.

Many thanks.

Regards,

Sushil Pathak

Dear Friends,

I know there are lots of thread for FTP_Connect but still my query is not resolved so I thought I should post a new query.

I am trying to use FTP_Connect FM for doing FTP to another server. I am passing all the requisite parameters to this function module i.e. User Name, Password, Hots name and FRC destination but still not able to connect to the server.

When I try to connect from the OS level or from command prompt I am able to login onto the FTP server and do the operation but not from SAP.

I would request If anyone has done this in thepast and someone can sincerely advise me on this.

Many thanks.

Regards,

Sushil Pathak

11 REPLIES 11
Read only

Former Member
0 Likes
1,596

Hi,

Check SAP standard prog: 'RSEPSFTP'

Thanks,

Krishna

Read only

Former Member
0 Likes
1,596

Hello -

Use the following:

CALL FUNCTION 'FTP_CONNECT'
    EXPORTING
      user            = lv_user
      password        = lv_passwd
      host            = lv_host
      rfc_destination = lc_dest
    IMPORTING
      handle          = lv_handle
    EXCEPTIONS
      not_connected   = 1
      OTHERS          = 2.

Make sure Username, Password and RFC destination are given correctly.

Thanks,

Read only

0 Likes
1,596

I tried doing the same thing but I am getting sy-subrc as 1.

Regards,

Sushil

Read only

0 Likes
1,596

Hello -

Check if the RFC destination is maintained in RFCDES table.

Read only

0 Likes
1,596

Yes the RFC destination is maintained in the RFCDES table.

Read only

0 Likes
1,596

Is the RFCTYPE in RFCDES table set to 'T' (Start an external program via TCP/IP) for the RFC destination you are giving?

Read only

0 Likes
1,596

Yes it is of type 'T' .

Read only

0 Likes
1,596

Hello -

Try using the following before you call the FTP_CONNECT

slen = strlen( pwd ).

call function 'HTTP_SCRAMBLE'
  exporting
    source      = pwd
    sourcelen   = slen
    key         = key
  importing
    destination = pwd.

Now use this password which you get from the above FM in the FTP_CONNECT. Guess you are facing the problem due to some kind of password encryption.

Thanks,

Read only

0 Likes
1,596

for Creating RFC Destination for FTP.

Run program: RSFTP005.

The RFC destinations SAPFTP and SAPFTPA will be created automatically.

SAPFTP (for local system)

SAPFTPA (for running in Application server)(This is used for file transfer in background.

Code sample for developing FTP programs can be got from report program

RSFTP002

RSFTP007

RSFTP008

Read only

0 Likes
1,596

Thanks Vijay, I will try it out and will let you know.

Regards,

Sushil

Read only

0 Likes
1,596

Hi,

Do you have how to handle Chinese character in text file by using SAPFTP and SAPFTPA ?

Because we found there is no problem to read Chinese character by SAPFTP.

But when we use schedule job and read file from FTP server in background by SAPFTPA, same file, same Chinese characters cannot read normally ....

Can anyone help ?

Thanks.