Objective
After completing this lesson, you will be able to identify the functionality and patterns of SAP Event Mesh.
Event Mesh Capability Overview
In addition to the standalone SAP Event Mesh solution, Event Mesh is also available as a capability within SAP Integration Suite. The functionality is identical to the standalone version, but implementation and usage differ.
Supported Patterns:
The Event Mesh capability in SAP Integration Suite supports the following event-driven architecture (EDA) patterns:
- Publish/Subscribe
- Core functionality that allows multiple subscribers to receive events, enabling loosely coupled systems
- Point-to-Point
- Direct messaging between sender and receiver via queues for targeted delivery
Deployment Options:
Event Mesh is only available as a capability within the SAP Integration Suite.
Use Cases
The Event Mesh capability in SAP Integration Suite can be applied in various scenarios across modern enterprise environments.
In the area of Enterprise Application Integration, it enables event-based integration between systems such as SAP S/4HANA, SAP BTP, SAP SuccessFactors, and third-party applications. This approach reduces system dependencies and supports a reactive architecture.
For IoT Integration and Edge Computing, it connects IoT sensors and edge devices with enterprise systems. A typical example is predictive maintenance in the manufacturing industry, where real-time data from machines enables proactive service and reduced downtime.
In the context of Omnichannel Customer Experience, it provides real-time notifications for customers in e-commerce, banking, or service environments. It also ensures synchronization across e-commerce, CRM, and ERP systems, enabling a consistent and seamless customer journey.
Regarding financial transactions and payment systems, it supports the asynchronous processing of financial transactions. At the same time, it ensures data integrity and reliable message delivery, which are critical requirements in financial environments.
Overview Use Case and Exercises
A solution architecture is designed and implemented that fulfills the following business requirement: When a Business Partner record is changed in the SAP S/4HANA Cloud Public Edition, a change event is to be sent to the Event Mesh capability in SAP Integration Suite. An iFlow receives this event and processes it further.
In this example, we limit ourselves to a single change event. Processing in the iFlow is carried out by a simple Groovy Script.
The implementation spans several systems and involves various personas. For a better overview, however, a strict separation of roles is deliberately avoided. It means that no distinction is made between SAP BTP administrators, integration specialists, SAP S/4HANA administrators, or developers.
Description
Description of the Demo Process
Task 1: Log in to the SAP BTP Subaccount
The Event Mesh capability is hosted in SAP Integration Suite in an SAP BTP subaccount. Therefore, the user must first log in to the corresponding SAP BTP subaccount. In this step, we log in to the development SAP BTP subaccount.
Prerequisites
The role collection Subaccount Administrator must be assigned to the platform user.
Steps
Log in to the SAP BTP subaccount
Call: https://emea.cockpit.btp.cloud.sap
Select the global account and subaccount. Here is an example - CLD900-DEV-CO21.
Authentication against the SAP IDP or Custom IDP with the user and password.
Result
The user is logged in as an SAP BTP administrator on the development SAP BTP subaccount.
Further Information
Activate the Event Mesh Capability in SAP Integration Suite
The event triggered by the SAP S/4HANA Cloud, public edition is sent asynchronously to the Event Mesh capability in SAP Integration Suite. The event is stored in a queue there. Therefore, the Event Mesh capability must first be activated.
In this exercise, the Event Mesh capability in SAP Integration Suite is activated.
Prerequisites
- The role collections Integration_Provisioner and Subaccount Administrator are assigned to the user who activates the capability.
- An SAP Integration Suite instance with service plan free or standard edition is already subscribed to the subaccount.
Note
For participants attending an on-site training only: This exercise will be discussed theoretically by your trainer and will not be carried out on the training system.
Task 1: Activate the Event Mesh Capability in SAP Integration Suite.
Steps
Log in to the Integration Suite.
Navigate to Home.
Depending on whether capabilities are already activated or not, the activated capabilities are displayed here. In this case, none are activated yet.
Search for the Add Capabilities tile.
Click on the Add Capabilities link.
Click on the Add Capabilities button.
Select Manage Business Events.
Activate Event Mesh.
Click on Next.
Then, click on the Activate button.
If the action was successful, the active capability Event Mesh is displayed.
Click on the OK button to return to the SAP Integration Suite Welcome page.
Result
The Event Mesh capability is activated in SAP Integration Suite. However, the Event Mesh capability cannot yet be used as the required authorizations are missing. These are assigned in a later exercise.
Activate the Cloud Integration Capability in SAP Integration Suite
The event fired by SAP S/4HANA Cloud is to be read from Event Mesh and further processing is to be triggered. The Cloud Integration capability is used for this purpose.
In this exercise, the Cloud Integration capability is activated.
Note
For participants attending an on-site training only: This exercise will be discussed theoretically by your trainer and will not be carried out on the training system.
Task 1: Activate the Cloud Integration Capability in SAP Integration Suite
Steps
Log in to the Integration Suite.
Navigate to Home.
Depending on whether capabilities are already activated or not, the activated capabilities are displayed here. In this case, Event Mesh is already activated.
Search for the Manage Capabilities tile.
Click on the Manage Capabilities link.
Click on the Add Capabilities button.
Select Build Integration Scenarios.
Click on Next.
Select Production or Non-Production as the environment.
Activate the message queues.
Click on Next.
Click on Activate. The activation process can take up to an hour.
Result
Once Cloud Integration is successfully activated, it will be available. If Message Queues have been activated, the details will display.
Further Information
Assigning the Required Role Collections
After activating Event Mesh and Cloud Integration, users must be granted the necessary permissions to use these capabilities. In SAP Business Technology Platform, this is done through the assignment of role collections.
In this exercise, role collections are assigned to an application user within the subaccount.
Prerequisites
- The user performing the assignment must have the Subaccount Administrator role collection.
- In SAP Integration Suite, the Cloud Integration and Event Mesh capabilities must be activated.
Task 1: Assigning the Required Role Collections to the Application User
Steps
Assigning the required role collections to the application user. In our case, the application user is the same as the platform user.
Log in to the SAP BTP cockpit of the subaccount.
Open Security→Users and locate the application user to whom the role collections should be assigned.
On the right, click the small black triangle at the end of the row with the application username.
A panel opens to the right of the user field.
The right panel can be enlarged using a slider.
Click the three dots to the right of the search field, then click the Assign Role Collections link.
Assigning role collections for Event Mesh.
The Event Mesh capability in SAP Integration Suite offers two predefined role collections. There is no distinction between different roles.
| Name | Description |
|---|
| EventMeshAdmin | Management of the message broker, queues, and topic subscriptions, and monitoring Event Mesh usage and its resources. |
| EventMeshDevelop | Management of queues and topic subscriptions, as well as monitoring Event Mesh usage and its resources. |
Select both role collections.
Then, click the Assign Role Collections button.
Assigning role collections for Cloud Integration
The Cloud Integration capability offers four predefined role collections. Again, no role distinction is made.
| Name | Description |
|---|
| PI_Administrator | SAP Process Integration - for administrators |
| PI_Business_Expert | SAP Process Integration - for business experts with access to critical business data |
| PI_Integration_Developer | SAP Process Integration - for users developing integration flows |
| PI_Read_Only | SAP Process Integration - read-only access for support users without access to critical business data |
Proceed with the assignment just like before.
Select all role collections as shown in the following figure.
Then, click the Assign Role Collections button.
Result
The application user has now been assigned all role collections for the Event Mesh and Cloud Integration. The user now has access to the Event Mesh and Cloud Integration.
Log in to SAP Integration Suite.
In the menu bar of SAP Integration Suite, the activated capabilities, particularly Cloud Integration and Event Mesh, are now visible and usable.
Further Information
Create an SAP Integration Suite, Event Mesh Instance
Using the Event Mesh capability in SAP Integration Suite requires the creation of a message client. It is done by creating an SAP Integration Suite, Event Mesh instance with the message-client service plan in the SAP BTP cockpit under Services→Instances and Subscriptions.
In this exercise, we will create an SAP Integration Suite, Event Mesh instance using the message-client service plan.
Prerequisites
- The SAP Integration Suite, Event Mesh service with the message-client plan must be available as an entitlement in the global SAP BTP account. The service must be assigned to the development subaccount.
- A Cloud Foundry environment must be available. The user creating the service instance must be listed as an Org Manager under Cloud Foundry→Org Member.
- At least one space must exist in Cloud Foundry. Service instances are deployed within a Cloud Foundry space. In this case, it is a space named dev.
Task 1: Create a Service Instance
Steps
Create a service instance.
Navigate to Services→Instances and Subscriptions and click the Create button.
Fill in the form using the following values:
| Field | Value | Task |
|---|
| Service | SAP Integration Suite, Event Mesh | Select from the dropdown list |
| Plan | message-client | Select from the dropdown list |
| Runtime Environment | Cloud Foundry | Select from the dropdown list |
| Space | for example, dev | Select from the dropdown list |
| Instance Name | emis-s4hana | Any name of your choice |
Click the Create button.
No additional parameters must be defined in the service descriptor.
Result
The SAP Integration Suite, Event Mesh service has been successfully created.
A Message Client named emis-s4hana has been created in SAP Integration Suite, Event Mesh. The name is identical to the instance name.
Further Information
Create a Service Key for the Integration Suite, Event Mesh Instance
After creating the message client as an SAP Integration Suite, Event Mesh instance, a service key is generated. This key provides an endpoint via WebSockets and enables access through an OAuth 2.0 client.
In this exercise, we will generate a service key for the previously created Integration Suite, Event Mesh instance.
Prerequisites
A successfully created SAP Integration Suite, Event Mesh instance.
Task 1: Create a Service Key
Steps
Create a Service Key
Navigate to the emis-s4hana service instance under Services→Instances and Subscriptions.
Click on the row of the service instance to open the details panel on the right.
Click the Create button in the Service Keys section.
Fill out the form using the following values:
| Field | Value | Task |
|---|
| Service Key Name | for example, sk-emis-s4hana | Any name of your choice |
Then, click the Create button to generate the service key.
Review the Service Key
Click the name of the service key you just created.
Upon opening the service key, you see three sections. Section 1 is relevant for us. For security reasons, some parts are masked with the following characters: "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
We communicate with the Event Mesh using:
| Name | Value |
|---|
| Transmission Protocol | AMQP (Advanced Message Queuing Protocol) |
| Transport Layer | TCP |
| Network Protocol | WebSocket |
| WebSocket | URI wss://cld900……./amqp10ws |
With the clientid, clientsecret, and tokenurl, a bearer token can be generated to access the endpoint shown under URI. From a technical point of view, this is an OAuth 2.0 client.
Copy the Service Key
For configuring the communication channel in SAP S/4HANA Cloud, we need this service key. Therefore, copy the entire service key and store it securely for later use.
In the open service key window, click the Copy JSON button at the bottom and save the service key in a secure location.
Result
Under Services→Instances and Subscriptions, you now see the generated service key.
Further Information
Create a New Queue in Event Mesh
The change event triggered by SAP S/4HANA Cloud Public Edition should be temporarily stored in a queue before being consumed by a consumer. For this purpose, a queue must be created in the previously created message client.
In this exercise, a queue is created in the message client provisioned via the SAP Integration Suite, Event Mesh instance.
Prerequisites
- A subscribed SAP Integration Suite.
- An activated Event Mesh capability.
- The required role collections for Event Mesh must be assigned to the platform user.
- An existing SAP Integration Suite, Event Mesh instance with the message-client plan.
A message client named emis-s4hana was created in a previous step.
Task 1: Create a Queue in a Message Client
Steps
Create a Queue in a Message Client in Event Mesh
Log in to SAP Integration Suite.
Navigate to Configure→Event Mesh.
Click on the message client name emis-s4hana.
Select the Queues tab.
Click the Create button.
Provide a meaningful name for the queue, for example, emis-s4hana-uc123.
Then, click the Create button.
Result
A queue named emis-s4hana-uc123 has been successfully created within the Event Mesh message client.
Further Information
Log in to SAP S/4HANA Cloud Public Edition
The SAP S/4HANA Cloud Public Edition acts as the event producer. To configure the event framework, we first must log in to SAP S/4HANA Cloud Public Edition as a business user.
In this exercise, we will log in to the SAP S/4HANA Cloud Public Edition using a username and password.
Prerequisites
In SAP S/4HANA Cloud Public Edition, the login user must be maintained as a Business User with the BR_ADMINISTRATOR business role.
Log in to SAP S/4HANA Cloud Public Edition
Task 1: Log in as a Business user to SAP S/4HANA Cloud Public Edition
Steps
Open the relevant URL, for example: https://myxxxx.s4hana.ondemand.com
Log in using your username and password.
Open the Maintain Business Users app.
Click the Maintain Business Users tile.
Search for your login user using the search field and click the Go button.
Click on the row containing your user.
Switch to the Assigned Business Roles tab.
Verify that your user has the business role BR_ADMINISTRATOR assigned.
Result
The business user is successfully logged in and has the BR_ADMINISTRATOR business role assigned.
Further Information
Create a Communication Channel for Communication with SAP Integration Suite, Event Mesh
To enable SAP S/4HANA Cloud Public Edition to send events to Event Mesh, a communication channel must be created as a communication arrangement within SAP S/4HANA Cloud Public Edition.
In this exercise, we will create a communication arrangement in SAP S/4HANA Cloud Public Edition. Authentication is done using the service key of the SAP Integration Suite, Event Mesh instance with the message-client plan.
Prerequisites
In SAP S/4HANA Cloud Public Edition, the login user must be maintained as a Business User with the BR_ADMINISTRATOR business role.
Task 1: Create a Communication Arrangement
Steps
Log in to SAP S/4HANA Cloud Public Edition.
Launch the Communication Arrangements app.
Click the New button.
In the Scenario field, search for and select Enterprise Eventing Integration with Scenario ID SAP_COM_0092.
Click the selected entry to confirm and transfer it to the Scenario field.
After selecting the Scenario ID, the previously created Service Key from the SAP Integration Suite, Event Mesh instance must be pasted into the Service Key field.
Note
Before pasting, the service key must be manually extended with the following entry inside the messaging section of the amqp10ws configuration: The namespace must consist of exactly three segments. In this example: demo/ s4hc/e4l.
| 1 ........ |
| 2 "namespace": "demo/s4hc/e4l", |
| 3 "messaging": [ ....... |
Then, paste the extended service key into the Service Key field.
Choose a name for the Arrangement. It must not start with SAP and must not contain hyphens (-).
Next, assign an Inbound Communication User or create a new one using the New button.
Then, click the Create button.
If everything is valid, the communication arrangement is successfully created, for example, with the name ESA-DEMO_0092.
The previously entered values—such as the extended service key, the namespace, and the communication arrangement name—are visible in various sections of the created arrangement.
Result
A communication arrangement has been successfully created, enabling the Enterprise Eventing scenario to connect to the Event Mesh message client. It allows both system events and custom events to be sent to the Event Mesh queue.
Further Information
Configure Outbound Topics for the Communication Channel
In the previous step, the technical connection between SAP S/4HANA Cloud Public Edition and the Event Mesh capability in SAP Integration Suite was established via a communication arrangement. To enable event transmission, the events must now be assigned to a topic. A topic serves as a logical address for events and enables the routing of message traffic within Event Mesh. Each event must be assigned to a specific topic so it can be received and processed by subscribers. This assignment is done by defining corresponding event topics in the SAP S/4HANA Cloud system, which are then registered and processed through the Event Mesh queues. Without this binding to a topic, events cannot be properly published or consumed within Event Mesh.
In this step, we bind existing business events to the previously created communication channel.
Prerequisites
In SAP S/4HANA Cloud Public Edition, the login user must be configured as a Business User with the BR_ADMINISTRATOR business role.
Task 1: Assign Topics
Steps
Assign topics to the communication channel
In SAP S/4HANA Cloud Public Edition, navigate to the Enterprise Event Enablement app.
Locate the communication arrangement you just created—referred to here as a Channel. In our case, this is EDA_DEMO_0092.
Click on the entry.
A detail page opens.
Verify that the correct channel is selected and that it is active.
Select the Outbound Topic Bindings tab.
Click the Create link.
Then, click the selection icon in the search field on the right.
A search mask appears, it shows all available topics in the system. Each topic corresponds to an event that can be triggered.
Search for Business Partner events by entering the search term Business into the search field.
Then, select the following topics:
| 1 sap/s4/beh/businesspartner/v1/BusinessPartner/Changed/v1 |
If the assignment was successful, the selected topic name displays.
Copy the topic name. You will need it in the next step in Event Mesh.
Result
We have now assigned a topic (or event) to the channel (that is, a communication arrangement). This completes all the required preparations within SAP S/4HANA Cloud Public Edition.
Further Information
Create a Topic Subscription in the Event Mesh Queue
After configuring SAP S/4HANA Cloud Public Edition to emit business events, we now must register the topic name of the selected event, sap/s4/beh/businesspartner/v1/BusinessPartner/Changed/v1, in the Event Mesh queue that was previously created.
In this exercise, we will add a topic subscription to the queue created earlier.
Prerequisites
- A subscribed SAP Integration Suite.
- An activated Event Mesh capability in SAP Integration Suite.
- The required role collections for Event Mesh must be assigned to the platform user.
- An existing SAP Integration Suite, Event Mesh instance with the message-client plan.
Task 1: Create a Topic Subscription in the Previously Created Queue
Steps
Create a topic subscription in the previously created queue.
Open SAP Integration Suite.
Navigate to Configure→Event Mesh.
Click on the previously created Message Client, here named emis-s4hana.
A detail view opens, showing all queues configured within this message client.
Click on the name of the queue.
A new screen opens.
Click the Create button in the selected queue here: emis-s4hana-uc123.
Construct the topic subscription using the following schema:
- Namespace from the extended service key: demo/s4hc/e4l
- Topic name of the outbound event: sap/s4/beh/businesspartner/v1/BusinessPartner/Changed/v1
- Separator: ce
Final topic subscription: demo/s4hc/e4l/ce/sap/s4/beh/businesspartner/v1/BusinessPartner/Changed/v1
Copy the topic subscription into the Topic Name field of the Create Topic Subscription form.
Confirm by clicking the Create button.
Result
All necessary preparations on the Event Mesh side now have been completed to receive business events from SAP S/4HANA Cloud public edition into the Event Mesh capability in SAP Integration Suite.
Create Credentials for Inbound Adapter
Now, let's read and further process the Business Event (Cloud Event). In the following example, we will create an iFlow using Cloud Integration. The iFlow pulls messages using an AMQP inbound adapter. To configure this adapter, OAuth2 Client Credentials are required. These credentials are managed under Manage Security Material.
In this exercise, we will create the required OAuth2 Client Credentials under Manage Security Material.
Prerequisites
- The Cloud Integration capability must be successfully activated in SAP Integration Suite.
- The integration user must be assigned the PI_Integration_Developer and/or PI_Administrator role collections.
Create Credentials for Inbound Adapter
Task 1: Create OAuth2 Client Credentials
Steps
Create OAuth2 client credentials for the AMQP inbound adapter under Manage Security.
In your SAP BTP subaccount, navigate to Services→Instances and Subscriptions.
Click the Integration Suite link.
In SAP Integration Suite, go to Monitor→Integrations and APIs.
Click on the Security Material tile.
Click the Create button in the upper-right corner.
From the dropdown list, select OAuth2 Client Credentials.
Fill in the form fields with the data from the service key of the SAP Integration Suite, Event Mesh instance.
Click Deploy.
Result
The required OAuth2 client credentials have been saved under the name emis in the Manage Security Material section.
Further Information
Create an iFlow to Read Cloud Events
Now, we want to read and further process the Business Event (Cloud Event). In this example, we create an iFlow using SAP Integration Suite, Cloud Integration. The iFlow pulls events via the AMQP inbound adapter. For authentication, we use the client credentials created in the previous step.
In this step, we create a simple iFlow that reads cloud events using the AMQP inbound adapter.
Prerequisites
- The Cloud Integration capability is successfully activated in the Integration Suite.
- The integration user is assigned the PI_Integration_Developer and/or PI_Administrator role collections.
Note
For participants attending an on-site training only: This exercise will be discussed theoretically by your trainer and will not be carried out on the training system.
Task 1: Create a Simple iFlow Template
Steps
In the Integration Suite, navigate to Design→Integration and APIs.
Click the Create button.
Enter a name and short description in the form.
Then, click the Save button.
Go to the Artifacts tab and open the menu under the Add button.
Select Integration Flow.
Assign a meaningful name and click Add and Open in Editor.
Click the Edit button and drag a Groovy Script element from the palette.
After inserting it, click the plus icon to insert a standard script.
Accept the suggested script, click Apply, and then Close.
Back in the main window, click Save.
Configure the AMQP Inbound Adapter
Click on the Sender and connect it to the Start event.
In the pop-up adapter selection, choose AMQP.
Then, select WebSocket.
In the Connection tab, add the Host, Path, and Port from the service key. The host starts with wss://
Ensure that there is a leading slash / in the Path.
Under Authentication, choose OAuth2 Client Credential.
In Credential Name, enter the alias of the client credentials created earlier—in our case: emis.
Now, open the Processing tab and enter the name of the queue to be read—in our case: emis-s4hana-uc123.
Leave all other parameters as suggested.
Save the iFlow.
Test the iFlow
Once the iFlow is deployed, it starts reading the events from the queue.
Currently, there are three events stored in the queue.
Click the Deploy button.
Navigate to Monitor→Integrations and APIs→All Artifacts.
Result
The available events have been successfully read. This confirms that the demo was implemented successfully.
Test the Whole Scenario: Send Business Event
In this step, we change the name of a business partner in SAP S/4HANA Cloud Public Edition and check whether a change event was triggered and whether it was processed in the configured iFlow.
Prerequisites
- In SAP S/4HANA Cloud Public Edition, the login user must be configured as a Business User with the BR_ADMINISTRATOR business role.
- An existing Message Client: emis-s4hana.
- An existing Queue: emis-s4hana-uc123.
- An existing Topic Subscription: sap/s4/beh/businesspartner/v1/BusinessPartner/Changed/v1.
- An iFlow has been created with any name whose AMQP is configured against the created emis-s4hana-uc123 queue.
- The login user has the necessary Role Collections to call up the trace of the iFlow.
Note
For participants attending an on-site training only: This exercise will be discussed theoretically by your trainer and will not be carried out on the training system.
Task 1: Change a Business Partner in SAP S/4HANA Cloud Public Edition
Steps
Log in to SAP S/4HANA Cloud Public Edition.
Open the Maintain Business Partner app.
Select or search for an existing Business Partner.
Click the Start button.
Click the selected Business Partner.
Click Switch Between Display and Change.
Modify any attribute of the selected Business Partner.
Click the Save button.
Verify in SAP S/4HANA Cloud Public Edition if an Event Was Created and Sent
Open theEnterprise Event Enablement–Event Monitor app in SAP S/4HANA Cloud Public Edition.
Check whether an event was processed under your channel. In our example, the channel EDA_DEMO_0092 has processed an event.
Click on the EDA_DEMO_0092 channel.
Click the topic: demo/s4hc/e4l/ce/sap/s4/beh/businesspartner/v1/BusinessPartner/Changed/v1.
Click the Cloud Event ID.
Click Show More to view the event details. The Business Event—also known as the Cloud Event — was successfully processed in SAP S/4HANA Cloud Public Edition.
Check in SAP Integration Suite, Event Mesh if the Event Was Received
Log in to SAP Integration Suite, Event Mesh.
Navigate to Configure→Event Mesh→emis-s4hana.
Successful retrieval by iFlow
In this case, you do not see an entry in the queue.
Unsuccessful retrieval of the event from iFlow
In this case, you see the event in the queue.
Check whether iFlow has processed the event
Navigate to Design→Integrations and APIs→EDADemo→EDA_DEMO.
Click on Deploy.
In the configuration area, click on Deployment Status→Navigate to Manage Integration Content.
Check whether the adapter displays in the Polling Information area.
In the Log Configuration area, change the Log Level to Trace.
Change a business partner again in SAP S/4HANA Cloud Public Edition
After another event has been triggered, caught by EMIS, and picked up by iFlow, we now see it in the trace.
Click on the link Monitor Message Processing.
Click on the link Trace.
Select End→Message Content→Payload.
The fired event displays as payload.
Result
The configured Business Event (Cloud Event) with the topic name sap/s4/beh/businesspartner/v1/BusinessPartner/Changed/v1 was successfully triggered and received. The implementation was successful.