title: How can I use sftp with SAP?
body: <p>Currently we use FTP, but there is a requirement to use SFTP.  According to our Basis guys SFTP will not work.  We have a couple of alternatives:</p>
  
  <ul>
  <li>Use PI</li>
  <li>Use a Unix script to move the files</li>
  </ul>
  
  <p>However, is there something we are missing that would enable us to use SFTP in a similar way to FTP?</p>
  
  <h2>Example of code calling FTP:</h2>
  
  <pre><code>  CALL FUNCTION 'HTTP_SCRAMBLE'  
      EXPORTING  
        SOURCE      = i_password
        sourcelen   = dstlen
        key         = c_key
      IMPORTING
        destination = lw_password.
  
    CLEAR: ftp_hdl, o_file.
    CALL FUNCTION 'FTP_CONNECT'
      EXPORTING
        user            = i_user
        password        = lw_password
        host            = i_host
        rfc_destination = c_rfcdest_sapftp
      IMPORTING
        handle          = ftp_hdl
      EXCEPTIONS
        not_connected   = 1
        OTHERS          = 2.
  </code></pre>
  
  <h2>RFC Destination <code>c_rfcdest_sapftp</code> is defined as follows in SM59:</h2>
  
  <p>Connection Type: T (TCP/IP)<br>
  Activation Type: Start on Front-end Work Station<br>
  Program:         sapftp (Is there a SFTP variant of the program?)<br>
  Start Type:      Default Gateway</p>