SAP automation using RPA from Microsoft

In the RPA world, Microsoft is known for Power Automate Cloud Flows, part of the Microsoft Power Platform, which allow you to easily integrate and automate processes within the Microsoft ecosystem (e.g. SharePoint, OneDrive, Dynamics etc.) or other supported cloud services (e.g. Google, Dropbox etc.). With Power Automate Desktop, also part of the Microsoft Power Platform, Microsoft expanded its automation capabilities even further with UI automation (web and desktop). In this article, we explore a common scenario for many enterprise companies - the automation of SAP-based processes. Let’ have look at four implementation options available, as well as the IT prerequisites for each of them.

1. UI Automation

Through UI Flows and now Power Automate Desktop, Microsoft extends the reach of their RPA platform to any app running on your PC, whether it’s a web app or software that is installed on your desktop. Microsoft uses a concept called UI Elements to identify the controls that the robot will interact with, whether that’s a simple text that should be read, a button that should be clicked or a text box that is to be filled in.

Power Automate Desktop helps you define these UI Elements and the steps to be performed against them by using an advanced screen recording functionality (showcased below) that identifies the elements themselves. Even more, if due to technical limitations these elements are not accessible, it can store images as references.

Power Automate actions recorder

Recorder functionality in SAP

Coming back to our initial scenario, we can use Power Automate Desktop to create a Desktop Flow that interacts with the SAP GUI and executes transactions, replicating the recorded actions. Let’s have a look at the technical requirements for implementing such a bot:

  • a Windows 10 or later machine and a dedicated user account that can connect to it

  • latest version of .NET Framework

  • latest version of Power Automate Desktop

  • (Legacy) The on-premises data gateway enables connectivity from the Power Automate Cloud to the machine running the bot. However, this is no longer required, due to the “direct to machine” connectivity feature, so if you are running the latest version of Power Automate Desktop (or any version newer than 2.8.73.21119) you’re not going to need that.

  • SAP GUI installed

  • SAP GUI scripting enabled, on both server side and client side

Finally, having setup these things, you can now open SAP GUI, start the recorder from Power Automate Desktop and perform the process manually in the order you want the robot to do it.

2. Backend automation with SAP ERP Connector and BAPI

Power Automate also integrates with SAP BAPI for high performance data operations in SAP through BAPI functions. As such, all the UI interaction code is replaced by a single call to a BAPI.

BAPI function call from Power Automate

Snippet of BAPI call

SAP on-premises data gateway architecture

On-premises SAP connectivity architecture

More specifically, you can use the Call SAP Function activity directly in your cloud flow, without the need of a desktop machine somewhere running an automated flow that interacts with the target SAP instance.

But how does a flow, running in the cloud, have access to your on-premises SAP instance? The magic is done by 3 components:

  1. SAP ERP Connector

    This is the connector that is able to bind to the BAPI endpoint, understand the response format, and prepare the BAPI request in the right format. It contains the Call SAP Function action mentioned above

  2. On-premise data gateway

    Acts as a bridge to provide secure access and data transfer between on-premises data and cloud services.

  3. SAP .NET Connector 3.0 SDK

    This enables the use of BAPI functions in .NET based applications, in this case the data gateway.

Below, you can see the actual connectivity flow of these components, and how they all work together to enable PowerApps and Power Automate to work with SAP data.

3. Advanced: Custom connector and OData/SOAP APIs

If neither of the above options suit your needs, then you can take the high route and build a fully custom stack to connect the two parts of your automation: on the SAP side, you can use one of the standard APIs provided. On the SAP API Business Hub you will find a list of the APIs applicable for your respective SAP product. To connect to the API from Power Automate, you can build custom connectors that act as wrappers on top of your API. Defining a custom connector is a wizard-based, no-code experience, but you can also write more complex data transformations using C#. Going into each specific scenario is beyond the scope of the current article, but do get in touch with us if you have a technical challenge that you need help with.

4. Call recorded VBScript from Power Automate

If you have experience with SAP development, you likely know about their proprietary GUI automation engine. Similarly to the recorder presented above, SAP enables developers to record actions and generate a VBScript output with the recorded actions.

SAP GUI Recording

SAP Script Recording functionality

All that remains is that you call the generated VBScript from a Power Automate flow using the “Run VBScript” action, making sure to inject your specific variables (i.e. transaction data) in the script as parameters.

Please note that similar to the other UI automation option presented, SAP GUI scripting needs to be enabled for this.


Curious to find out more about SAP automation with Microsoft Power Platform, but also other topics related to Power Automate, including AI Builder and live demos? Have a look at our Weinbar “Geschäftsprozesse automatisieren mit RPA von Microsoft”: https://www.automatify.ch/webinar-powerautomate.

Zurück
Zurück

How to deploy an attended UiPath robot?

Weiter
Weiter

The Automatify Internship Experience: A Discussion with our new Colleague Raul