Setup Event Mesh – Integration Suite (EMIS) to Trigger Events from S4H Cloud to CPI via Webhooks
Share

In this blog, we’ll walk through a step-by-step guide to setting up SAP Event Mesh – Integration Suite (EMIS) to enable real-time event-driven communication between SAP S/4HANA Public Cloud (S4HC) and Cloud Integration.

This tutorial covers the flow from configuring Event Mesh – Integration Suite to receive events from S/4HANA Public Cloud and briefly touches upon a sample HTTP based endpoint exposed by a SAP Cloud Integration (CPI) iFlow to which the events are pushed via Webhooks. Below Solution Diagram depicts the message flow. Please note that Queue 2 is presented solely for illustrative purposes and is not discussed within the scope of this article.

Solution Diagram-

KarthikBangeraM_2-1752501334629.png

 

Whether you’re new to SAP’s Event-Driven Architecture or looking to integrate cloud systems in a more responsive and scalable way, this guide will provide you with a clear and practical implementation path.

 

Prerequisites-

  1. Available only for SAP Integration Suite standard and premium editions
  2. If present, remove the instance of Standalone Event Mesh (Default Plan) from your Subaccount
  3. Integration Suite service is already subscribed to in the subaccount
  4. Integration Suite Event Mesh is added as an entitlement in the Global account

Refer SAP Note 3461547 for more details like Region Availability.

 

Detailed Steps-

  1. Go to BTP Tenant’s Integration Suite instance.i1.jpg   

             i1.jpg

       2. Click on Manage Capabilities

i2.jpg

       3. Click on Add Capabilities

i3_3.jpg

       4. Click on Manage Business Events and then click on Next

i4.jpg

       5. Click Activate

i5_1.jpg

i6.jpg

           It’s now Active

i7.jpg

      6. Click on OK and proceed

i8.jpg

We can now see the Manage Business Events tile. But none of the hyperlinks are yet active. This is because the necessary roles are still to be added to your user.

i9.jpg

        7. Go back to your BTP Subaccount and go to Security -> Users option

i10.jpg

        8. Search for your user and click on it

i11_New.jpg

        9. Click on Assign Role Collection.

i12.jpg

      10. Search for Event in the search bar. This will display 2 Integration Suite Event Mesh specific roles. Select both these roles and click on Assign Role Collection.

i13.jpg

           Both these roles are now assigned to your user.

      11. Refresh the Integration Suite screen. We can now see the hyperlinks for Configure Events and Monitor Events in the Manage Business Events tile as shown below

i14.jpg

      12. Click on Configure Events link.

This will open the below screen. Click on Activate to enable Event Mesh capability

i15.jpg

 

A notification will appear confirming that event mesh is successfully activated.

i16.jpg

i17.jpg

 

Wait for some time, event mesh will now show as active-

i18.jpg

 

If it shows as failed here, you might want to check the 2nd point under Prerequisites, where it has been suggested to remove the instance of Standalone Event Mesh (Default Plan) from your Subaccount, if applicable in your case.

13. Click on Queues tab to create a new queue. Click on Create button.

i19_New.jpg

14. Give a name to the queue and click on Create-

i20.jpg

15. Go to SAP BTP Subaccount and create a Messaging Client to receive messages from Topics in S4H Public Cloud

16. Create a space named “INTEGRATION_TOOLS”, or any other name of your choice. Use an existing space, if already available.

i21_New.png

 

Note that this step needs the “Integration Suite Event Mesh” entitlement to be added in Global account as mentioned in the Prerequisites section.

i21_2.jpg

 

17. Click on Create to create an Instance of Event Mesh

i22_1.jpg

Select Service as “SAP Integration Suite, Event Mesh” and other parameters as shown below. Take note of the Instance Name you provide, since this would be needed later during S4HANA Public Cloud configurations.

i24.jpg

Instance creation will show as In progress initially-

i25.jpg

Click on the Message Clientem-client-s4h” when it’s created-

i26.jpg

  1. Click on Create under Service Keys

i27.jpg

Give it an appropriate name and click on Create

i28.jpg

i29.jpg

Copy this JSON content for use later in S4HC while creating the communication arrangement.

i30.jpg

19. Move over to S4HCloud system and open Communication Arrangements app. Click on New.

i31.jpg

Search for Scenario 0092, which is meant for Enterprise Eventing Integration.

i32.jpgi33.jpg

Give an appropriate name to the arrangement, assign user “CPI” (or any other comm user as suitable in your case) and paste the Service Key we created earlier and click on create.

i34.jpg

This will throw the below error message, which is expected. This error is thrown because we haven’t given any Topic namespace which will help S4HCloud to post this correctly to the Message Client we created in BTP when it is subscribed to a Topic in S4HCloud.

Click on close.

i35.jpg

Add a namespace field with a value as em/client/s4h. This name is similar to the Message Client name. Just replace the “-” with “/”

i36_Partial.jpg

Add it back to the Service Key and click on Create.

This is now displaying the new Communication Arrangement that has been created. You can now see the topic space added.

i37.jpg

20. Add these 2 apps – Enterprise Event Enablement (Event Monitor) and Enterprise Event Enablement (Configure Channel Binding) to your home screen in S4HC

i38.jpg

21. Go to Enterprise Event Enablement (Configure Channel Bindings)

i39.jpg

22. Click on Channel “EMIS_0092” which was generated in the previous step

i40.jpg

23. Click on Create under Outbound Topic Bindings

i41.jpgi42.jpg

24. Search for Events

/sap/s4/beh/businesspartner/v1/BusinessPartner/Changed/v1

/sap/s4/beh/businesspartner/v1/BusinessPartner/Created/v1

i43_1.jpg

Click these one by one and click on Create

i44.jpg

 

i45.jpg

 

i46.jpg

 

i47.jpg

You can now see both the Topics are added to the outbound channel “EMIS_0092”.

i48.jpg

S4HC is now ready to send Business Partner – Create and Change events.

25. Go back to the Queue in BTP to subscribe to these 2 Topics

Click on the queue Tab

i49.jpg

26. Go to Subscriptions tab and click on Create

i50.jpg

27. Paste the Topic names here one by one.

i51.jpg

Note that the topic subscription should have the format – namespace + /ce + /topic name

Example in our case-

em/client/s4h + /ce + /sap/s4/beh/businesspartner/v1/BusinessPartner/Created/v1

You need to manually paste these 2 Topics

em/client/s4h/ce/sap/s4/beh/businesspartner/v1/BusinessPartner/Changed/v1

em/client/s4h/ce/sap/s4/beh/businesspartner/v1/BusinessPartner/Created/v1

i52.jpg

Do it for each of the Topics and click on Create

i53.jpg

You can now see the 2 Topics being subscribed to.

28. Go to Overview tab of Event Mesh and click on the Message Clientem-client-s4h

i54.jpg

This will open the Webhooks configuration screen. Click on Create.

i55.jpg

Use the below HTTP CPI iFlow Endpoint as the Webhooks URL

https://<TenantURL>/http/BPReplicationToSalesforce

You need to create a CPI iFlow with a HTTP Sender Channel, whose endpoint will then act as a Webhooks URL as shown above.

i56_WebhookEndpoint - Copy.jpg

Click on Create

i57_1.jpg

The webhooks should now forward any messages that appear in this queue to the iFlow meant for SAP to Salesforce BP sync.

Below is a sample CPI iFlow that was used for this Demo. You can implement as per your requirement.

CPIFlow_labels.JPG

Brief details of the CPI iFlow Steps-

  1. Business Events Message is received via a HTTP Sender Adapter.

HTTPAdapterEndpoint - Copy.jpg

The payload format of the incoming event notification payload is as given in the below SAP API Business Accelerator link.

https://api.sap.com/event/CE_BUSINESSPARTNEREVENTS/resource

       2. The BP number needs to be extracted from this payload.

       3. A call needs to be made to S4HC Business Partner OData API to fetch additional details for the Created or Changed Business Partner.

       4. Map to the corresponding structure of Accounts object of Salesforce

       5. Finally, send the payload to Salesforce API.

 

This completes the configuration setup, enabling the integration to capture and forward any Business Partner updates to the downstream systems.

As shown in the Solution Diagram earlier, you can create additional queues for other subscribers who are interested in receiving the same or other events and subscribe them to the required Topics of interest.

 

Scaling Up with Advanced Event Mesh (AEM)-

As your message size requirements grow, you can seamlessly transition to the more robust Advanced Event Mesh (AEM), which offers enhanced scalability and performance as compared to Integration Suite – Event Mesh (EMIS).

Refer below materials-

https://learning.sap.com/learning-journeys/discovering-event-driven-integration-with-sap-integration-suite-advanced-event-mesh/examining-sap-integration-suite-advanced-event-mesh_ce4073de-a466-4ac3-a2bc-4324b8b08b26

https://help.sap.com/docs/sap-integration-suite/advanced-event-mesh/what-is-sap-integration-suite-advanced-event-mesh

 

We have now reached the end of this blog post. I hope you found the content useful and that it helped clarify the setup and capabilities of SAP Integration Suite’s Event Mesh. Whether you’re just starting with event-driven architecture or exploring advanced options like Advanced Event Mesh (AEM), I’d love to hear your thoughts.

If you have any questions, face issues during your setup or simply want to share your experiences, feel free to drop a comment below. Your feedback is always welcome and can also help others in the community facing similar challenges.

 

References-

SAP Community-

https://community.sap.com/t5/technology-blog-posts-by-sap/meet-your-new-friend-emis-event-mesh-in-sap-integration-suite/ba-p/13731129

Youtube-

https://www.youtube.com/watch?v=tUIG34xT3oo&t=3587s

 

  Read More Technology Blog Posts by Members articles 

#abap

By ali