7

Using RFC adapter in the SAP integration suite -Part II

 1 year ago
source link: https://blogs.sap.com/2022/10/19/using-rfc-adapter-in-the-sap-integration-suite-part-ii/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Using RFC adapter in the SAP integration suite -Part II

0 1 117

This post is in continuation of the initial blog post – Using RFC adapter in the SAP integration suite.

If you didn’t get a chance to go through it, you can find it at the below-given link.

https://blogs.sap.com/2022/10/11/using-rfc-adapter-in-the-sap-integration-suite/?preview_id=1621769

In the first part of the blog post, we concentrated on the development of RFC on the SAP ERP side and destination configuration in the cloud connector(basically all the development setup within the firewall). In this part, we will focus on the  SAP BTP side developments.

We can segregate the rest of the development/setup on the SAP BTP side into two parts for better understanding.

  • Destination configuration in SAP BTP Cockpit
  • Developments in the SAP integration suite

Destination configuration in SAP BTP Cockpit

  1. Go to the SAP BTP cockpit. Click on the destination tab and create a new destination.

Note: The user and password should be of a valid SAP ERP user.

IS25.png
is-2.png

2. Click on save and click on “check the connection”.

is_2-1.png

IS2-1.png

Developments in the SAP integration suite 

  • Creation of a package in the integration suite.

a) Create a package in the design tab of the integration suite as shown in the below snapshot.

is3.png

b) Once done click on Save.

is4.png

c) Creation of artifact in the package.

  • Click on the Artifacts tab.
  • Click on Add dropdown and select integration flow. We refer to this as iflow also.
    is5.png

d) Designing the iflow:

  1.  A screen as shown below is displayed on your screen. Click on Edit.
    is6.png
  2. As stated above, we are using postman in our example for triggering the iflow. So, this will be acting as both sender and receiver.
  3. Connect the sender and the start message event in your iflow by HTTPS adapter type.
    is7.png
  4. Enter a valid address as shown below. It needs to start with a ‘/’.
    IS8-1.png
    Note:The user role “ESBMessaging.send” is necessary for invoking the workflow. This needs to be assigned to the user as well in the BTP cockpit. Please refer SAP Help guide for further information on this.
  5. We are adding a content modifier next. Why?
    Since in this example we want to get all purchase orders that were created on a particular date. So, we would be capturing the date in the body of the content modifier as shown below.
    is9.png
  6. Give a valid name. we are adding the date in xml format in the body as shown below.Note: This Date will be mapped to “createdon”, the importing parameter in our RFC that we have defined above.
    is10-1.png
  7. Now logically the next step is to send the data to the SAP ERP system in a format that our RFC understands.
    1. Here we can achieve this through message mapping. But before we do that we would need “source” and “target” XSD/WSDL. This will help in mapping the incoming XML format to the appropriate target structure which is RFC in this case.
    2. We already have target WSDL from SAP ERP from the last blog post.
    3. For source XSD, we can use any tool to convert the above XML to XSD format. Once converted it will appear as below.
    4. Save it as an XSD document in your system so that we can use it in our next step.

           

is11.png

     8. Now let us create a message mapping step as shown below.

       

IS12.png
IS13.png

     9. Give a name.

       

is14.png

   10. Now we add the source and target XSD as shown below.

     

is15.png

Use the “upload from file system ” option to upload the WSDLs of both the source and target.

is16-3.png

 11. We perform a simple one-to-one mapping to let the system know that our date needs to be mapped to RFC’s “createdon” date.

is17.png

 12. Click on save.

13. Our data is all set to be sent to SAP ERP. So, we create a request-reply for the external call and a receiver as shown below.

1s18-1.png

 

IS19.png

14. Now we need to connect these two by RFC adapter as shown.

IS20.png

15. In the destination field use the same destination name that we created in our BTP cockpit ( refer to the beginning of this blog post).

IS21.png

16. Click save and deploy.

17. When we go to the monitor tab, we can get the endpoint. We will be using this in postman to trigger the iflow.

is22.png

Testing this development:

  • Now for testing this, go to the postman app. Use the above iflow endpoint as a URL.Maintain authorization as shown below. The credentials are the ones that is used to login into your BTP account.
    IS24.png
  • Click on Send. This gets you the output as shown below.
    is23.png
    Summary:

We have reached the end of our blog. Let us summarize the steps.

  • We created an RFC in the SAP ERP and created destinations in both the cloud connector and SAP BTP cockpit.
  • This RFC is consumed in the iflow that we have created in the SAP integration suite. The whole setup was tested using postman in this example. You can use any other tool as per your preference.

Hope this blog helped you to get a basic idea of how to use an RFC adapter in the integration suite. Please feel free to leave your comments/queries below.

Happy Learning !!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK