Integrate SAP Build Apps and SAP Build Process Automation using SAP BTP Destinations
In this blog post, I will show you how to trigger the Business Process of SAP Build Process Automation in SAP Build Apps.
Below is the sequence of the steps to be followed.
1. Create a destination in SAP BTP Cockpit
2. Create an API Trigger for Business Process in SAP Build Process Automation
3. Configure the BTP Destination in SAP Build Apps.
4. Test the Destination Configuration in SAP Build Apps.
Create a destination in the SAP BTP Cockpit
1. Create a Destination to connect SAP Build Process Automation with SAP Build Apps.
Enter the value under the URL. This is the API call to trigger your Business Process.
Change the authentication to OAuth2ClientCredentials, Client ID, Client Secret, and Token Service URL can be retrieved from the SAP Build Process Automation Instance from your tenant.
Add these Additional Properties for this destination to work in SAP Build Apps.
Create an API Trigger for Business Process in SAP Build Process Automation
Prepare your Business Process by creating an API trigger and configuring the input parameters to integrate with SAP Build Apps.
Refer to the blog post on How to create an API Trigger.
Configure the BTP Destination in SAP Build Apps.
Follow the documentation to Enable BTP Authentication in your app,
.We have successfully created a destination in BTP and created an API trigger for Business Process in SAP Build Process Automation. Let’s configure the destination in SAP Build Apps.
1. Click on CREATE DATA ENTITY and select SAP BTP destination REST API integration.
3. As the BTP destination name, select AppGyver_SPA.(Destination which was created BTP Cockpit)
4. Under the Data resource name, a name can be given to this data connection, like “SendtoSPA”.
5. Under Resource schema, click on + ADD NEW to create a schema. Name the new schema “filename” and select the Field type as Text. Choose ADD.
Schema is the structure of the data. A schema is created which is similar to the Database. In this scenario, and schema should be created matching the schema of your API trigger in SAP Build Process Automation.
6. Similarly, add three other schemas with the following names:
Select the Field type for all of them as Text.
7. Select the create tab, and enable it.
8. Open the binding menu for Request headers by clicking on the X icon.
10. Click on Add value, and enter the following values:
Header name: Content-Type
Header value: application/json
Click on SAVE.
12. Open the formula editor. Enter the following formula:
Your Definition ID was copied from SAP Build Process Automation. Refer to the blog post to get the definitionId of your Business Process.
13. Click on SAVE.
Test the Destination Configuration in SAP Build Apps
You can test if this Data connection is working.
Switch to the TEST tab and enter the below values in the following fields to test the connection:
Click on RUN TEST.
Scroll down and check the Status of the Response.
If you are getting any errors please recheck the above steps. If you get the response as Status: OK, then the connection is successful.
Select SAVE DATA RESOURCE.
You can successfully link this data source to any UI element like Button in Build Apps!