Skip to Content
Technical Articles
Author's profile photo Dimpu Ajay

How to enhance the standard SAP Intelligent RPA bot in the SAP cloud studio?

How to enhance the standard SAP Intelligent RPA bot in the SAP cloud studio?

In this article, I shall talk about enhancing the standard bot which is available in the SAP Bot store.

Let us take an example of John who works for company, say, ABC. He has several material document lists in the system for which he would like to generate respective GR (Goods Receipt) for a Production Order. He needs the process to be automated where the bot needs to perform the following steps:

  1. Read the excel template as input which consists of material list
  2. Automate the Goods Receipt list according to the defined input criteria,
  3. Download the list
  4. Send an email to the respective stake holders with the details of the list downloaded in the previous step.

How can this be achieved using SAP bot?

SAP Standard provides MB51 bot which is a “List of Goods-Receipt”. Standard MB51 bot performs the process 1,2 and 3. However, MB51 bot provided by standard does not have the feature of sending emails. We shall now see below how John could automate the standard bot with few simple steps.

Step 1: John logs into the RPA(Robotic process automation) tenant and navigates to the SAP Bot store. He can search for the bot using the Search Criteria “Goods Receipt”. As his design tool is SAP Cloud studio, he selects the highlighted option “Cloud Studio” as shown in the Fig1.

Fig1%3A%20Bot%20Store

Fig1: Bot Store

Step 2: Click Get to acquire the bot as shown in Fig2.

Fig2%3A%20Acquiring%20Bot%20from%20Bot%20Store

Fig2: Acquiring Bot from Bot Store

Step 3: Now, go to Packages as seen in the below screenshot where you will be able to view the standard bot acquired as shown in Fig3.

Fig3%3A%20Bot%20acquired%20can%20be%20found%20in%20the%20Packages

Fig3: Bot acquired can be found in the Packages

Step 4: Select the package and click on the 3 dots as highlighted in the screenshot below.
Click “Save As… New Project” which in turn will create a new project for you as shown in Fig4.1.

Fig4.1%3A%20Create%20a%20new%20project%20out%20of%20a%20package

Fig4.1: Create a new project out of a package

A new project has been created using which John will be able to modify the standard bot as shown in Fig4.2.

Fig4.2%3A%20Newly%20created%20Project%20out%20of%20the%20Package

Fig4.2: Newly created Project out of the Package

Step 5: Click on the project to navigate to bot design tool “cloud studio” where the standard bot can be enhanced. Fig5, shows the Cloud studio to design the bot.

Fig5%3A%20Cloud%20Studio

Fig5: Cloud Studio

Step 6: Amongst the automation steps in Fig 5,

“MB51 Start” is the first step to run as soon as the bot execution starts.

This automation script will first read the Excel template using the path provided in the environment variables. Once the excel contents are read, SAP logon is then initiated to log into relevant system. On successful login, the automation script “MB51 process” is executed.

“MB51 Process” performs the following steps:

  • Navigate to t-code MB51,
  • Select the required variant to fetch the goods receipts for the material documents read from the excel input in a list.
  • The list is saved in the format of an excel file which is saved with a timestamp to uniquely identify the download for current transaction. The excel file will be saved in the file path specified in one of the steps.
  • Exit the SAP system.

Fig%206.1%3A%20MB51%20Bot%20Process%20Automation%20script

Fig 6.1: MB51 Bot Process Automation script

John identifies that “MB51 process” automation step is the place where he can extract the file name and the path where excel with Goods Receipt list is saved. As shown in the screenshot Fig 6.1, he would need to automate the process after the step name “closeSAP-Application – 3”.

  • For email service, Outlook SDK is required to automate this process.

So, he will check whether the outlook SDK is available in the dependencies tab as shown in Fig 6.2.

Fig%206.2%3A%20Dependencies%20tab

Fig 6.2: Dependencies tab

  • If it is unavailable, click “Manage the Project Properties”, a pop-window opens as shown in the Fig 6.3.

Fig%206.3%3A%20Manage%20the%20Project%20Properties

Fig 6.3: Manage the Project Properties

  • Navigate to Dependencies option.
  • Click Add dependency as shown in the Fig 6.4.

Fig%206.4%3A%20Add%20dependency

Fig 6.4: Add dependency

  • Select the package as “SAP Intelligent RPA Outlook SDK” and click ADD as shown in the Fig 6.5 and 6.6.

Fig%206.5%3A%20Searching%20for%20the%20Outlook%20SDK

Fig 6.5: Searching for the Outlook SDK

Fig%206.6%3A%20Adding%20the%20Outlook%20SDK

Fig 6.6: Adding the Outlook SDK

  • The Outlook SDK gets added in the dependency tab as shown in Fig6.7.

Fig%206.7%3A%20Added%20Outlook%20SDK%20in%20the%20Dependencies%20tab

Fig 6.7: Added Outlook SDK in the Dependencies tab

  • Once Outlook SDK is available in the dependency tab, John will search in the Tools section for Outlook SDK and he will find all the relevant outlook activities as shown in the Fig 6.8.

