Call a Remote Function Module From SAP Business Technology Platform (BTP), ABAP Environment
- How to open a secure tunnel connection between your SAP BTP, ABAP Environment and an on-premise SAP System, e.g. SAP S/4HANA
- How to create a destination service instance with an RFC connection
- How to test the connection using an ABAP handler class
Prerequisites
- IMPORTANT: This tutorial cannot be completed on a trial account. If you want to explore some of the concepts of this mission on a trial account, using OData or SOAP rather than RFC, see the following workshop: SAP BTP, ABAP Environment: Connectivity and Integration.
- You have set up SAP Business Technology Platform (BTP), ABAP Environment, for example by using the relevant booster: Using a Booster to Automate the Setup of the ABAP Environment
- Tutorial: Create Your First Console Application, for a licensed user, steps 1-2
- You have developer rights to an ABAP on-premise system, such as:
- In this on-premise system, you have installed SAP Cloud Connector with Administrator rights. (In the above systems, this is pre-installed)
Throughout this tutorial, replace XXX
or JP
with your initials or group number.
The problem:
There are two problems when setting up connectivity between the SAP BTP, ABAP Environment and an on-premise:
- The ABAP Environment “lives” in the Internet, but customer on-premise systems are behind a firewall
- Remote Function Call (RFC) is not internet-enabled
The solution:
- Set up a secure, tunnel connection from the on-premise system to the SAP BTP, ABAP Environment
Specifically:
- The ABAP environment tenant fetches the destination from the Destination service instance.
- The ABAP environment tenant requests to open the tunnel connection through the Connectivity service.
- The Connectivity service tells the Cloud Connector to open the connection to this specific ABAP environment tenant using the admin connection.
- The Cloud Connector opens a tunnel connection to the ABAP environment tenant using its public tenant URL.
- After the tunnel is established, it can be used for actual data connection using the RFC or HTTP(S) protocols.

More Information
This tutorial mission is based on a blog post series by Andre Fischer, which is well worth a look:
For more information on OData services and SAP Gateway in general, see:
- OData service development with SAP Gateway using CDS - pertains to on-premise Systems, but contains lots of useful background information on the relationships between CDS views and OData services
- OData – Everything that you need to know - especially Parts 1-3 (Community content)
For more information on connectivity in this context, see:
- SAP Help Portal: SAP Cloud Connector
-
SAP Help Portal: Setting Up Destinations to Enable On-Premise Connectivity
-
SAP Help Portal: Set Up an RFC Destination
For more information on SAP Business Technology Platform (BTP)
- SAP Help Portal: What is SAP Business Technology Platform (BTP)
- SAP Help Portal: Getting Started With a Customer Account - If you use the booster, these steps are performed automatically for you, but you may be interested in the background information