Henning Sanders
Introduction
In the first article of our “Event-driven architecture” series, we introduced the core concepts of an event, explored the benefits of event-driven architectures, and took a closer look at the SAP Event Mesh tool.
In this article, we’ll walk through a concrete example to show how such events can be used within a real-world business process.
Case study – creating an invoice
Case study
In our case study, we focus on an event that’s essential to the operations of any company: invoice creation.
Generating an invoice can trigger a variety of follow-up actions. For instance, the customer may need to be notified that their invoice is available in the customer portal. At the same time, a payment service provider (PSP) may need to be informed to initiate payment collection, as the service has often already been delivered.
The list of possible follow-up actions extends well beyond these examples. But what they illustrate is clear: invoice creation typically needs to trigger more than just a single action.
Understanding the "billing document"
The standard billing creation event has a relatively simple structure – it initially contains only the basic information.
While some initial filtering is possible (e.g. distinguishing between a credit note and an invoice), additional data must be retrieved from the database – using the invoice number as a key – to enable important follow-up actions, such as sending an email. More on that shortly.
Advantages of using SAP Event Mesh
Let’s stick with our example: we want to trigger two follow-up actions as soon as an invoice is created.
- An email should be sent to the customer informing them that their invoice is available.
- The PSP should be informed that it can collect the payment from the customer.
In SAP Event Mesh, we can set up two separate queues that subscribe to the “Billing Document Creation” topic. Accordingly, the S/4 event is sent to Event Mesh, which then delivers it to the subscribed queues.
Each queue can then serve a different recipient:
- Queue 1: for example, a tool or middleware that sends an email to the customer
- Queue 2: a system that communicates with the payment service provider
This setup offers a key advantage: if one recipient is temporarily unavailable, the overall process isn’t disrupted. And thanks to the standard integration between SAP S/4HANA and Event Mesh, the configuration effort remains minimal.
Follow-up actions triggered by events
The event by itself isn’t sufficient to support actions like sending a meaningful email. That’s why we typically use APIs to access SAP S/4HANA and retrieve the necessary information – like the customer’s name, invoice amount, and other relevant details.
SAP Cloud Integration (CI) has proven to be a reliable and powerful platform for this in many of our projects. Using the invoice number as a key, we can retrieve all required data via an OData API and transfer it – bundled together – to the next step, such as an email delivery tool.
With the data prepared, the intended action can be executed immediately – for example, sending a personalised email to the end customer (see below). Thanks to the event-driven architecture, this happens automatically – within just a few seconds.
Final thoughts
We’ve seen successful results with event-driven architecture in recent years – one of our clients has now migrated nearly their entire system landscape to this approach.
The architecture is easy to set up in the standard system and, when combined with SAP Event Mesh and SAP CI, provides exceptional scalability with minimal maintenance effort.
If you’re interested in learning more, feel free to get in touch – we’re always happy to offer demos on our internal systems.
Sound interesting?
Interested in learning more about event-driven architecture in the SAP landscape? Feel free to get in touch – no strings attached.
Whether you’re seeking to build internal expertise through a workshop or need guidance implementing an event-driven strategy, we’re here to support you.
Interested in learning more about event-driven architecture in the SAP landscape?
Whether you’re seeking to build internal expertise through a workshop or need guidance implementing an event-driven strategy, we’re here to support you.
Get in contact today – no strings attached!
Articles recommended for you
Event-driven architecture (1) – SAP Event Mesh
SAP Event Mesh is a cloud-based service on the SAP Business Technology Platform (BTP), helping you build event-driven architectures in the SAP environment.
Event-driven architecture (3) – A deeper look at SAP solutions
In this blog post, we take a closer look at SAP Advanced Event Mesh and SAP Cloud Application Event Hub, explaining their differences and use cases.