Overview:
This blog post intends to show how to use an RFC adapter in an integration flow (iflow as we would be referring to in this blog) for fetching data from the SAP ERP system.
We have various adapters provided by SAP which can be leveraged based on a particular requirement. In this blog, I am focusing on the RFC adapter and will provide you with a brief understanding of how you can use it.
Targeted Audience:
Beginner level in integration suite. Basic ABAP knowledge would be a plus.
Even if you don’t have either, I believe this can give you a fair idea of where to start!!
Objective:
I have used a very simple example to fetch purchase order details created on a particular date from the SAP ERP system using iflow in SAP BTP.
Solution:
The complete development process can be divided into 3 parts for better understanding-
a) Development in SAP ERP
b) Destination configuration
c) Developments in integration suite within SAP BTP environment.
Assumptions:
- An Account in SAP BTP with all the required roles assigned.
- Have a valid Subscription to the SAP integration suite in BTP.
- Have a cloud connector between the integration suite and SAP ERP.
- I am using Postman here to post my request so that we can also see the response. In real-life scenarios, this can be triggered from any third-party system or directly in an iflow using a scheduler.
a) Development in SAP ERP
- Create a function module that is remote enabled.
2. Add import and export parameters as shown below.
Since we are capturing PO details created on a particular date. “Created on” is our importing parameter.
We are fetching purchase order details such as the PO number, and company code created by a supplier. This structure would be our exporting parameter.
3. Now click on the source code tab. Add logic to fetch the required details as shown below.
4. Save and activate it.
5. Next step is to generate a web service and get a WSDL of the same.
Follow the path as shown below.
6. Give an appropriate name for the web service.
We will select the below profile for ease of testing.
7. Once done click on activate.
This will direct you to a screen as below. Click on the WSDL tab and download the generated WSDL to your local system. We will use it in our iflow.
We are done with our ERP changes! Let us move to the second part.
b) Destination configuration
As mentioned in the assumption section, we have a cloud connector in between our SAP ERP and BTP.
So, we will have to create a destination in the SAP BTP cockpit and create a subaccount in the cloud connector for the connection. We will cover the cloud connector setup here and the BTP cockpit changes in the next part.
Cloud connector Changes
- Select the subaccount that will be used for communication. Click on cloud to on premise and follow the instructions as shown below screenshots.
- Provide a virtual host and port.
- Click on next and Finish.
- Next click on add a resource.
- Make sure all our resources are active and available.
Summary:
So far, we have created an RFC in SAP ERP and exposed it as a web service. We also did the initial setup in the cloud connector for the destination and established the connection between the cloud connector and SAP ERP.
Note:
You can refer to the below link on the integration suite for further in-depth knowledge of its various capabilities.
https://help.sap.com/docs/SAP_INTEGRATION_SUITE
We will continue the rest of the development in the next part of the blog (link below).
https://blogs.sap.com/2022/10/19/using-rfc-adapter-in-the-sap-integration-suite-part-ii/
Please feel free to leave your comments/queries below. I believe we all can learn so much from each other that way.