<?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 Commands in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-commands/m-p/3589762#M864335</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;Thanks for your prompt reply. I would just like to confirm that if I put a value of ASCII to wa_command parameter of FM FTP_COMMAND, will this retrieve the files from the server? And that the file will be stored in internal table result_itab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Louisse&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Apr 2008 09:15:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-02T09:15:12Z</dc:date>
    <item>
      <title>FTP Commands</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-commands/m-p/3589760#M864333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to connect to another server via FTP, and I am using FTP_CONNECT for that. After connection is established, I need to get the file based on the directory. How do I do that? I found FM FTP_COMMAND, but what command should I use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'FTP_COMMAND'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    HANDLE                =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      command               =&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    COMPRESS              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    RFC_DESTINATION       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    VERIFY                =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    FILESIZE              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    FILEDATE              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    FILETIME              =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      data                  =&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    TCPIP_ERROR           = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    COMMAND_ERROR         = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    DATA_ERROR            = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    OTHERS                = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What value should I pass to each field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Louisse&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:01:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-commands/m-p/3589760#M864333</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Commands</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-commands/m-p/3589761#M864334</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;PRE&gt;&lt;CODE&gt;

*--&amp;gt; Scramble the password.

CALL FUNCTION 'SCRAMBLE_STRING'
EXPORTING
source = password
key = 26101957
IMPORTING
target = password.

*--&amp;gt; Connect to the FTP server.

* user is the logon user for the FTP server.


password is the password you have just scrambled. 
host is the ip address of the FTP server. 
rfc_destination is 'SAPFTPA'. 

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.

*--&amp;gt; Carry out the command on the FTP server

* wa_command is the command you wish to carry out on the FTP server (e.g. 


wa_command = 'ascii' will specify ascii mode). Result_itab will contain the 
result of your commands. 
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = wa_handle
command = wa_command
TABLES
data = result_itab
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.



*--&amp;gt; Disconnect from the target host.

CHECK NOT wa_handle IS INITIAL.

CALL FUNCTION 'FTP_DISCONNECT'
EXPORTING
handle = wa_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;The IMPORT parameters are as :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USER i.e the userid &lt;/P&gt;&lt;P&gt;PASSWORD,&lt;/P&gt;&lt;P&gt;HOST i.e the FTP server&lt;/P&gt;&lt;P&gt;RFC_DESTINATION ( the parameter passed corresponding to this must be of type RFCDES_RFCDEST ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All these IMPORT parameters except RFC_DESTINATION are of TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The EXPORT parameter is the&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HANDLE ( this identifies the FTP connection ). Its of TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Runal Singh on Apr 2, 2008 2:40 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:09:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-commands/m-p/3589761#M864334</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Commands</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-commands/m-p/3589762#M864335</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;Thanks for your prompt reply. I would just like to confirm that if I put a value of ASCII to wa_command parameter of FM FTP_COMMAND, will this retrieve the files from the server? And that the file will be stored in internal table result_itab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Louisse&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 09:15:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-commands/m-p/3589762#M864335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-02T09:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: FTP Commands</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-commands/m-p/3589763#M864336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Go through this blog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Link : [https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/4743] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result_itab will have values like &lt;/P&gt;&lt;P&gt;1.FTP is connected &lt;/P&gt;&lt;P&gt;2.local directory has been changed&lt;/P&gt;&lt;P&gt;3.File has been placed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This approach is used to get the file from legacy and put it into application server then you can read the file with Open dataset and read dataset command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rajesh Pichholiya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2008 10:28:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-commands/m-p/3589763#M864336</guid>
      <dc:creator>shrirajesh_pichholiya</dc:creator>
      <dc:date>2008-04-02T10:28:51Z</dc:date>
    </item>
  </channel>
</rss>

