
Welcome to our Blog Series on SAP BTP, where we delve into Build Process Automation for real-time business requirements and effortlessly handle complex scenarios using low-code and no-code development.
In this post, my colleague Adwait and I will delve into a complex solution that combines low-code and no-code techniques to streamline workflow design and approval with Auto Approval / Rejection Functionality.
Stay tuned for detailed insights, step-by-step instructions, and practical examples as we dive into the intricacies of SAP process automation. Whether you are a developer, business analyst, or SAP enthusiast, this series aims to empower you with the knowledge needed to optimize your processes.
When dealing with intricate workflows, there is often a need for automatic approval or rejection based on specific conditions. Consider the following real-world Budget Approval Workflow scenario:
Employee submits a budget approval form: An employee initiates a budget approval process by submitting a form. This form triggers a workflow that involves multiple steps.
Manager’s approval: The workflow routes the approval request to the employee’s manager. The manager receives the work item in their inbox.
Deadline considerations: If the manager fails to approve the request within a certain deadline, the workflow should automatically reject the request and mark it as completed.
In this blog post, we will explore a highly scalable solution that can be adapted to various business requirements. Our focus is on automating approval processes when deadlines are missed. Here are the scenarios we have considered:
We can understand the complete development flow with the step-by-step instructions.
Step 1 & 2 : SAP BTP BPA Setup In the SAP BPA setup, we have two key steps. First, ensure that the SPA BTP SAP Build Process service instance and service key are available. Assuming this is already in place, move on to the next step: make sure the SAP BPA Destination is also set up. Below, you’ll find a sample diagram illustrating the SAP BPA Destination, which will be used later to trigger the SAP BPA API for task retrieval and task completion.
Step 3 & 4 : API Identification from SAP API Hub aka Business Accelerator , Before delving into the solution, let’s closely examine the SAP Build Process Automation API. Together, we’ll explore how this API facilitates Workflow Tasks and Task Completion. Additionally, we’ll learn how to use it to post SAP Build process automation tasks:
Querying the SAP Build Process Automations Tasks which are in “READY” Status.
In the SAP API hub, specifically the SAP Business Accelerator Hub, you’ll find the API that allows us to retrieve user task instances based on specific parameters. To get started, follow these steps:
Important Attributes | Values |
Client ID | <<Value of client id from SAP BPA Service key>> |
Client Secret | <<Value of client secret from SAP BPA Service key>> |
URL | |
OAuth Token URL | https://<<YOUR Domain>>.authentication.eu10.hana.ondemand.com/oauth/token |
let's understand the above flow in a glance:
Patch the Task via API: sample Payload for the Patch API which will be used to update task
{
"subject": "Patch API Sample",
"status": "COMPLETED",
"decision" :"approve"
}
Step 5 & 6: SAP Build Process Automation based Actions Project with API from Step 3 & 4
Implementation of the SAP Build Process Automation Based Actions Project. We have created a Action project named Auto approval action and selected the Api for the Querying tasks and update the tasks by ID. We have shown above how we will pass the parameters in sequence.
Below diagram will help you to create the action project step by step instructions.
Step 7 & 8 : Approval Step in workflow: For demonstration purposes, we’ve set up a straightforward approval step that automatically approves tasks if they remain incomplete for one day.
The following sequence outlines the critical steps for this blog Below sequence of steps are the most critical steps for this blog.
Remember to configure the details of each step according to your specific workflow requirements. Feel free to customize the timer duration, approval criteria, and any other relevant settings.
Remember to adapt any additional settings / API / Logic as needed.
Wow, We Are Done with Auto Approval! 😊
For testing purposes, feel free to set the wait time as short as 1 minute.
This approach can be scaled for auto approval, rejection, or escalation to the next level.
Conclusion Remarks: I hope you enjoyed this blog. The techniques discussed here can be applied to various scenarios, enhancing efficiency, and streamlining processes. For more insights into handling further complexity, stay tuned for our next blog by my colleague, Adwait.
Thank you for reading, and happy automating!
Please feel free to get in touch with me over Linkedin.
Regards,
Mohit Bansal ,
SAP BTP Platform Advisory & Solution Architect
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |