Technology Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
acharyaw
Product and Topic Expert
Product and Topic Expert
1,533

Introduction....

SAP Build Process Automation (SBPA) enables business users to automate workflow processes and tasks without writing code.

Check here for What's New and Learn more from the roadmap.  

This August 2024, SAP Build Process Automation has a released a new way of discovering Business Events from Lobby.

It enables users to discover events from Business Accelerator hub and to view the detailed event catalogue. It also facilitates reuse by creating centrally managed Events projects at Lobby level. Additionally using the Manual Event Specification Upload feature, all the SAP and non-SAP business events supporting CloudEvent1.0 format are supported which can be configured with Event Mesh(or Advanced Event Mesh) at runtime.

This blog will demonstrate the latest features of event triggers in the context of a SAP S/4HANA business use case:

  1. Monitoring Business Events tile
  2. Creating Event Projects from Lobby and consuming the events as event triggers in SAP Build Process Automation
  3. Run Now feature

The business use case explained….

Credit Memo Requests in SAP S/4HANA and SAP S/4HANA Public Cloud 

A credit memo request is a sales document used in complaints processing to request credit for a customer. Creating credit memo requests is a part of Sales and Distribution in SAP S/4HANA.  

In situations where the calculated prices are incorrect, or if discounts are not applied etc. a credit memo request can be created. The credit memo request can be automatically blocked for credit checking. Once it has been approved, you can remove the block. 

The system uses the credit memo request to create a credit memo. 

The SBPA Process for Manage Credit Memo Requests enables the business user to view the Credit Memo Request which are configured for external approvals and make a decision to Approve or Reject the Credit Memo Request which in turn will Release or Reject it in SAP S/4HANA or SAP S/4HANA Public Cloud.

 

acharyaw_24-1726980872260.png

Before we begin….

 

Creating Event Projects From Lobby….

From the SAP Build Lobby, click on Events and click Create . 

acharyaw_25-1726980872261.png

 

There are two options - One to browse SAP Business Accelerator Hub to discover public business events or to upload an event specification file. Choose SAP Business Accelerator Hub for this particular use case.

acharyaw_26-1726980872262.png

Search with Credit Memo and Select Credit Memo Request Events SAP S/4HANA Cloud Public Edition for Business Events

acharyaw_27-1726980872264.png

All the available Credit Memo Request Events are displayed with relevant details. Click Add.

acharyaw_28-1726980872266.png

The Project Name and Description is automatically populated. Click Create to create the event project.

acharyaw_29-1726980872267.png

The Event Project is now created. Click Release to release the project.

acharyaw_30-1726980872268.png

 

Choose the required option and click Release.

acharyaw_31-1726980872269.png

The Event Project is now released. Click Publish to publish the project to Library. Once the event project is released to Library it can be consumed in SAP Build Process Automation(SBPA).

acharyaw_32-1726980872270.png

Click Publish.

acharyaw_33-1726980872271.png

Now the Event Project is ready to be consumed in the SAP Build Process Automation(SBPA) process.

Adding the event trigger….

The events available in the events project released in the above step are available as a part of the Library and can be used in the SAP Build Process Automation(SBPA).

For example, when you add an Event Trigger to the process , it automatically shows the list of events available.

In the SAP Build Process Automation(SBPA) process, click on Add a Trigger.

acharyaw_34-1726980872271.png

Click on Wait for an Event.

acharyaw_35-1726980872272.png

Select CreditMemoRequest Created event and click on Add.

acharyaw_36-1726980872273.png

 

Note that all the required details are filled, click on Create.

acharyaw_37-1726980872274.png

 

The event trigger is added to the process.

 

Designing the process….

A sample business process for Manage Credit Memo Requests could look like the following:

 

acharyaw_38-1726980872275.png

 

  • An event trigger is used to start the business process. The event used here is CreditMemoRequestCreated Event.
  • A further API Call is made to read the header information of the Credit Memo Request. The Credit Memo Request ID from the previous step is used as input for this API Call. The API in this example is
  • GET /A_CreditMemoRequest('{CreditMemoRequest}')
  • A set of business rules define the approver for the Credit Memo Request approval. The output is an approver email ID.
  • The approver determined from the previous step gets an Approval Task to release the Credit Memo Request in My Inbox with details of header and items and an option to Approve or Reject the request.
  • If the approver approves the credit memo request, quotes are added to the Credit Memo Request ID and the Credit Memo Request is released for further processing in the SAP S/4HANA system. The approval status will show ‘Released’ as the status of the Credit Memo Request.  An approval notification is sent to the stakeholders.
  • The API used in this example is POST /releaseApprovalRequest
  • If the approver rejects the credit memo request, quotes are added to the Credit Memo Request ID and the Credit Memo Request Approval Status is updated as Rejected in SAP S/4HANA system. A rejection notification is sent to the stakeholders.
  • The API used in this example is POST /rejectApprovalRequest

Now our SBPA process is ready.

Expert Tip :  Ensure to test your Actions projects and Events setup before testing 
the process to ensure they are working as expected.
This will save time for troubleshooting and debugging later.

 

End-to-end execution….

  • When a credit memo request is created in SAP S/4HANA Public Cloud and is configured for external approval, then it automatically triggers the defined process in SAP Build Process Automation.

acharyaw_39-1726980872276.png

 

  • Just for confirmation, check the Approval Status in the SAP S/4HANA Public Cloud

 

acharyaw_40-1726980872278.png

  • Check if you received the event in Monitoring -> Acquired Events -> Business Events Tile. The events are persisted for 7 days and can be downloaded. Also they are very helpful in troubleshooting to understand if the events are correctly being received by SAP Build Process Automation.

 

acharyaw_41-1726980872280.png

 

  • You should get a task in My Inbox to Approve the Credit Memo Request

acharyaw_42-1726980872282.png

 

Add some comments and click approve.

When a Credit Memo Request is approved, it is released for further processing in the S/4HANA Public Cloud. The approval status will show ‘Released’ as the status of the Credit Memo Request   

acharyaw_43-1726980872283.png

 

OR  Add some comments and click Reject. Check that the S/4HANA Approval Status is updated as Rejected.

acharyaw_44-1726980872285.png

You can also check the SBPA Logs to check the details.

acharyaw_45-1726980872287.png

 

Run Now….

You can now test your processes locally that use event triggers by simulating the event trigger payload without connecting to the system or having an event mesh setup. This is to test if your end-to-end process works fine with the expected payload format for

“Run Now” action for event triggers in Trigger view allows to execute the event trigger in order to initiate event delivery with the user-provided data immediately. For more information, please refer to documentation here.

Below is  sample screenshot from Control Tower-> Environments -> Select your environment -> Triggers tab -> Select the required Event Trigger -> Run Now.

acharyaw_46-1726980872289.png

Enter a valid payload in the Run Now UI and Click Run Now.

acharyaw_47-1726980872291.png

 

The process is triggered with the sample payload.

 Note: The Manage Credit Memo Requests SBPA Process neither replaces nor has all the features of SAP Credit Management or Financial Supply Chain Management. It enables an approval process with information about the credit memo request. Our customers could use and extend this process for exception management, notifications, auditing for the particular credit memo requests after approval from one or more personas like credit manager, finance analysts, etc. 

Other use cases….

There are some additional use cases for business event triggers:

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

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

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

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