Fig%206.8%3A%20Searching%20for%20the%20Outlook%20SDK%20in%20the%20Tools%20section

Fig 6.8: Searching for the Outlook SDK in the Tools section

Step 7: Add the activities such as Open Outlook Instance, Send Email and Release Outlook instance after the “closeSAP-Applications” as highlighted in the Fig7.

Fig%207%3A%20Adding%20the%20Outlook%20Activities

Fig 7: Adding the Outlook Activities

Step 8: John now needs to edit “Send Email” step with relevant information. Before that he needs to identify the File path of excel file with the Goods Receipt list. To retrieve the file path, he needs to click Step set file path and then he can see the Input Parameters.

In the value section there is “outputPath”, he needs to click edit option and can find the file path information as highlighted in the Screenshot Fig 8.1.

Fig%208.1%3A%20Saved%20Excel%20File%20path%20information

Fig 8.1: Saved Excel File path information

It is also critical for John to identify the right excel before emailing to the respective stakeholders. As already mentioned in Step 6 excel is saved with timestamp to uniquely identify the downloaded excel file. John uses the timestamp of the current excel downloaded to identify the excel file uniquely.  There is a script provided by SAP for generating the timestamp which can be used as highlighted in the screenshot Fig8.2.

Fig%208.2%3A%20Timestamp%20Script%20provided%20by%20SAP

Fig 8.2: Timestamp Script provided by SAP

Step 9:

  • To set the file path in the email section click the activity “Send email”.
  • Select Input parameter as Custom Data as shown in the Fig 9.1.

Fig%209.1%3A%20Adding%20Custom%20Input%20Parameters%20to%20Send%20Email%20Activity

Fig 9.1: Adding Custom Input Parameters to Send Email Activity

  • Enter the relevant information such as To, CC, Subject, attachment path and so on as shown in the Fig9.2.

Fig%209.2%3A%20Enter%20the%20parameters

Fig 9.2: Enter the parameters

  • The Excel file name should be unique such that one can identify the excel. So, we identify using the timestamp as shown in the Fig9.3.

Fig%209.3%3A%20Path%20of%20the%20downloaded%20Excel%20File

Fig 9.3: Path of the downloaded Excel File

  • Subject of the Email is uniquely identified using the timestamp as shown in the Fig9.4

Fig%209.4%3A%20Subject%20of%20the%20Email

Fig 9.4: Subject of the Email

Step 10: Save the automation and click test to run the Project as shown in the Fig10.1

Fig%2010.1%3A%20Run%20the%20bot

Fig 10.1: Run the bot

  • Once the project starts, it will open the excel template from the below folder and reads the excel template as shown in the Fig10.2.

Fig%2010.2%3A%20Reads%20Excel%20Template%20from%20the%20given%20input%20Path

Fig 10.2: Reads Excel Template from the given input Path

 

  • System details are read along with MB51 transaction parameters as shown in the Fig10.3 and 10.4.

Fig%2010.3%20%3A%20Reads%20the%20system%20information%20from%20the%20excel%20template

Fig 10.3 : Reads the system information from the excel template

Fig%2010.4%3A%20Reads%20the%20Variant%20for%20the%20material%20list%20from%20the%20Excel%20template

Fig 10.4: Reads the Variant for the material list from the Excel template

  • Opens the SAP GUI and logins to relevant system as shown in the Fig10.5.

Fig%2010.5%3A%20Starts%20SAP%20Logon

Fig 10.5: Starts SAP Logon

  • Once logged in, navigates to the MB51 transaction as depicted in the Fig10.6.

Fig10.6%3A%20Login%20to%20the%20required%20system

Fig10.6: Login to the required system

  • Selects the required variant and it runs the report as shown in the screenshot Fig10.7 to 10.9.

Fig%2010.7

Fig 10.7

Fig%2010.8

Fig 10.8

Fig%2010.9

Fig 10.9

  • After the report run, the file will be saved and then downloaded message will be displayed as shown in the Fig 10.10 to 10.12.

Fig%2010.10

Fig 10.10

Fig%2010.11

Fig 10.11 excel file downloaded message

Fig%2010.12%3A%20Newly%20Downloaded%20Excel%20of%20Goods%20Receipt%20List

Fig 10.12: Newly Downloaded Excel of Goods Receipt List

  • Subsequently, bot sends an email to relevant stake holder as shown in the Fig10.13.

Fig%2010.13%3A%20Email%20triggered%20with%20an%20Excel%20File%20attached

Fig 10.13: Email triggered with an Excel File attached

Note: In the above example, John has hardcoded the email id in the step. However, it can also be passed as an input in excel template or as a variable while executing the BOT.

Summary: Once the requirement is clear within any project, we would need to identify the scenarios supported by SAP standard bot. Once analyzed, it is easier to enhance based on the custom requirement.

Reference: 

Cloud Studio User Guide

Bot Store User Guide

 

Assigned tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.