Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
acharyaw
Product and Topic Expert
Product and Topic Expert
SAP Build Process Automationcombines workflow management, RPA functionality, decision management, process visibility, and embedded AI capabilities into one intuitive low-code experience. It enables business users and technologists to become citizen developers. With powerful yet intuitive low-code and no-code capabilities, the solution supports you in driving automation by tapping into the expertise of citizen developers. Check here for What's New and Learn more from the roadmap 

Why are Business Events needed in the context of Process Automation ? 


Applications of the past were static, trigger-based, batch updated and hard coded but applications of today are dynamic, event-driven, real-time and responsive. Almost real time solution is good, but not good enough. Hence, event-driven architecture is a non-intrusive way of extending the business functionality and reacting to events without IT support . 

In August, we released Business Event trigger feature in SAP Build Process Automation. The event triggers onboard and listen to business events emitted from external source system and react to such events by triggering processes in SAP Build Process Automation. 

Currently all public events for SAP S/4HANA CE OP and Cloud listed on Business Accelerator Hub are supported. Support for other areas of SAP will be added in upcoming releases. 

So how does it work ? 


Below is a block diagram explaining the flow in brief:


Event Trigger Block Diagram




  1. The Event Mesh (default) in BTP Subaccount is configured to listen to the third-party event 

  2. A business event is created in any third-party system 

  3. The Event Mesh instance listening to this event gets the event details and triggers the configured process in SAP Build Process Automation


Any references for use case in SAP S/4HANA Cloud ? 


As an example, we can consider the Customer Return(BKP) Use Case. Below diagram describes the problem, the skill description and benefits from SAP Build Process Automation. 


Customer Return (BKP)


This is how the process flow could look like in the SAP S/4HANA Cloud system: 


SAP S/4HANA Customer Return Process Flow



What are the pre-requisites for using Business Event Trigger ? 


Before we start creating the business event triggers, there are some pre-requisites that needs to be setup by the IT Admin. For step-by-step process , you can refer to the link Create Event Triggers or the blog Building Extensions for SAP S/4HANA Cloud using APIs and Events . 

Below are some important points to note: 

  1. BTP Subaccount should have the following service assignments under entitlements : Event Mesh (default)S/4HANA Cloud Extensibility (messaging plan)  and SAP Build Process Automation (standard)

  2. When the SAP S/4HANA Cloud System is registered in the SAP BTP Global Account under System Landscape it would look similar to the below screenshot. Note: Administrator rights are required at Global Account level to register the system.


Register System in BTP


        3.The events to be used should be available as outbound topics in the SAP S/4HANA Cloud system. This is a required step for the SAP S/4HANA Cloud system to be able to dispatch the events.  Note: User needs Administrator role in SAP S/4HANA System for this step. 

  1. Outbound Topics In SAP S/4HANA


 

For example, in this case it is the "Customer Return Created" event. Note: We can also use "*" to get all events from Customer Return. The complete list is available in Business Accelerator Hub. 

      4. The event topics should be subscribed in Event Mesh via proper queue. If the event mesh queue is not setup correctly ,the events from the third party system will not reach the Event Mesh. 

  1. Event Mesh Queue

  2. 5. The webhook should be defined and added. If the webhook is not setup correctly, the events will reach Event Mesh but the processes in SAP Build Process Automation will not be triggered. 



Event Mesh Webhook


Once the event reaches the Event Mesh instance, and we are able to consume the messages via Test the setup is complete. In upcoming releases, we will have a "Monitor Events" UI which will make this check much simpler by showing the events that reach the SAP Build Process Automation. 

Note: The setup is more easier for SAP S/4HANA OP. Please refer to the blog Configure SAP Enterprise Messaging for SAP S/4HANA On-Premise 2020 via Service Key  for step-by-step details. 

Now, a citizen developer is all set to create the business event trigger for processes in SAP Build Process Automation. 

How to create and consume triggers based on events ? 


For detailed step by step guide follow Create Event Triggers documentation. 

For the Customer Return use case, the event required is Customer Return Created event. 


Customer Return Created Event


Note: Once the event is added as trigger, the payload defined in the event is available as Process Inputs and can be used later in the process for actions, decisions, mail notifications, etc.  

Event Trigger Outputs / Process Inputs


This is very helpful as most of the times in SAP S/4HANA , the events contain minimum information of the business object. For practical implementations of business processes, further API calls via Actions are  necessary which need the business object ID and other parameters coming from the event payload. 

For example, we can add a step for getting the details of the Customer Return and the documents created after customer return for triggering an approval process for performing the next step i.e. execute picking.  

For all APIs for Customer Return , refer to the list on Business Accelerator Hub.  

There could be many variations for the Customer Return process. One such sample process could look like the following: 

  1. Customer Return Event trigger is defined 

  2. The Customer Return ID from the event payload is used for an API call for Action to get header details and retrieve subsequent documents 

  3. An approval form for executing picking is created for the Customer Return. The details in the form could be populated from the API calls made in the previous step.  

  4. In case of an approval, the execute picking API call can be done via Actions based on the document number received in step (ii) and an email notification is sent. 

  5. In case of a rejection, an appropriate email notification is sent. 



Sample Process


The project needs to be deployed and released for the event trigger to work.  

Now, when the customer return is created in the SAP S/4HANA System, the business event trigger executes the process. The required API calls for reading the header of return order and for reading the advanced returns process steps are called and the sample approval form is available in My Inbox.  


Sample Approval Form


After approval or rejection an appropriate email notification is sent. 

Note: Event Mesh instance is per subaccount. Hence, if there are multiple projects have event triggers for the same event, when the event is fired from third-party system, multiple processes will be triggered.  

This is a sample flow but the complete flow can be customized and implemented as required. 

What is coming up ? 



  1. Monitor Events : The events and the payload coming from the event mesh will be available on the UI for testing/validating in a Monitor Events tab. 

  2. Run Now : The event trigger can be tested with the required payload like a runtime simulation.  

  3. Event Discovery via Lobby and consumption in SAP Build : The business events will be available for discovery via Lobby and can be consumed similar to Actions. 

  4. Events Discovery based on third party systems : Business Events can be discovered based on connected systems. 


Any other use cases ?


Business Event Triggers in SAP Build Process Automation for SAP S/4HANA: Manage Credit Block on Sale...

Do write to me in case of blockers, queries and feedback.

 

 
9 Comments