Skip to Content
Technical Articles
Author's profile photo Elisha Das

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.

       

     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

  1. Select the subaccount that will be used for communication. Click on cloud to on premise and follow the instructions as shown below screenshots.
  2. Provide a virtual host and port.
  3. Click on next and Finish.
  4. Next click on add a resource.
  5. 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.

Happy Exploring !!

 

 

 

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Frank Li
      Frank Li

      Looking forwarding to your next part of this blog.

      Author's profile photo Elisha Das
      Elisha Das
      Blog Post Author

      Thank you Frank Li. I would be publishing the next part soon.

      Author's profile photo Elisha Das
      Elisha Das
      Blog Post Author

      The next part is published now.

      https://blogs.sap.com/2022/10/19/using-rfc-adapter-in-the-sap-integration-suite-part-ii/

      Please feel free to leave comments/queries in case you have any.

      Hope this helps!!

      Author's profile photo Frank Li
      Frank Li

      Great, thanks a lot for your sharing.

      Why generate a web service and get a WSDL based on RFC in this blog and then use WSDL for mapping the parameter creation date in the second blog? If keep the variable name creation date(in the second blog IFlow content modifiter body)the same with RFC parameter name, does the message mapping still needed in second blog? if not needed, WSDL also not need in this blog, is it right? Thanks. 

      Author's profile photo Elisha Das
      Elisha Das
      Blog Post Author

      Let me answer this in two parts-

      1) Is WSDL needed for message mapping?

      Yes the whole intent of generating WSDL was to use it in message mapping.

      2) Is message mapping necessary even if the parameter name is same("Creation date in this case ")?

      The parameter value can be passed successfully to the importing parameters of an RFC, when the payload is in sync with the structure generated by WSDL.
      Before message mapping , the payload in iflow is as below.
      After message mapping the payload is transformed.

      So message mapping is used here to transform the incoming format into a RFC consumable format.
      Hope this answers your query!!

      Author's profile photo Frank Li
      Frank Li

      Hi Elisa,

      Thanks a lot for your kindly explanation, now it is very clear.