This blog will help to understand the event mesh concept from S/4 to BTP - Event Mesh.
Thank You Nilesh Puranik for the support and guidance provided.
Here is my First Blog. 😊
What is SAP Event Mesh?
Event mesh service is essentially an event that enables the flow of information between different applications and services in real-time.
SAP Event mesh enables a sending application to publish messages to a topic that directly sends the message to the queue to which it is bound. Events are associated with a topic to achieve the publish-subscribe model. Topics are managed through queue subscriptions.
Business Benefits of Event Mesh:
Real Time Communication: event mesh enables real-time, asynchronous communication between systems, allowing immediate reaction to the changes in business objects.
Scalability: Event mesh supports a high volume of events, making it suitable for large-scale integrations.
Resilience: The decoupling of event producers and consumers ensures that system failures do not affect the entire setup, thereby improving resilience.
Use case: Whenever a Warranty claim is approved in S/4 it should trigger event from S/4 to BTP event mesh.
Event Mesh Flow Chart
Pre-Requisite:
Part 1: Configuration of event mesh in S/4 Hana.
Part 2: Steps to assign the custom event to trigger from S/4 Hana.
Part 3: Creating Custom Events.
Part 4: Subscribe to Event Mesh Service in BTP.
Setup Topic and Events channel in S/4 Hana.
Part 1:
Tcode: SPRO
Click on "Create Via Service Key"
Get Service Key details from instance created in BTP Subaccount.
Now, Add the description, Protocol, Rfc name and OAuth Config Name, after which you can paste the service key json body.
Click on save, and activate the channel.
Select the channel and Click on Outbound Bindings.
Select the Topic name.
In our case I have selected the Claim Accepted Topic.
Part 2 : Steps to be done in S/4 Hana.
We will configure the S/4 Hana for triggering the events, for this we will be using a standard business object and event.
Goto tcode SWE2, Add Object type BUS2222 (Warranty Claim ) and event as CHANGED.
1. Refer the screen shot below for reference.
2. Create a custom function module so that we can add in Receiver functional module.
Here we can add logic at what condition we need to trigger the event.
Read the container values and add the filter condition, in this example we are triggering warranty claims only when they are in approve status for eg : Y008.
This this example we have created Function module : YM2O_FM_CLAIM_RECEIVER
Logic in FM for reference.
ycl_bimpl_warrantyclaim_01=>raise_claimaccepted( it_events_claimsAccepted = VALUE #( ( pnguid = ls_pnwtyh-pnguid pncnt = ls_pnwtyh-pncnt %param = VALUE #( clmno = ls_pnwtyh-clmno ) ) ) ).
3. Activate the Event Linkage and “save”
Part 3: Creating Custom Events.
Now we need to login to Eclipse.
We are using Claim no as abstract entity for input field.
Create a Behavior definition
a. Create a Behavior class add the Root entity created above.
Event Binding
S/4 Hana Class
In behavior definition class that has been created with the method.
Part 4 : Subscribe to Event Mesh Service in BTP.
Select the Namespace.
Create a Queue.
Assign the Custom topic created in S/4.
Let me know if anything is missing.
Regards
Pratik Ratan Ingawale
Pratik Ingawale
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
4 | |
3 | |
2 | |
2 | |
1 | |
1 |