How to get SAP Business ByDesign events in a loosely coupled solution
Intelligent Enterprises are Integrated Enterprises. Digital is transforming the businesses these days. New innovations are required to connect hundreds and thousands of devices, applications, and systems in an enterprise world. In a complex environment with data coming from heterogeneous systems, for example, SAP/Non-SAP, Cloud/On-Premise, integration becomes a key component in order to cope up with diverse technology and business data of diverse format.
In this on-demand economy, people simply aren’t willing to wait — even for 1:1 interactions or personalized experiences. Your company is operating in an economy that demands real-time processes, and your customers demand a real-time experience with instant access to accurate data shared among different applications.
To achieve real time interactions event-driven architectures are commonly used. With an event-driven system, the capture, communication, processing, and persistence of events are the core structure of the solution. This differs from a traditional request-driven model. Many modern application designs are event-driven.
Benefits of event-driven architecture are:
- Event-driven apps can be created in any programming language because event-driven is a programming approach, not a language.
- An event-driven architecture is loosely coupled because event producers don’t know which event consumers are listening for an event, and the event doesn’t know what the consequences are of its occurrence.
- Organizations can add event-driven architecture to their systems and applications to improve the scalability and responsiveness of applications and access to the data and context needed for better business decisions.
Generally, for the custom development of SAP Busines ByDesign, it is recommended to follow the “Keep the Core Clean” principle. The extension inside of ByDesign (In-App Extensibility) should be limited to applications that require full integration with core features that cannot be developed outside. Whenever possible we should develop Side-by-Side applications or integration scenarios accessing SAP ByDesign APIs like already proposed in the Loosely Coupled Solutions for SMBs Topics blog post.
But how can we get events from SAP Business ByDesign? What if we want to trigger an external process when an SAP Business ByDesign business object instance is created/updated? There are several possible solutions and the goal of this blog post is to list the different options and give you pointers where you can find detailed information to learn how to implement each one of them.
I’m sure you can imagine many use cases where a loosely coupled solution will help optimize your customers daily processes and speed up your implementations, let me just list some we have imagined:
- Create an Electronic Invoice every time a Customer Invoice is created on SAP Business byDesign, sign the Customer Invoice back as soon as the Tax Authority issues the Electronic Invoice number.
Full implementation details available in this blog: Electronic Invoice and the event-driven architecture.
- Run an external application that calculates taxes for the SAP Business ByDesign transactions. Check the blog The guide: hybrid tax calculation for a full description on how to get it implemented.
- Start a robot based on ByDesign Service Requests.
Check the blog Your Life is Event-driven and so Should be Your Solution for more details on that use case.
- Start the shipping process on an external 3rd party software for each Sales Order created in SAP Business ByDesign.
- Export all Invoices in a specific electronic format to a legal authority.
And if you still don’t agree events are very important in our every day transactions please check the blog Your Life is Event-driven and so Should be Your Solution from my colleague Ralph Oliveira providing some more real life use cases.
Let’s have a look now to the different options proposed from the architecture point of view:
- Out of the box functionality – ByDesign offers a feature called Output Management that allows you to define triggers on business documents based on a process-integrated output like for example, when a document is released by the document owner or when a manager has approved the document. This feature is limited to Business Documents only and therefore will not support Master Data changes.
Check the following blogs for more details on Output Management:
SAP Business ByDesign Output Management – part 1
SAP Business By Design Output Management – part 2
- Internal Event pushing implementation– An event bridge prototype implemented with SAP Cloud Application Studio that captures the Creation/Update/Deletion operations on SAP Business ByDesign system and custom business objects and pushes event messages to external messaging queues such as SAP Cloud Platform Enterprise Messaging, SAP Cloud Platform Integration, Azure Service Bus, AWS SQS etc, which trigger external applications for processing. This prototype enables a state-of-art event publication and subscription mechanism for SAP Business ByDesign.
Bridging the event pub/sub for SAP Business ByDesign with an internal push approach
- External Event pulling implementation – A loosely coupled approach, with no artifacts residing in SAP Business ByDesign, that recurrently pulls changes from specific Business Objects. Those changes are then processed and pushed into a Publisher/Subscriber queue that broadcast it to several consumers. In this example, we used as examples Twitter, SAP Cloud Platform and iRobot.
External Event Pulling – A Decoupled Approach for SAP Business ByDesign Event Handling.
- Hybrid solution based on ChangeHistory reuse library. – Capture the changes using the ChangeHistory.Read reuse library, then use the External Event pulling implementation to read the ChangeHistory data.
SAP Business ByDesign internal events using the ChangeHistory reuse library.
Our list of blogs for this topic is now completed, here you have the full set of blogs:
- Your Life is Event-driven and so Should be Your Solution
- SAP Business ByDesign Output Management – part 1
SAP Business By Design Output Management – part 2
- Bridging the event pub/sub for SAP Business ByDesign with an internal push approach
- External Event Pulling – A Decoupled Approach for SAP Business ByDesign Event Handling
- Electronic Invoice and the event-driven architecture
- The guide: hybrid tax calculation
- SAP Business ByDesign internal events using the ChangeHistory reuse library
Take advantage of all the proposed techniques (and maybe re-imagine new ones) and let us know how they benefit to your customers!