What is RFC?
A remote function call (RFC) is the standard interface used for integrating on-premise ABAP systems to the systems hosted on cloud using SAP cloud connector.
In the SAP system, these functions are provided by the RFC interface system. The RFC interface system enables function calls between two SAP systems, or between an SAP system and an external system.
Synchronous RFC receiver adapter
In the first version of RFC adapter, synchronous RFC (sRFC) is made available for you to execute the function call based on synchronous communication, which means that both the systems must both be available at the time the call is made.
Use case: Use RFC Adapter to execute remote function module on ABAP system
This blog covers the end to end scenario of creating RFC integration flow by using SAP Cloud Platform Integration web UI. It also gives you an insight on how to create RFC destinations via SAP cloud connector in SAP Cloud Platform, setting up additional (necessary) properties in the destination configuration etc. Towards the end of the tutorial you will see a simple use case of invoking request-response method (using Postman Web client tool) for retrieving data from ABAP system (for example flight details) using RFC adapter.
Ensure that following prerequisites are met before getting started:
- RFC destination is configured using cloud connector. For more information on how to configure RFC destination, see https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/04acd29726494b86b05ba0d60984ae6f.html
- SAP Netweaver ABAP system is up and running.
- XML/WSDL schema for RFC module is generated. For more information on how to generate these input files, see https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/57a6b6ede47c449aa0808ff9695aec49.html
Creating integration flow for RFC adapter
- Open browser and enter the URL – https://<tenant_name>.int.sap.hana.ondemand.com/itspaces/
- Under Design, select Create to add new package.
- Click Save.
- Select your package and go to ARTIFACTS tab.
- Choose Add > Integration Flow.
- Enter name to create new integration flow artifact and click OK.
- Click the new integration flow you have created and click Edit.
- Connect Sender to start using HTTPS adapter type.
- Under HTTPS, go to Connection tab set the address. For instance, here we set it as “/demo”.
- Go to Design Palette and select Call > External Call > Request Reply
- Add one receiver and connect Request-Reply call via RFC.
- Go to Connection tab under RFC and provide destination name in Name field and Save the changes.
Use the destination name that is created for you in the subscriber account in HCP. See step 4 of the following section “Creating RFC destination in SCP”.
Creating RFC destination in SCP
- Go to https://hana.ondemand.com
- Select your tenant account which you would have created while creating cluster.
- Go to Connectivity > Destinations.
- Create new destination by selecting New Destination.
- Enter the details for Name, URL, User, Password and select Type as RFC.
- Add additional properties and enter required values as configured in cloud connector:
- Jco.destination.pool_capacity (optional)
- Select Save.
Invoking HTTP endpoint using postman client
Now that you have successfully deployed the integration flow. You can invoke request-response method to retrieve data from ABAP system using RFC adapter.
In this demo, we have used the function module SXIDEMO_AIRL_FLIGHT_CHECKAVAIL to check the number of seats available for the flight for a specific date.
Refer to information on how to generate function module (XML/WSDL file) in the Prerequisite section.
- Invoke the HTTP request URL:
- Set the method as POST. Provide the necessary inputs in the request body.
- Use Basic Authorization as header.
- Sample XML input format to be entered in HTTP Body:
- Invoke the HTTP request URL:
<?xml version="1.0" encoding="UTF-8"?> <ns1:SXIDEMO_AIRL_FLIGHT_CHECKAVAIL xmlns:ns1="urn:sap-com:document:sap:rfc:functions"> <FLIGHT_KEY> <AIRLINEID>AA</AIRLINEID> <CONNECTID>0017</CONNECTID> <FLIGHTDATE>2017-05-01</FLIGHTDATE> </FLIGHT_KEY> </ns1:SXIDEMO_AIRL_FLIGHT_CHECKAVAIL>
Result: You can view the number of seat available for the flight on the specified date.