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 Automation is a simpler and faster way to automate business processes. It provides a unified Low-Code/No-code development experience to combine orchestrated workflows with Robotics Process Automation and Business AI in a single development environment. Check here for What’s New and Learn more from the roadmap 

In my Blog post Business Event Triggers in SAP Build Process Automation for SAP S/4HANA Cloud : The Customer Return ... , I have covered the concepts of business events and how to configure business events for the use case for Customer Return for SAP S/4HANA Cloud. In continuation to the same, in this blog post we will learn how to create an event-trigger for "Manage Credit Block on Sales Order".

So, what is the use case about?


"Manage Credit Block on Sales Order" business process enables customers to automate the approval of Sales Orders which are Credit Blocked in a flexible and transparent way. It provides flexibility in determining approvers depending on attributes like customer group, sales organization, order amount, currency etc. When a sales order is created in SAP S/4HANA (on-premise or cloud) and is automatically blocked for credit, a pre-configured process is triggered in SAP Build Process Automation. This use case is also applicable for Sales Orders which are changed and blocked for credit.


Event-driven architecture for Sales Order packages


 

How to get design the process?


Pre-requisites: Event Mesh configuration is done as per the pre-requisites mentioned in blog.

 


User Journey: Create an event-based trigger for Manage Credit Block on Sales Order


 

For detailed step by step guide on how to add event triggers to a process, follow Create Event Triggers documentation.

For the "Manage Credit Block on Sales Order" use case, the event required is Sales Order Created event. Details of the event is available on Business Accelerator Hub.


Sales Order 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.


Sales Order Created Event Trigger Outputs / Process Inputs.


 

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

For example, to get the Net Value and Currency of a Sales Order, there is a need to make further API call which takes the Sales Order from the event trigger as an input.

Please refer to Business Accelerator Hub for details on the APIs for Sales Order and Sales Document with Credit Block.

There could be many variations for the Sales Order process. Follow the YouTube video to create the process step by step: 🟣 Start Automating Your Work with SAP Build Process Automation.

A sample process could be like the following:

  1. Sales Order Created event trigger is defined.

  2. The Sales Order ID from the event payload is used for an API call for Action to get header details for Sales Order.

  3. Condition is defined on the data received in Step 2 i.e., if the Sales Order is in credit blocked state, then continue with the process else terminate.

  4. The Sales Order ID from the event payload is used for an API call for Action to get details for credit blocked Sales Order. This API call is required to retrieve the Sales Document Type which will be used later to remove the credit block.

  5. Decisions to determine Approver.

  6. An approval form for removing the credit block on Sales Order. The details in the form could be populated from the API calls made in the previous steps.

  7. In case of approval, use API for POST to remove the credit block in the SAP S/4HANA system. CAP Services might be required to enhance data as required by the APIs in Actions.

  8. Add email notifications to inform stakeholders regarding the approval / rejection status for removal of credit block on sales order.

  9. (Optional) Auto approval can be configured for quicker processing time. For example, if the net value is less than 500 EUR, then automatic approval for removal of credit block can be done.

  10. Release and deploy the project for the event trigger to work during runtime.



Sample Process for Manage Credit Block on Sales Order


 

How to test the process end-to-end?



  1. Create a Sales Order with credit blocked state in the SAP S/4HANA.



Credit Check - Not OK


2. The business event trigger executes the above configured process in SAP Build Process Automation and the approval form is available in My Inbox.


Sample Approval Form


3. Approve the form and check for email notification.

4. To confirm, check that the credit block is removed for the sales order in SAP S/4HANA.


Sales Order after Credit Release


Note:

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

  2. Event Mesh instance is per subaccount. Hence, if there are multiple projects have event triggers for the same event, when the configured business event is fired from any system, multiple processes will be triggered.


Any additional information ?


The above use case demonstrates the usage of Sales Order Created (with a credit blocked state) use case.

Alternatively, the process can also be triggered when an existing Sales Order is blocked for credit using the event "Overall credit check status changed". More details can be found on Business Accelerator Hub.

The payload for the event would change slightly:


YouTube Video : Add Event-Based Triggers To Your Processes

Additional Use Case: Business Event Triggers in SAP Build Process Automation for SAP S/4HANA Cloud : The Customer Return ...

 

Do let me know in case of queries or feedback.
5 Comments