Orchestrating Robotic Process Automation with SAP ...
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.
The pursuit of Efficiency improvement is one of main objectives for a modern company since the invention of Scientific Management by Frederick Winslow Taylor, especially on the labor productivity increase through analysis and synthesis of workflow, standardization of best practices etc during the second industrialization era, also well known as Taylorism. A scene of Production Automation with machinery in factory is well illustrated in movie Modern Times starred by Charlie Chaplin.
With the development of modern Scientific Management after World War II, and the invention of modern computer, computer-based management software becomes the "central nerve system" of a business, centrally planing the business activities, execution monitoring, managing and coordinating all the resources within and even beyond the company, which has taken the practices of scientific management for efficiency yield to the next level.
The customers, suppliers, employees, materials/products etc of a company in real-world are reflected as some system records of master data, and the interaction and exchange between customer, supplier, and other parties are mapped as the transactional records of system. A set of related activities or tasks are grouped and structured to form a business process, such as Order-to-Cash process. Its information flow is made up of
Data entry of system record representing the states of the process, such as a record of sales quote has been entered into system by the sales representative or sales assistant, which indicates the early state of order-to-cash process where customer seems interested on the company's product or service, and request for a quote, now the sale representative has responded with a sales quote to the customer.
User tasks recording human intervention in the process, such as an exception of price condition in the sales quote triggers an approval request to sales manager, where sales manager needs to make a decision to approve or not.
Notification of state change about the process to human agent for communication and collaboration, such as the sales representative receives an internal system message once the sales quote is approved, and whist, the sales quote is automatically emailed to the customer.
Any manual activity in a sequential process will potentially slow down the whole process, any error by human may lead to economic loss or efficiency deficit.
Therefore, Process Automation is key to improve operation efficiency by reducing the repetitive manual processes, and eliminating the human error. Especially, with the recent years' technological advance on AI/ML, IoT etc intelligent technologies. Robotic Process Automation is fueled with intelligence, where we have SAP Intelligent Robotic Process Automation to create, schedule, manage, and monitor intelligent bots for business process automation.
On the other hand, Process Orchestration is crucial to achieve business agility, process flexibility and process visibility by connecting and orchestrating business activities, user tasks and communication/collaboration, where SAP Workflow comes into place.
Phew, what a lengthy opening! I am not here to discuss scientific management, but to share my exploration of SAP Workflow Service and SAP Intelligent RPA, seeing how we can put together process orchestration and process automation to achieve business agility and operation efficiency in one shot. In addition, the scenarios of synergy & integration between SAP Workflow Service and SAP Intelligent RPA have been well explained in the blog post about The synergy & integration between SAP Intelligent BPM and SAP Intelligent RPA by seshadri.sreenivasr, which is really an informative and worthy read.
The objective of this blog post is not to discuss the design of an SAP Intelligent RPA Bot. Instead, it aims to show how easy to implement a predefined bot by SAP, and how you can extend it with SAP Workflow.
Sample Scenario - Automation of Mass Maintenance of Sales Prices in SAP S4/HANA or SAP S4/HANA Cloud
Let's start the story with John, a sales assistant of Amika, one of John's responsibility is to maintain the sales prices of the products in their ERP system SAP S4/HANA Cloud. Hundreds of sales price are manually entered into the system by John, which usually take John a few days, and it is error-prone in such a repetitive manual task. The company have recently implemented SAP Intelligent RPA to automate their manual process. Fortunately, Mass Maintenance of Sales Price is available as the a predefined scenario SAP Intelligent Robotic Process Store, which the partner can help to implement it and go live easily by following its configuration guide.
Here you have the video how to configure the mass maintenance of sales prices bot for SAP S4/HANA Cloud.
Now with in place of SAP Intelligent RPA, what john needs to do is to prepare the Sales Prices in the predefined excel template, then he can trigger the process automation in attended mode or with a schedule job in unattended mode. As a result, the entire process of sales prices maintenance is significantly reduced with process automation.
Here you can see how John can run the bot to automate the process of creating and updating the price conditions.
However, the sales manager Janet would like to have some visibility of the the process, which the sales prices list should be reviewed and approved in prior to data entry with the automation, assuring the sales prices are correctly maintained.
As a partner, you could have two options to achieve so by orchestrating the process automation by SAP Intelligent RPA Bots with SAP Workflow
Option 1: (Covered in this blog post)How to enhance a predefined SAP Intelligent RPA bot about mass maintenance of sales prices in SAP S4/HANA Cloud by adding an approval request for reviewing and approving the changes of sales prices condition in prior of the automation. Exactly the same approach as Scenario 2: Trigger the SAP Intelligent RPA bot from SAP Cloud Platform Workflow in Seshadri's blog post mentioned above.
Option 1: Orchestrating the SAP Intelligent RPA Bots explicitly with SAP Workflow Service through API trigger
Given a SAP Intelligent RPA Bot could be triggered through API, and SAP Workflow Service can fire an http request with a Service Task, therefore, we can explicitly invoke and orchestrate an SAP Intelligent RPA bot with a Service Task in SAP Workflow Service. You may refer to Seshadri's blog post for a detailed explanation.
Prerequisites:
You have gone through this Tutorial to Get Started with SAP Workflow Service
An API trigger to the Bot has been added for the package Mass Maintenance of Sales Prices in an Environment.
Basis of extending and orchestrating an SAP Intelligent RPA Bot with SAP Workflow Service.
Here you have video to explain the detail about how to extend an SAP Intelligent RPA Bot with SAP Workflow Service by adding email notification, user task for approval and service task to trigger the bot through API.
The overall workflow design of sales_price_workflow as
An sample of a workflow instance of workflow sales_prices_workflow through REST API, which you can refer to api.sap.com for more detail.
The configurations of the new approval email notification
To: ${context.salesPrices.approveBy}
Subject: Approval required for Mass Maintenance of Sales Price by SAP Intelligent RPA
Plain Text Body:
Dear ${context.salesPrices.approveBy},
There is a new request pending for your approval.
Request By: ${context.salesPrices.requestBy}
Request At: ${context.salesPrices.requestAt}
Sales Prices Excel Base Folder: ${context.salesPrices.excelBaseFolder}
Request Remarks: ${context.salesPrices.remarks}
Therefore we can configure the url of destination irpa_api_trigger with the common part, such as https://api.irpa-trial.cfapps.eu10.hana.ondemand.com/runtime/v1/apiTriggers, the rest /<YOUR_BOT_TRIGGER_ID>/runs will be set up in the path of service task in workflow as screen shot of Service Task Properties above as /d629028f-ef7f-4875-8198-207b1c564dd1/runs. During the run-time, the service task will compose the full url to trigger by combining the url in destination and path in service task for the http request.
Authentication: OAuth2ClientCredentials. Please refer to this online help for details of OAuth2ClientCredentials
Client ID: The client id from the service key of your SAP Intelligent RPA tenant
Client Secret: The client secret from the service key of your SAP Intelligent RPA tenant
Token Service URL: The authentication url to request access OAuth2.0 token from from the service key of your SAP Intelligent RPA tenant. Please refer to this online help about details. For example, the service key of my SAP Intelligent RPA tenant like this.
resultEmail.subject = 'Request ' + decision + ' for Mass Maintenace of Sales Prices ' + $.context.salesPrices.excelBaseFolder;
resultEmail.body =
'Dear '+ $.context.salesPrices.requestBy +
',\n\nYour request about mass maintenance of sales prices has been '+ decision + ' by ' + $.context.salesPrices.approveBy
+'\n\nPrice Excel Path: '+$.context.salesPrices.excelBaseFolder
+'\nRequested At: ' + $.context.salesPrices.requestAt
+'\nRemarks: ' + $.context.salesPrices.remarks
+"\nApprover's remarks: " + $.context.salesPrices.approvalRemarks
+'\n\nThis is a auto-generated email notification by SAP Worflow Service. Please DO NOT reply.'
+'\n\nKind Regards,'
+'\nSAP Workflow Service';
$.context.resultEmail = resultEmail;
Step 7: Result email notification with a mail task
A sample of result email in run-time
Summary
As you can see, we can easily enhance a process automation of SAP Intelligent RPA Bot with SAP Workflow Service by adding email notification for communication with mail task, user task such as approval, and triggering the SAP Intelligent RPA Bot via API trigger with service task. As a result, we can achieve Process Automation for Operation Efficiency and Process Flexibility for Business Agility at the same time.
In the next blog post, we'll do the same scenario with built-in Process Orchestration capability of SAP Intelligent RPA Cloud Studio, which has the build block of automation, user task and process.