Technology Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
AlexPfeil
Product and Topic Expert
Product and Topic Expert
1,660

Since RAP does not have a Initial Load Feature, a simple Cloud Integration Flow is able to fetch the current Data of a System via Odata and pass it to AEM using the AEM Adapter.

Prerequisite is of course that the API is activated on the S/4HANA System.

This is how the Iflow looks like:

1.png

Since an Init Load only needs to run once, we set the Timer like this:

2.png

We are calling the Local Integration Flow in a Loop (explained [here](https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-cloud-integration-loo... it might be possible that there is so much data in the system that one call would return a too large Payload. Using the EDMX File from the SAP Accelerator Hub (https://api.sap.com/api/API_BUSINESS_PARTNER/resource/Business_Partner) the required fields can be selected in a wizard. Additionally we specify how many Records we want:

AlexPfeil_0-1741195384272.png

Query Options:

$select=BusinessPartner,BusinessPartnerGrouping,FirstName,LastName,to_BusinessPartnerAddress/AddressID,to_BusinessPartnerAddress/ValidityStartDate,to_BusinessPartnerAddress/ValidityEndDate,to_BusinessPartnerAddress/StreetName,to_BusinessPartnerAddress/CityName,to_BusinessPartnerAddress/HouseNumber,to_BusinessPartnerAddress/PostalCode,to_BusinessPartnerAddress/Country&$expand=to_BusinessPartnerAddress

In the next Step we have a Splitter to create individual Events:

6.png

Then we set the Grouping as Property, because we want to set the Topic dynamically

AlexPfeil_0-1743751626533.png

Odata V2 also supports JSON, the Odata V2 Adapter does not. Alternatively you can use the HTTP adapter and build the query yourself. With XML as returned Payload we need a converter:

9.png

Last Step: Set up the AEM Adapter. Important here is to use the Grouping Property for the dynamic Topic:

10.png

Test: For Testing I have added a Consumer Iflow subscribing to Topic sap/businessPartner/> (for all Groupings)

11.png

One Example Message:
Headers

12.png

Payload

13.png

If I change the BP manually, it should appear as well:

Changed the Address

14.png

--> Result in AEM (This Changed Event is triggered by AIFAEM)  

15.png

(on the left we see the Payload from the Init Load Iflow, only the order is different, which should be fine. It might be possible that the Odata Pull returns a different Payload than the Event pushed by the ERP. In this case you either need to add a Mapping on Integration Suite or design your Custom Event so it fits to the Odata Payload from the beginning. 

Advantages:

- Clean Approach without any changes in the backend except activation of the Odata API

- Does not matter what Even Enablement is used on S/4HANA. Any Migration between Event Enablement Options does not affect this

Disadvantages:

- Payload has to be aligned with Event when the corresponding Object is changed (if the Init Load goes into the same Topic)

API has to be available, activated and one Iflow for it designed specifically.

 

2 Comments