Wednesday, 12 October 2022

Using RFC adapter in the SAP integration suite

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

1. Create a function module that is remote enabled.

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

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.

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

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.

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

3. Now click on the source code tab. Add logic to fetch the required details as shown below.

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

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.

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

6. Give an appropriate name for the web service.

We will select the below profile for ease of testing.

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

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.

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

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


1. Select the subaccount that will be used for communication. Click on cloud to on premise and follow the instructions as shown below screenshots.

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

2. Provide a virtual host and port.

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

3. Click on next and Finish.

4. Next click on add a resource.

SAP ABAP Development, Cloud Integration, SAP Integration Suite, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials

5. Make sure all our resources are active and available.

No comments:

Post a Comment