<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error using 'FTP_CONNECT' IN RFC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-using-ftp-connect-in-rfc/m-p/3851848#M925955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nobody knows why FTP_CONNECT doesn't work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 May 2008 08:12:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-22T08:12:30Z</dc:date>
    <item>
      <title>Error using 'FTP_CONNECT' IN RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-using-ftp-connect-in-rfc/m-p/3851845#M925952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm calling an RFC from system A to system B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In system B the RFC must read a flat file via FTP using FM 'FTP_CONNECT' and 'FTP_SERVER_TO_R3'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The connection parameters (user, password, host...) are incrusted in the code. When I test the RFC in local machine it works perfectly, it reads the file and returns the result. But when I call it remotely it doesn't works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've generated a log of the execution and I've found that the problem is when I call 'FTP_CONNECT'. It gives me an EXCEPTION (NOT_CONNECED) but I don't know why... The parameters are the same when I test and when I call it remotely...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I do to solve that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2008 17:46:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-using-ftp-connect-in-rfc/m-p/3851845#M925952</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-21T17:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error using 'FTP_CONNECT' IN RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-using-ftp-connect-in-rfc/m-p/3851846#M925953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this sample code:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZKBTST32 LINE-SIZE 132.
*-----------------------------------------------------------------------
* Test SAP FTP functions
*-----------------------------------------------------------------------

DATA: BEGIN OF MTAB_DATA OCCURS 0,
LINE(132) TYPE C,
END OF MTAB_DATA.

DATA: MC_PASSWORD(20) TYPE C,
MI_KEY TYPE I VALUE 26101957,
MI_PWD_LEN TYPE I,
MI_HANDLE TYPE I.

START-OF-SELECTION.

MC_PASSWORD = 'password'.

DESCRIBE FIELD MC_PASSWORD LENGTH MI_PWD_LEN.

*-- FTP_CONNECT requires an encrypted password to work
CALL 'AB_RFC_X_SCRAMBLE_STRING'
     ID 'SOURCE' FIELD MC_PASSWORD ID 'KEY' FIELD MI_KEY
     ID 'SCR' FIELD 'X' ID 'DESTINATION' FIELD MC_PASSWORD
     ID 'DSTLEN' FIELD MI_PWD_LEN.

CALL FUNCTION 'FTP_CONNECT'
     EXPORTING
       USER            = 'userid'
       PASSWORD        = MC_PASSWORD
       HOST            = 'servername'
       RFC_DESTINATION = 'SAPFTP'
     IMPORTING
       HANDLE          = MI_HANDLE
     EXCEPTIONS
       NOT_CONNECTED   = 1
       OTHERS          = 2.

CHECK SY-SUBRC = 0.

CALL FUNCTION 'FTP_COMMAND'
     EXPORTING
       HANDLE = MI_HANDLE
       COMMAND = 'dir'
     TABLES
       DATA = MTAB_DATA
     EXCEPTIONS
       TCPIP_ERROR = 1
       COMMAND_ERROR = 2
       DATA_ERROR = 3
       OTHERS = 4.

IF SY-SUBRC = 0.
  LOOP AT MTAB_DATA.
    WRITE: / MTAB_DATA.
  ENDLOOP.
ELSE.
* do some error checking.
ENDIF.

CALL FUNCTION 'FTP_DISCONNECT'
     EXPORTING
       HANDLE = MI_HANDLE
     EXCEPTIONS
       OTHERS = 1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2008 17:48:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-using-ftp-connect-in-rfc/m-p/3851846#M925953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-21T17:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error using 'FTP_CONNECT' IN RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-using-ftp-connect-in-rfc/m-p/3851847#M925954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naren,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already know how to use FTP_CONNECT. I've programmed my Function module and it works OK. The problem is when I execute it remotely, I don't know why but FTP_CONNECT gives me an error when I use it via RFC...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2008 17:51:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-using-ftp-connect-in-rfc/m-p/3851847#M925954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-21T17:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error using 'FTP_CONNECT' IN RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-using-ftp-connect-in-rfc/m-p/3851848#M925955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nobody knows why FTP_CONNECT doesn't work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 May 2008 08:12:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-using-ftp-connect-in-rfc/m-p/3851848#M925955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-22T08:12:30Z</dc:date>
    </item>
  </channel>
</rss>

