Business Event Triggers in SAP Build Process Automation for SAP S/4HANA: Manage Credit Block on Sales Orders
2023-10-4 04:10:42 Author: blogs.sap.com(查看原文) 阅读量:8 收藏

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 (BKP) Use Case , 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.

Event-driven%20architecture%20for%20Sales%20Order%20packages

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%20Journey%3A%20Create%20an%20event-based%20trigger%20for%20Manage%20Credit%20Block%20on%20Sales%20Order

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%20Order%20Created%20Event

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%20Order%20Created%20Event%20Trigger%20Outputs%20/%20Process%20Inputs.

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 of the business object due to security reasons. 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, 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.
  11. Sample%20Process%20for%20Manage%20Credit%20Block%20on%20Sales%20Order

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.

Sample%20Approval%20Form

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%20Approval%20Form

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.

OK

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.

Do let me know in case of queries or feedback.


文章来源: https://blogs.sap.com/2023/10/03/business-event-triggers-in-sap-build-process-automation-for-sap-s-4hana-manage-credit-block-on-sales-orders/
如有侵权请联系:admin#unsafe.sh