<?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: FTP problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700812#M307258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you Find in the WEB or in the Forum, you will get lot of answers for the FTP from ABAP,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZFTPSAP LINE-SIZE 132.

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.

*-- Your SAP-UNIX FTP password (case sensitive)
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
*-- Your SAP-UNIX FTP user name (case sensitive)
       USER            = 'userid'
       PASSWORD        = MC_PASSWORD
*-- Your SAP-UNIX server host name (case sensitive)
       HOST            = 'unix-host'
       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.
  WRITE: / 'Error in FTP Command'.
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;&lt;/P&gt;&lt;P&gt;Here are the Some links ..&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.guidancetech.com/people/holland/sap/abap/yftp1.htm" target="test_blank"&gt;http://www.guidancetech.com/people/holland/sap/abap/yftp1.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Nov 2006 05:08:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-15T05:08:27Z</dc:date>
    <item>
      <title>FTP problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700810#M307256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I want to FTP txt files to an FTP site ... I have read the blog /people/thomas.jung3/blog/2004/11/15/performing-ftp-commands-from-abap ... I have checked the connection thru SM59 for SAPFTP &amp;amp; SAPFTPA ... it works fine ... &lt;/P&gt;&lt;P&gt;I used prg RSFTP002 using the command pwd and it gave the correct directory name...&lt;/P&gt;&lt;P&gt;I used prg RSFTP004 and an error message came up "Attempt to set up connection failed"&lt;/P&gt;&lt;P&gt;I used RSFTP005 and output is OK for RFC destination SAPFTP &amp;amp; SAPFTPA ..&lt;/P&gt;&lt;P&gt;I donno which parameters to use for prg RSEPSFTP ... so I left it ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; when I test FM FTP_CONNECT it says "User _____ has no access authorization for computer _______________ "... Please help me what should I do ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 05:01:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700810#M307256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T05:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: FTP problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700811#M307257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can use the FM : SXPG_COMMAND_EXECUTE also&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;- Gopi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 05:04:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700811#M307257</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2006-11-15T05:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: FTP problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700812#M307258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you Find in the WEB or in the Forum, you will get lot of answers for the FTP from ABAP,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZFTPSAP LINE-SIZE 132.

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.

*-- Your SAP-UNIX FTP password (case sensitive)
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
*-- Your SAP-UNIX FTP user name (case sensitive)
       USER            = 'userid'
       PASSWORD        = MC_PASSWORD
*-- Your SAP-UNIX server host name (case sensitive)
       HOST            = 'unix-host'
       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.
  WRITE: / 'Error in FTP Command'.
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;&lt;/P&gt;&lt;P&gt;Here are the Some links ..&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.guidancetech.com/people/holland/sap/abap/yftp1.htm" target="test_blank"&gt;http://www.guidancetech.com/people/holland/sap/abap/yftp1.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 05:08:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700812#M307258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T05:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: FTP problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700813#M307259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gopi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Can you please explain me more in detail ... I have used this FM in one of my previous program ... but that was just to Move or copy file ... how can I use this FM to FTP ??... Please explain&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;SB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 05:10:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700813#M307259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T05:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: FTP problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700814#M307260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sudheer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; the FM 'AB_RFC_X_SCRAMBLE_STRING' is not available in 4.6 C .. but I got a similar FM... HTTP_SCRAAMBLE ... while testing in SE37 what should be the parameters that I should pass to this FM ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 05:17:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700814#M307260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T05:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700815#M307261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 2 ways of executing FTP from an ABAP (online or batch mode),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initiated from the operating system. A script is available in the utility repository that explains how to do this very easily.&lt;/P&gt;&lt;P&gt;Initiated from the ABAP itself  An example is given below.&lt;/P&gt;&lt;P&gt;Create a logical OS command 'zftp'  using transaction SM69. Make sure that you enable 'command line parameter allowed' checkbox &lt;/P&gt;&lt;P&gt;Create a shell script called 'zftp' with the following lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RMTHOST=`echo $2 | tr '[A-Z]' '[a-z]'`&lt;/P&gt;&lt;P&gt;ftp -v $RMTHOST &amp;lt;&amp;lt; EOF &amp;gt; /out/zftp.$$ 2&amp;gt;&amp;amp;1&lt;/P&gt;&lt;P&gt;lcd /out&lt;/P&gt;&lt;P&gt;put $1&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;P&gt;EOF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the SXPG_COMMAND_EXECUTE function module to call this script (zftp) with the filename you want to transfer as the parameter. Eg:&lt;/P&gt;&lt;P&gt;call function 'SXPG_COMMAND_EXECUTE' &lt;/P&gt;&lt;P&gt;exporting &lt;/P&gt;&lt;P&gt;commandname = &lt;/P&gt;&lt;P&gt;tables &lt;/P&gt;&lt;P&gt;exec_protocol = &lt;/P&gt;&lt;P&gt;exceptions &lt;/P&gt;&lt;P&gt;no_permission = 1 &lt;/P&gt;&lt;P&gt;command_not_found = 2 &lt;/P&gt;&lt;P&gt;parameters_too_long = 3 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the Link for an Example program:- &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/fmodules/fms_execom.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/fmodules/fms_execom.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 05:32:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-problem/m-p/1700815#M307261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T05:32:10Z</dc:date>
    </item>
  </channel>
</rss>

