Validate data with the SAP ERP connector
Important
This is an optional step.
This is an optional topic that covers the certified SAP ERP connector which allows automation developers to connect to SAP through Business API (BAPI) and remote function calls (RFCs). The prerequisites you'll need to meet before performing this check are described in a blog post.
Let's extend our current scenario to include a validation check that uses the SAP ERP connector to check whether the personnel number supplied to the flow is valid and that the employee is in an active employment state. Depending on the results of this check, we'll decide whether the flow ends.
Here's how the adjusted flow looks.
Diagram of the example automation where the employee triggers a cloud flow, the cloud flow validates that the employee ID exists, and then gets the secrets from Azure Key Vault and starts the desktop flow. The desktop flow uses RPA to automate a new address in SAP, and the cloud flow emails a status message back to the employee.
There are several benefits to employing this approach:
Avoids unnecessary RPA processing and complex UI-based exception handling.
Provides a better user experience through near–real-time data validation feedback.
Frees up virtual machine and bot capacity to run only on validated data.
Employs data loss prevention policies, allowing or disallowing this connector to be used in conjunction with others.
Follow these steps to adjust the existing flow to incorporate the validation check.
Edit the SAP RPA Playbook Demo Flow you created in Create the cloud flow with the Power Automate portal.
Under the Get SAP Client action, select New step.
Search for SAP, and then select Call SAP function (preview).
For Authentication Type, select SAP Authentication. Enter the Data Gateway, SAP Username, and SAP Password.
Note
You'll need to supply your credentials manually. You can't use Azure Key Vault secrets here because Power Automate validates the connection at design time.
Select More (...), and then select Settings.
Turn on Secure Inputs and Secure Outputs, and then select Done.
Tip
Use these settings to hide sensitive text from the run flow history.
Rename the action to Check whether the personnel number exists.
Enter the following information:
- Enter AS host, Client, and AS System Number.
- For SAP function name, select BAPI_EMPLOYEE_GETDATA.
- For Stateful Session, select No.
- For EMPLOYEE_ID, enter a valid personnel number.
Under Check whether the personnel number exists, select New step.
Search for, and select, Condition. Rename the condition to something meaningful, and then select the dynamic content TYPE for the Choose value field.
Drag the desktop flow action SAP RPA Playbook onto the If yes box.
In the If no box, select Add an action, search for Send an email and configure the email action as shown in the following screenshot.
In the If no box and below the email action, select Add an action. Search for Terminate and configure the Terminate action as follows.
Go back up to the SAP RPA Playbook Demo Desktop flow action and enter a personnel number that doesn't exist into the EMPLOYEE ID field.
Select Save, and then select Test to test your flow with the nonexistent personnel number.
The resulting flow run should look like the following image.
Select Test again, but this time use valid personnel number. Confirm that the results look like the following image now.
That's it. By incorporating the SAP ERP connector we've made the automation more efficient, intelligent, and user-friendly.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for