<?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: Transfer Internal table data to FTP file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-internal-table-data-to-ftp-file/m-p/7422259#M1549480</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; Can you check in debugging that in 'FTP_R3_TO_SERVER' function  which value 'ftp_handles' internal table is getting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mukund  Kansara on Nov 2, 2010 2:36 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Nov 2010 13:36:14 GMT</pubDate>
    <dc:creator>mukundkansara</dc:creator>
    <dc:date>2010-11-02T13:36:14Z</dc:date>
    <item>
      <title>Transfer Internal table data to FTP file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-internal-table-data-to-ftp-file/m-p/7422258#M1549479</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 am trying to create an Excel File in FTP using an Internal table data.&lt;/P&gt;&lt;P&gt;I am able to create the file. But there is no data transferred.&lt;/P&gt;&lt;P&gt;Only empty file is being created&lt;/P&gt;&lt;P&gt;Help me with any solution &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'HTTP_SCRAMBLE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      SOURCE      = l_pwd&lt;/P&gt;&lt;P&gt;      sourcelen   = l_slen&lt;/P&gt;&lt;P&gt;      key         = c_key&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      destination = l_pwd.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To Connect to the Server using FTP&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'FTP_CONNECT'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      user            = 'FTP_MIGDE'&lt;/P&gt;&lt;P&gt;      password        = l_pwd&lt;/P&gt;&lt;P&gt;      host            =     l_host&lt;/P&gt;&lt;P&gt;      rfc_destination = 'SAPFTP'&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      handle          = gv_hdl&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      OTHERS          = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Delete the existing file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONCATENATE 'del' g_file INTO gv_delfile SEPARATED BY space.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'FTP_COMMAND'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      handle        = gv_hdl&lt;/P&gt;&lt;P&gt;      command       = 'cd folder'&lt;/P&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;      command_error = 1&lt;/P&gt;&lt;P&gt;      tcpip_error   = 2.&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        = gv_hdl&lt;/P&gt;&lt;P&gt;      command       = gv_delfile&lt;/P&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;      command_error = 1&lt;/P&gt;&lt;P&gt;      tcpip_error   = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: gv_lines TYPE i,&lt;/P&gt;&lt;P&gt;        gv_length TYPE i.&lt;/P&gt;&lt;P&gt;*FTP_R3_TO_SERVER:used to transfer the internal table data as a file to other system in the character mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DESCRIBE TABLE gt_line_final LINES gv_lines.&lt;/P&gt;&lt;P&gt;  gv_length = gv_lines * 2000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'FTP_R3_TO_SERVER'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      handle         = gv_hdl&lt;/P&gt;&lt;P&gt;      fname          = g_file          "file path of destination system&lt;/P&gt;&lt;P&gt;      character_mode = 'X'&lt;/P&gt;&lt;P&gt;      blob_length    = gv_length&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      text           = gt_line_final&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;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4&lt;/P&gt;&lt;P&gt;    RAISING invalid_output_file.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*FTP_DISCONNECT: This is used to disconnect the connection between SAP and other system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To disconnect the FTP&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'FTP_DISCONNECT'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      handle = gv_hdl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*RFC_CONNECTION_CLOSE:This is used to disconnect the RFC connection between SAP and other system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RFC_CONNECTION_CLOSE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      destination = 'SAPFTP'&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      OTHERS      = 1.he R/3 Internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 13:23:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-internal-table-data-to-ftp-file/m-p/7422258#M1549479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-02T13:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Internal table data to FTP file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-internal-table-data-to-ftp-file/m-p/7422259#M1549480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; Can you check in debugging that in 'FTP_R3_TO_SERVER' function  which value 'ftp_handles' internal table is getting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mukund  Kansara on Nov 2, 2010 2:36 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 13:36:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-internal-table-data-to-ftp-file/m-p/7422259#M1549480</guid>
      <dc:creator>mukundkansara</dc:creator>
      <dc:date>2010-11-02T13:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Transfer Internal table data to FTP file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-internal-table-data-to-ftp-file/m-p/7422260#M1549481</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;Try this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: path type char256. 
path = '/home/test.txt'.  "FTP file localization with filename and extension
 open dataset path for output in text mode encoding default.
  if sy-subrc eq 0.
    loop at it_fil.
      if it_fil &amp;lt;&amp;gt; space.
        transfer it_fil to line.
      endif.
    endloop.
  else.
    exit.
  endif.
  close dataset line.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 11:50:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/transfer-internal-table-data-to-ftp-file/m-p/7422260#M1549481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-03T11:50:16Z</dc:date>
    </item>
  </channel>
</rss>

