Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
Trinidad
Product and Topic Expert
Product and Topic Expert
a collaboration between edward.neveux, gianluigi.bagnoli, ralph, thiago, mariatrinidad.martinezgea, yatsea.li

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 providing some more real life use cases.

Possible options

Let's have a look now to the different options proposed from the architecture point of view:




  1. 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
    .

  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
    .

  3. 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.
    .

  4. 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:

Take advantage of all the proposed techniques (and maybe re-imagine new ones) and let us know how they benefit to your customers!

 
11 Comments
Max_Donzoff
Product and Topic Expert
Product and Topic Expert
Thank you Maria, great blog!
PierreBrothier
Contributor
0 Kudos
Thank you,

it will be great to have real life case. Gettiing event from By Design is one of our concerns.
Gianluigi
Product and Topic Expert
Product and Topic Expert
0 Kudos
Real life cases will be published soon.

They will include both Intelligent Enterprise and localization cases.

Stay tuned !
rcalvo
Discoverer
Hi Maria

Great concept! How would we apply this to SAP Business One? Historically we've had to do things like "log" every transactions in a POST_TN and then pick these up, but this method would be much more efficient.
Trinidad
Product and Topic Expert
Product and Topic Expert
Hi Richard,

Only the proposed option 3 of this blog can be applied to SAP Business One.

Option 1: We don't have an out of the box feature similar to ByDesign Output Management.

Option 2: In SAP Business One SDK we only have UI Events like Save, Validate,... A Sales Order created via Service Layer for example will not fire any event in an SDK add-on.
The only way to get all events from SAP Business One is through the stored procedures as you pointed out.

Option 3: Can be easily implemented on top of SAP Business One. Just replace the APIs calling ByDesign by Service Layer APIs 😉

Let us know if you implement option 3 for SAP Business One! A blog would be very welcome by SAP Business One partners.

Thanks for bringing up this topic to the table.

Trinidad.
former_member530407
Participant
Thanks Maria
geronimo31011
Participant
It's a great informativ blog post! Thanks Maria!
RWeidner
Explorer
0 Kudos
Hi Maria,

how does this approach relate to the new functionality "Event Management" from ByD 2108?

The "Quick Guide" from the documentation does not give very detailed insight.

Is there maybe an update of your blog on the way?

 

best,
Reinhard
knutheusermann
Product and Topic Expert
Product and Topic Expert
Hi Reinhard,

the new ByD feature to configure event notifications adds one more, easy to use and straight forward possibility to realize event-based solutions or to integrate with the SAP Event Mash based on simple create, update and delete events on ByD business objects.

The approaches described in the blog post remain valid, in particular taking into account their specific use cases:

  • The approach using the SAP Cloud Application Studio provides a super flexible possibility to trigger events embedded in the ByD business logic. However, with the new event notifications you don't have to take the effort for simple create, update or delete events anymore.

  • The approach based on the ByD output management is tailored for use cases tightly related to the communication between business partners. The event trigger is connected to the status of business documents and the payload contains all information required for a business communication. It would be a lot of effort to realize something similar based on event notifications and service call backs.


Hope that answers your question.

Best regards,
Knut
MHollender
Explorer
0 Kudos
The only way to get all events from SAP Business One is through the stored procedures as you pointed out.

 

B1IF theoretically gets all events
MHollender
Explorer
Historically we've had to do things like "log" every transactions in a POST_TN and then pick these up

 

Why? Suppose you just add an U_EventProcessed UDF to Marketing Document Headers, with N as a default value, periodically read it and after doing the processing just set it to Y with Service Layer? That avoids the need for Post_TN logging

 

An even simpler approach is logging the last DocEntry that was processed this way in an UDT without an Object, as we are allowed to update those from SQL

 

This is my favorite, because when you realize there was a bug, you can just reset this number