Skip to Content

How to upload/download data file/to from SFTP server in SAP?

Hello Team,

Client is saving .CSV file in SFTP server on daily basis. we need to fetch it from ABAP custom program and need to do some required data operations.

Could you please help me to fetch that file from SFTP server.? is FM-SXPG_COMMAND_EXECUTE is the right FM to solve this issue? If Yes, then what will be the 'Actual parameters value' needs to pass?. is there any sample ABAP program code?

Note : 1. This is SFTP related issue not FTP.

2. I have created a command using SM69.

3. I am using to connect SFTP server using FM- 'SXPG_COMMAND_EXECUTE'.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Sep 18, 2018 at 12:00 PM

    Hi,

    You can check the where-used of this function module to see how SAP fills the parameters.

    Kind regards, Rob Dielemans

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 18, 2018 at 12:53 PM

    Yes it is possible with SFTP (or others, for example LFTP) "command line" command.

    You need to explore how to use your selected command and its parameters (it is not ABAP related) and you can then call it with SXPG_COMMAND_EXECUTE in ABAP.


    I used LFTP command + SXPG_COMMAND_EXECUTE to upload files to SFTP server in one ABAP class for SFTP and it works OK.

    Example bash for upload:

    lftp sftp://login:password@host:port -e "cd dir; put filename.csv; ls; bye"
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.