How can I use sftp with SAP?
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:
- Use PI
- Use a Unix script to move the files
However, is there something we are missing that would enable us to use SFTP in a similar way to FTP?
Example of code calling FTP:
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
开发者_JAVA百科 password = lw_password
host = i_host
rfc_destination = c_rfcdest_sapftp
IMPORTING
handle = ftp_hdl
EXCEPTIONS
not_connected = 1
OTHERS = 2.
RFC Destination c_rfcdest_sapftp
is defined as follows in SM59:
Connection Type: T (TCP/IP)
Activation Type: Start on Front-end Work Station Program: sapftp (Is there a SFTP variant of the program?) Start Type: Default GatewayAs odd as it is, SAP doesn't support SFTP out of the box. As I understand it, PI will do FTPS (which is different, I believe) There is at least one company selling a 3rd party bolt-on to PI to use SFTP. A quick Google will turn it up. That is what we had to do here to get SFTP & PGP encrypted files without invoking OS scripts.
EDIT: This is no longer a true statement. Please see the comments below.
At first I thought that this is also annoying, that the SAP PI cannot handle SFTP. Anyway, if you look at the protocol, it's ftp tunneled through ssh. At the moment there is a movement in the security community to ftps, due to the fact, that this protocol does not allow tunneling of other protocols and therefore is considered as more secure. Maybe you should think about establishing ftps, as it's a good alternative. If you are only using the PI as a middleware within the company or you don't have any FTP service which is accessible from outside it's a good chance to switch to ftps.
Regards
Matthias Kneissl
精彩评论