[SAP CPI] – HOW TO CREATE XML FILE ON SFTP ON-PREMISE FROM CPI

Hi guys, in this article, I want to discuss about scenario transfer XML file from SFTP to another one. Kindly take a look this article https://sapzero2hero.com/2022/03/17/sap-cpi-how-to-install-and-configuration-sap-cloud-connector-scc/ for know how to setup and configure SCC.

Step 1 : Configure at SCC for SFTP node

  • Connect to SCC
  • Click on Cloud to On Premise at left side
  • At Cloud to On Premise screen, click Add
  • Back-end Type : Non-SAP System
  • Protocol : TCP
  • Internal Host : IP/server name of SFTP
  • Port or Port Range : 1 – 65535
  • Vitural host : alias name for external system call in ( ex : sftp.cloud)

After finish, we have screen look like :

Connection Reachable

Check on SAP BTP, one connection is published.

Step 2 : Get host key and import file know-host into Security Material

  • Login SAP BTP
  • Go to Subaccount
  • Go To Instances And Subscriptions
  • Go To Integration Suite Applications
  • Go to Design and develop…
  • Go to Monitor tab on left side
  • Go to Connectivity Tests
  • Choose tab SSH
  • Host : <Vitual host of SCC> ( Ex : SFTP.cloud)
  • Port : 22
  • Proxy Type : On-Premise
  • Authentication : None
  • Copy Host key
  • Create notepad file and paste this host key in there
  • Go back monitor on left menu
  • Go to Security Material below Manage Security Group
  • Choose Known Host (SSH) below Upload dropdown list

Step 3 : Create account to connect SFTP from SAP CPI

  • Go to Security Material below Manage Security Group
  • Click Create dropdown button at right side
  • Choose User Credential
  • Name : <Set name for this credential and use in config> ( ex : sftp_sender)
  • Type : User Credentials
  • User : <User used to connect sftp server>
  • Password : <Password of user used to connect sftp>
  • Click Deploy

Step 4 : Test connection to SFTP and particular folder

  • Go to Connectivity Test
  • Choose tab SSH
  • Host : <Vitural host of SFTP> (Ex : sftp.cloud)
  • Port : 22
  • Proxy Type : On-Premise
  • Authentication : User Credentials
  • Credential Name : sftp_sender ( Ref : Step 3 )
  • Host key verification : Against Tenant
  • Check Directory Access : Choose any folder on SFTP
  • Send
This is screenshot connect OK to SFTP and folder.

Step 5 : Create Integration Flow

  • Go to Integration Suite Application
  • Click on Design at left side
  • Create new packages
  • Go to packages, at tab Artifacts click Add dropdown button and choose Integration Flow
  • Add Sender adapter with Type HTTP
  • Add Receiver Adapter with Type SFTP and configure as below to connect to SFTP on-premise
  • Save & Deploy

Step 6 : Test scenarios

  • Go to Postman
  • Create new request with method POST
  • Create body xml
  • Send and check in folder SFTP, we see that one file xml created in here

Summary

In this article, I showed how to create XML file and send it to SFTP on-premise system. Thanks for your reading and any question, kindly leave your comment below this articles.

Regards.

Joseph.

3 comments

  1. Hi Huy,
    I was trying to connect from our TEST CPI to On-Premise SAP ECC AL11 folder using SFTP connection.
    It is connecting to server from the connectivity Tile from CPI but not able to connect to the directories even though we have full permissions.
    anything missing here ?
    Thank you.
    Sreeni.K

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.