Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
Showing results for 
Search instead for 
Did you mean: 


In the previous blog post of this series we called a BAPI in the Cloud using a Java Program and the SAP Java Connector Librarier. In this Blog Post I will describe how to make an RFC call from SAP Cloud Platform Integration to an SAP On-Premise System. It also gave me the idea for the test case in the final Blog Post of this series.

Calling a BAPI in an SAP On-premise system from the Cloud

The principle set-up is depicted below.


What I used

  • A functional SAP Cloud Connector Instance + user with administrative privileges

  • An SAP Cloud Platform Integration tenant + user with administrative privileges

  • Postman on my Desktop

What I did

  • Set up Service Channel towards the OnPrem System

  • Maintain a Destination in the Cloud Cockpit Subaccount

  • Set up a simple IFlow in SAP Cloud Platform Integration using the RFC Adapter

  • Test the connection and the BAPI from Postman

Setting up the IFlow

The IFlow is simple and looks like this:

The Groovy Scripts are just payload loggers. The interesting part is the RFC-Call. The RFC destination needs to be maintained in the SAP Cloud Platform Destinations of the subaccount the SAP Cloud Platform Integration belongs to. But first the SAP Cloud Connector-Channel to the SAP On-Premise System needs to be set up. With the result of that we can easily maintain the destination in the SAP Cloud Platform Cockpit.

In SCC go to “Cloud to On-Premise” and create a new channel by pressing the “+” on the top-right of the screen. Create a new RFC-channel. Take care about the Virtual Host Name because you can’t change it later on. You will use that name in the destination in SCP later.






Put the data of your backend system here:


You can’t change the Virtual Application Server Name later so take care and avoid special characters!


When you maintained everything correctly, your new virtual server will appear as “Reachable”. Now you need to add a resource. For that, highlight your server and add a resource:

Go to the Cloud Cockpit and subaccount of the CPI. If you look into the attached Cloud Connectors, you can find our newly created destination:

Now go to destinations and create a new one:

Add the additional properties for your target. As “ashost” you set the name you maintained in the SAP Cloud Connector. The name of the destination (“OnPremRFCTarget”) will be used later in the SAP Cloud Platform Integration Flow.

Check the connection. If you get the message below, then the name for jco.client.ashost is not correct:

Now go into the SAP Cloud Platform Integration and maintain the Iflow. To send the data you need to maintain the RFC Receiver Adapter:

The setting “Send confirm transaction” is only needed when you want to persist data in the target (“BAPI_COMMIT”). Save and Deploy the Integration Flow.

From Postman you can call the IFlow with this sample payload (change the MateriaI-Number accordingly):
<?xml version="1.0" encoding="UTF-8"?> 
<ns1:BAPI_MATERIAL_GET_DETAIL xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

Make it a POST request via https with basic authentication (with an appropriate user on SAP Cloud Platform Integration).

As an answer we get the material in a ll its beauty:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rfc:BAPI_MATERIAL_GET_DETAIL.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><MATERIALPLANTDATA>
<SIZE_DIM>007.0X007.0X004.4 INCHES</SIZE_DIM>

Since this call goes toward an SAP On-Premise System, no restrictions which BAPIs can be used do apply.


What I learned from this test case

The interesting part was setting up the destination to be used in the Integration Flow. There is no drop-down list for available destinations so you need to know the name and, in my case, spell it properly. I was frustrated because the scenario wouldn't work at first but after a while I found the typo and then it was ok.

The format of the xml sending into the SAP On-Premise system matches the definition of the related function module. You can look it up in transaction SE37.

So with the experience from the previous tests it was straightforward to set this up.

Your Feedback

Please let me know if the description was helpful and you were able to set up the same test case. Any feedback how to improve this blog post is welcomed! Please put it in the comment section.

What’s next

In the final Blog I will show you how I achieved to make an RFC Call from SAP Cloud Platform via the SAP Cloud Connector into the SAP S/4HANA Public Cloud. It will appear soon!