Skip to Content
Technical Articles
Author's profile photo Chaitanya Priya Puvvada

Integrate SAP Build Apps and SAP Build Process Automation using SAP BTP Destinations

Hello All,

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.

https://spa-api-gateway-bpi-eu-prod.cfapps.eu10.hana.ondemand.com/public/workflow/rest/v1/workflow-instances.

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.

AppgyverEnabled
HTML5.DynamicDestination
WebIDEEnabled

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:

“foldername”
“employeename”
“employeemail”
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.

9. In the binding menu, select List of values.

10. Click on Add value, and enter the following values:

Header name: Content-Type
Header value: application/json

Click on SAVE.

11. open the binding menu for Request body mapper.

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!

Assigned Tags

      13 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jan Schober
      Jan Schober

      Thanks Chaitanya Priya Puvvada for this excellent blog. Awesome and comprehensive summary!

      Author's profile photo Richard Bourne
      Richard Bourne

      Hi Chaitanya,

      Im really excited to get this going but I'm failing to connect when creating a Destination in BTP. I get a 401 unauthorised message when i click the check connection button. The only thing different I see is that the AppgyverEnabled property is missing from the list. Could this be the issue or am I missing something from the Set Up? I used the booster to set everything up.

      Many thanks

      Richard

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Richard Bourne,

      Can you please share the details of the destination that you have created mainly the token URL and API URL   that you used while creating the destination?

      Hope you have added /oauth/token to your authentication URL to form Token URL 

       

       

      Author's profile photo Gizem Nur Soylu
      Gizem Nur Soylu

      Hello Chaitanya Priya Puvvada ,

      Thank you for excellent blog. I have issue to connect when creating a Destination in BTP. I get a 401 unauthorized message when i click the check connection button. All process is working on postman. Do you have any idea?

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      You can ignore that 401 message.Few a times ,even though credentials are correct it throws an error.If  your credentials are working fine in postman and if the same is maintained in destination  you can ignore the message.

      We created a detailed tutorial on this.

      Author's profile photo Karnamuhil Krishnan
      Karnamuhil Krishnan

      Hi Chaitanya Priya Puvvada 

       

      This is an excellent blog, I followed exactly the same steps to trigger API from Build Apps to the Process Automation . But getting 404 error while testing the integration of API trigger from Build Apps to Process Automation

       

      1. API trigger from Postman is successful .Can see the results in Process Automation My Inbox
      2. API trigger from the Build Apps Sample Application is not working while testing the schema from the Build API destination

       

      Please suggest the reason for the error and solution.

      Note the Destination to SPA icheck connection is working fine. But getting 401 error message. But that can be ignored as you have suggested and from Postman to Process Automation API trigger  is working fine

      Author's profile photo Francois HARDY
      Francois HARDY

      Hi, I have the same issue here, did you find the solution ?

      Author's profile photo Raphael Witte
      Raphael Witte

      Hi Chaitanya Priya Puvvada ,

      any updates here? I am also the same issue as Karnamuhil Krishnan and Francois HARDY . In Postman everything is working fine, but as response for the destination check on BTP and the trigger test in SAP Build apps I get a 401 🙁 Therefore I am a bit stuck here.

      Best regards,
      Raphael

      Author's profile photo Chaitanya Priya Puvvada
      Chaitanya Priya Puvvada
      Blog Post Author

      Hello Francois HARDY  Raphael Witte ,

      Can you re-create the destination and double-check if you have entered the correct credentials?

      Author's profile photo Raphael Witte
      Raphael Witte

      Hello Chaitanya Priya Puvvada ,

      my problem has already resolved itself after just waiting one day and trying again. Maybe just a hickup somewhere. Nevertheless thanks for the response!

       

      Best regards,
      Raphael

      Author's profile photo Indumathi Thirunavukkarasu
      Indumathi Thirunavukkarasu

      Chaitanya Priya Puvvada : Is there a way to achieve this functionality without enabling BTP destination? We are working on an app that scans barcodes and hence has to be used with a mobile preview only. However, BTP destination currently does not work with mobile preview. So, in such cases how do we call a process automation from SAP build apps?

      Author's profile photo Pekka Turtola
      Pekka Turtola

      Hi, We are currently working with mobile btp authentication.
      In the meanwhile, however, if your api is normally accessible you can create the integration via classic data entities. Just do not use the BTP connection, but the normal one with direct url to the api of yours.

      Author's profile photo Indumathi Thirunavukkarasu
      Indumathi Thirunavukkarasu

      Pekka Turtola : Thanks for your reply!

      We managed to accomplish this, but wasn't easy though :-). I am leaving the reference to a fantastic blog that we referred to. This is just a workaround until the mobile BTP authentication is working and can help anyone who faces the same issue as us.

      How-to: Combine SAP Build Process Automation with SAP Build Apps – Version 1 | SAP Blogs