<?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: SFTP using SAP Function Modules in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-using-sap-function-modules/m-p/4019491#M960419</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 and optimize this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZTESTFTPSAP                                                 *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTESTFTPSAP                             .&lt;/P&gt;&lt;P&gt;data: unixcom like   rlgrap-filename.   " ...SAP Interface file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of tabl occurs 500,&lt;/P&gt;&lt;P&gt;        line(400),&lt;/P&gt;&lt;P&gt;      end of tabl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lines type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of tlines occurs 0,&lt;/P&gt;&lt;P&gt;        line(90),&lt;/P&gt;&lt;P&gt;      end of tlines.&lt;/P&gt;&lt;P&gt;data: ffile(50) type c.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;  refresh tabl.&lt;/P&gt;&lt;P&gt;  refresh tlines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  append 'open ftp.yourserver.com:22' to tlines.&lt;/P&gt;&lt;P&gt;  append 'user=anonymous' to tlines.&lt;/P&gt;&lt;P&gt;  append 'pwd=pass' to tlines.&lt;/P&gt;&lt;P&gt;  append 'cd pub' to tlines.&lt;/P&gt;&lt;P&gt;  append 'close' to tlines.&lt;/P&gt;&lt;P&gt;  append 'bye' to tlines.&lt;/P&gt;&lt;P&gt;  ffile = 'c:\temp\ftp.txt'.&lt;/P&gt;&lt;P&gt;    OPEN DATASET ffile FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.&lt;/P&gt;&lt;P&gt;    loop at tlines.&lt;/P&gt;&lt;P&gt;      transfer tlines to ffile.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  CLOSE DATASET ffile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  unixcom = 'ftp -s:c:\temp\ftp.txt'.&lt;/P&gt;&lt;P&gt;  call 'SYSTEM' id 'COMMAND' field unixcom&lt;/P&gt;&lt;P&gt;                id 'TAB'     field tabl[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  describe table tabl lines lines.&lt;/P&gt;&lt;P&gt;  loop at tabl.&lt;/P&gt;&lt;P&gt;    write:/01 tabl-line.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  skip 2.&lt;/P&gt;&lt;P&gt;  if lines = 0.&lt;/P&gt;&lt;P&gt;    write:/ 'NO Occurances were found'.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    write:/ 'Command was successfully executed' color col_total.&lt;/P&gt;&lt;P&gt;    write:/ 'Number of entries in Search' color col_total,&lt;/P&gt;&lt;P&gt;             lines color 6.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jun 2008 16:38:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-24T16:38:46Z</dc:date>
    <item>
      <title>SFTP using SAP Function Modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-using-sap-function-modules/m-p/4019490#M960418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are working on SAP 4.7 system, and have a requirement to SFTP some files from our server to an external server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are sending files to many other servers using function module FTP_CONNECT. This FM works where Port 23 is active. But for the new server it has only SSH (22) and HTTPS (443) ports available, so the FTP_CONNECT FM fails. We have tried sending the files from Putty using statement SFTP &amp;lt;ID&amp;gt;@&amp;lt;IP&amp;gt; and it worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does any one know how we can do SFTP from SAP reports? Please note that as per the SAP help I have already tried using FM FTP_CONNECT with HOST_NAME as '&amp;lt;IP&amp;gt; space 22'. But it didnt work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waiting for your valuable updates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jun 2008 07:24:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-using-sap-function-modules/m-p/4019490#M960418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-23T07:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP using SAP Function Modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-using-sap-function-modules/m-p/4019491#M960419</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 and optimize this example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZTESTFTPSAP                                                 *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTESTFTPSAP                             .&lt;/P&gt;&lt;P&gt;data: unixcom like   rlgrap-filename.   " ...SAP Interface file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of tabl occurs 500,&lt;/P&gt;&lt;P&gt;        line(400),&lt;/P&gt;&lt;P&gt;      end of tabl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lines type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of tlines occurs 0,&lt;/P&gt;&lt;P&gt;        line(90),&lt;/P&gt;&lt;P&gt;      end of tlines.&lt;/P&gt;&lt;P&gt;data: ffile(50) type c.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;  refresh tabl.&lt;/P&gt;&lt;P&gt;  refresh tlines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  append 'open ftp.yourserver.com:22' to tlines.&lt;/P&gt;&lt;P&gt;  append 'user=anonymous' to tlines.&lt;/P&gt;&lt;P&gt;  append 'pwd=pass' to tlines.&lt;/P&gt;&lt;P&gt;  append 'cd pub' to tlines.&lt;/P&gt;&lt;P&gt;  append 'close' to tlines.&lt;/P&gt;&lt;P&gt;  append 'bye' to tlines.&lt;/P&gt;&lt;P&gt;  ffile = 'c:\temp\ftp.txt'.&lt;/P&gt;&lt;P&gt;    OPEN DATASET ffile FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.&lt;/P&gt;&lt;P&gt;    loop at tlines.&lt;/P&gt;&lt;P&gt;      transfer tlines to ffile.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  CLOSE DATASET ffile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  unixcom = 'ftp -s:c:\temp\ftp.txt'.&lt;/P&gt;&lt;P&gt;  call 'SYSTEM' id 'COMMAND' field unixcom&lt;/P&gt;&lt;P&gt;                id 'TAB'     field tabl[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  describe table tabl lines lines.&lt;/P&gt;&lt;P&gt;  loop at tabl.&lt;/P&gt;&lt;P&gt;    write:/01 tabl-line.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  skip 2.&lt;/P&gt;&lt;P&gt;  if lines = 0.&lt;/P&gt;&lt;P&gt;    write:/ 'NO Occurances were found'.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    write:/ 'Command was successfully executed' color col_total.&lt;/P&gt;&lt;P&gt;    write:/ 'Number of entries in Search' color col_total,&lt;/P&gt;&lt;P&gt;             lines color 6.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2008 16:38:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sftp-using-sap-function-modules/m-p/4019491#M960419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-24T16:38:46Z</dc:date>
    </item>
  </channel>
</rss>

