<?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: Creating A File Using FTP Commands in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363964#M523244</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just want to clarify something with the code you sent: is the &amp;lt;b&amp;gt;result&amp;lt;/b&amp;gt; table in your code the internal table containing the text file's contents?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jun 2007 09:37:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-19T09:37:36Z</dc:date>
    <item>
      <title>Creating A File Using FTP Commands</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363961#M523241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! Could someone please help me with this one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The requirement calls for a simple text file to be created in a different server.  What is currently used is the WS_DOWNLOAD function, but it is not working properly, probably due to two things: the target folder path and filename is too long, or that the program is to be run in the background.  The result is that the file is being saved in a different path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking into using FTP functions (FTP_CONNECT, FTP_COMMAND, FTP_DISCONNECT), but I have no prior experience in using this.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably my question is how to use the FTP_COMMAND, and which command to use in order to create the file?  It should mimic the WS_DOWNLOAD function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 05:12:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363961#M523241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T05:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A File Using FTP Commands</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363962#M523242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;        for sending the data to the target system i am using FTP_COMMAND by passing the 'put' statement along with the soruce and destinations for the command parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the bellow code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE 'put' v_fname '&lt;BR /&gt;' 'wbrs1\' folder&lt;/P&gt;&lt;P&gt;into cmd separated by space.&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;P&gt;HANDLE = dhdl&lt;/P&gt;&lt;P&gt;command = cmd&lt;/P&gt;&lt;P&gt;COMPRESS = 'N'&lt;/P&gt;&lt;UL&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;RFC_DESTINATION =&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 = result&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;TCPIP_ERROR = 1&lt;/P&gt;&lt;P&gt;COMMAND_ERROR = 2&lt;/P&gt;&lt;P&gt;DATA_ERROR = 3&lt;/P&gt;&lt;P&gt;OTHERS = 4&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here v_name is the file path and name in the application server suppose say :&lt;/P&gt;&lt;P&gt;/usr/sap/TD2/DVEBMGS01/work/TD2_20060901_1008_WAY-LY.XLS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and wbrs1 is the target system and 'Waynesboro DFS' is the folder name i ma passing to the command .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also  tried with the following statement &lt;/P&gt;&lt;P&gt;CONCATENATE 'put' v_fname '&lt;BR /&gt;' dhost folder&lt;/P&gt;&lt;P&gt;into cmd separated by space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate '&lt;BR /&gt;wbrs1\' folder into cmd.&lt;/P&gt;&lt;P&gt;concatenate 'put' v_fname cmd into cmd separated by space&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 05:18:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363962#M523242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T05:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A File Using FTP Commands</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363963#M523243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is the code  for   downloading to any  palce in the server.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETERS: p_file like rlgrap-filename.

* Internal table to store export data   
  DATA: begin of it_excelfile occurs 0,
   row(500) type c,
   end of it_excelfile.
   CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
*          BIN_FILESIZE            =
           filename                = p_file         "File name
           filetype                = 'ASC'          "File type
*     IMPORTING
*          FILELENGTH              =
      TABLES
           data_tab                = it_excelfile   "Data table
      EXCEPTIONS
           file_write_error        = 1
           no_batch                = 2
           gui_refuse_filetransfer = 3
           invalid_type            = 4
           OTHERS                  = 5.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE i003(zp) WITH
               'There was an error during Excel file creation'(200).
      exit. "Causes short dump if removed and excel document was open  
    ENDIF.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points  if it is usefull ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 05:21:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363963#M523243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T05:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A File Using FTP Commands</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363964#M523244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just want to clarify something with the code you sent: is the &amp;lt;b&amp;gt;result&amp;lt;/b&amp;gt; table in your code the internal table containing the text file's contents?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 09:37:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363964#M523244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T09:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating A File Using FTP Commands</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363965#M523245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use following code also to move the files from one directory to another in an application Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE mv &amp;lt;file_path&amp;gt; &amp;lt;dir&amp;gt; INTO &amp;lt;local_var&amp;gt; SEPARATED BY space.&lt;/P&gt;&lt;P&gt;  CALL 'SYSTEM' ID 'COMMAND' FIELD &amp;lt;local_var&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Devesh Singh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 09:59:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-a-file-using-ftp-commands/m-p/2363965#M523245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T09:59:01Z</dc:date>
    </item>
  </channel>
</rss>

