Automate business processes using Intelligent Robotics Process Automation – Part 2
In the previous blog post, I provided an introduction to SAP’s Robotic Process Automation, the different automation modes along with sample solution diagrams. This blog post will focus on how to setup your environment and get started with your first RPA bot to automate processes in SAPGUI screens. Most of the apps in S4HANA and Cloud Solutions are Fiori/Web based applications. You can create bots which can utilize screens based on different UI technology too. For this blog, I have just used SAPGUI screens.
Please note that iRPA is currently not available in SAP Cloud Platform Cloud Foundry trial accounts.
Installation and setup of components
There are couple of components which you would need to install in order to get started. Follow the installation guide to understand the prerequisites before installing these components in your Windows PC.
- Desktop Agent
- Desktop Studio
- Setup Cloud Factory
To orchestrate and schedule automation jobs, the Cloud Factory needs to be configured. Navigate to your SAP Cloud Platform (SCP) account which has the subscription for iRPA and launch the application.
The “Home” page provides a snapshot of the status of all the jobs and agents which have been configured. Navigate to the “Management” menu.
Within the management menu, there are options to create Environments and Hierarchies.
A hierarchy allows you to organize your computers and users in a parent-child relationship. This is a pre-requisite step before setting up a job in the Cloud Factory. You would need to create a CSV file with a predefined format (as mentioned in the Help documentation). Below is my Hierarchy file.
Use the Import option in the Cloud Factory to upload the hierarchy file and if you would like to reserve this PC for use with unattended jobs, remember to define the date/time range.
An environment represents a landscape in which RPA is deployed. You can create an environment for Dev, Test and Production to have a staged development of your RPA packages. In the below screenshot, I have created an environment called “Test_Environment”.
Within an environment, you must have atleast one variable of type Hierarchy. Hence, you need to create a new variable and link it with the hierarchy defined earlier. You can also create variables to store strings which can be shared between RPA packages and also credential variables to store passwords. In the below screenshot, I have created a new hierarchy variable called “Test” and linked it to the previously defined hierarchy.
This completes the setup of the Cloud Factory to cover basic requirements.
Developing your first RPA bot
Now we are ready to begin with the development of the RPA bot. Launch the Desktop studio from the Windows PC where you have installed it and begin by creating a new project.
Add a new application within your project and select “UIAutomation” as the technology. UI Automation is a standard protocol developed by Microsoft. This will list all the open applications. I am going to show how to build a RPA bot which only uses SAPGUI and hence I have selected SAP Logon. You can create your own scenarios which involve combination of different applications like SAPGUI, browser based Fiori apps and Outlook.
Once your application is created, you can add pages to it. Double click the centre of the blank page to begin capturing a page.
In the “Capture Page” window, you can enable the required options and use Alt+Tab to switch to the required windows. In the example, below its an SAPGUI Logon screen. Select the SAPGUI Logon window using the Shift key (red box appears around the window of your chosen application). Once the selection is made, switch back to the “Capture Page” window and select “Capture and edit”.
Provide a name for the page and click on “Start capture”. This will begin capturing all the screen elements and add it as a page within you application.
Once the page is added, you will be able to view it within the Desktop studio. By default, the newly added page will be displayed in red as the page criterions are not yet set.
You need to add page criterions to enable RPA to identify the corresponding windows at runtime. At runtime, it explores the DOM tree to find all DOM components matching the page’s criterions. The captured data window lists all the properties which were collected. Click on any of those properties which will help to uniquely identify the page. In the below example, I have just used the name property as a criteria.
Declare page items which would allow RPA to recognize them on the page. Just select the elements on the page and add a criteria. In the below example, I only plan to use QKX system. Hence, I’ve selected the page element QKX and added a name criteria. Later in the blog, we will see how we can attach events to this page element.
Similarly, use the “Capture a new page” option to create several other pages.
In the example below, I’ve captured a series of SAPGUI screens which use VA02 transaction to update a sales order.
Once you have captured you pages, remember to add page criterions and element criterions. In the next blog post, I will go through the configurations of workflows and scenarios.