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 Error

Former Member
0 Likes
2,089


Dear experts,

I have trying to solve this problem from the last 2 days.Have gone through the forums and although people had encountered similar problems,no concrete answer could be found.

Iam using the FM FTP_Connect to connect to an ftp server.The interesting thing is it have been working for almost 1 year and suddenly now the FM module fails giving me the error "User not authorised to access the server".

The coding is as follows:

What could be problem:Any setting change or any other of that kind in the SAP or FTP server that I have to look into.

DATA:l_user(30) TYPE c VALUE 'qs123456', "user name of ftp server
       l_pwd(30) TYPE c VALUE '12345678', "password of ftp server
       l_host(64) TYPE c VALUE '130.40.43.12', "ip address of FTP server
       l_dest LIKE rfcdes-rfcdest VALUE 'SAPFTPA'."Background RFC destination

DATA: wrk_file TYPE char200,
        w_hdl TYPE i,
        c_key TYPE i VALUE 26101957,
        l_slen TYPE i.

DATA: text_tab1 TYPE truxs_t_text_data.
DATA: text_stab1 TYPE c.

*&---------------------------------------------------------------------*
*&      Form  scramble_password
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM scramble_password.
*http_scramble: used to scramble the password provided in a format recognized by sap.
  SET EXTENDED CHECK OFF.
  l_slen = STRLEN( l_pwd ).
  CALL FUNCTION 'HTTP_SCRAMBLE'
    EXPORTING
      SOURCE      = l_pwd
      sourcelen   = l_slen
      key         = c_key
    IMPORTING
      destination = l_pwd.
ENDFORM.                    "scramble_password

*&---------------------------------------------------------------------*
*&      Form  FTP_CONNECT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM ftp_connect .

  PERFORM scramble_password.

* To Connect to the Server using FTP
  CALL FUNCTION 'FTP_CONNECT'
    EXPORTING
      user            = l_user
      password        = l_pwd
      host            = l_host
      rfc_destination = l_dest
    IMPORTING
      handle          = w_hdl
    EXCEPTIONS
      tcpip_error     = 1
      command_error   = 2
      data_error      = 3
      OTHERS          = 4.

Thanks for any valuable inputs.

Regards
p

1 ACCEPTED SOLUTION
Read only

former_member215575
Active Participant
0 Likes
1,099

Are you able to connect with command prompt DOS commands? (CMD>> FTP>> OPEN host >> User name >> password). If No, same with SAP.

As per the error description, my understanding is that user authorizations have been changed on FTP server side. why don't you cross check with FTP server maintenance team?

2 REPLIES 2
Read only

former_member215575
Active Participant
0 Likes
1,100

Are you able to connect with command prompt DOS commands? (CMD>> FTP>> OPEN host >> User name >> password). If No, same with SAP.

As per the error description, my understanding is that user authorizations have been changed on FTP server side. why don't you cross check with FTP server maintenance team?

Read only

0 Likes
1,099

Yes,It didnt work with command prompt also.

Then the basis team found out that they changed something on the FTP server side.

With this error I also came to know that SAP supports only FTP and not SFTP.

Thanks anyway,