Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Dushyant_Garg
Explorer

Pre-requisite:

  1. SFTP server details if you have, else we will create a SFTP free server.
  2. FileZilla installed in your system to check the server files.

Steps:

1. Go to https://sftpcloud.io/tools/free-sftp-server website and create a free SFTP server for learning. It will valid for 1 hour only.

Dushyant_Garg_0-1709713053291.png

 

Dushyant_Garg_1-1709713053294.png

 

 2. Check your server in FileZilla.

Dushyant_Garg_2-1709713053295.png

 

 

Dushyant_Garg_3-1709713053296.png

 

 3. Now we need to add the connection in our CPI Tenant.

4. Open Tenant. Go to connection tests in monitor section to get the host key.

Dushyant_Garg_4-1709713053300.png

 

 5. Copy the host key and paste in notepad file and save it with the name known.hosts.

Dushyant_Garg_5-1709713053303.png

 

 6. Upload the known.hosts file in security material known hosts and deploy it.

Dushyant_Garg_6-1709713053304.png

 

 7. Add the user credentials of your SFTP server.

Dushyant_Garg_7-1709713053306.png

 

 8. Create Artifact in which we need to pull the file from SFTP server and log the data in CPI using groovy and send to the SFTP server appending timestamp.

Dushyant_Garg_8-1709713053308.png

 

 9. Configure SFTP.

Dushyant_Garg_9-1709713053311.png

 

 10. Add logging groovy.

 

import com.sap.gateway.ip.core.customdev.util.Message;

import java.util.HashMap;

def Message processData(Message message) {

    def body = message.getBody(java.lang.String) as String;

    def messageLog = messageLogFactory.getMessageLog(message);

    if(messageLog != null){

        messageLog.setStringProperty("Logging#1", "Printing Payload As Attachment")

        messageLog.addAttachmentAsString("ResponsePayload:", body, "text/plain");

     }

    return message;

}

 

 11. Configure Receiver SFTP.

Dushyant_Garg_10-1709713053314.png

 

 12. Before deploying add a test file in SFTP server using filezilla.

13. Deploy the Artifact and check your SFTP server does the file exist with timestamp.

 

Thankyou

Dushyant

Labels in this area