on 2024 Jul 15 3:02 PM
Hi Team,
Greetings!
I have a requirement to trigger Build Process Automation from Custom UI5 application developed in BAS. I have gone through multiple tutorials but all are suggesting the triggering of BPA from Build Apps.
Please guide me on this.
Thanks & Regards,
Ayushi Shrivastava
Request clarification before answering.
I will see if I can find a better tutorial, but here is one that shows you how to do it the "old way" (meaning making an API call) from SAP Build Apps, and it would work pretty much the same way for you.
I will try to find a tutorial showing it from JavaScript, for example, from BAS. But I think you'll get the idea from the above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I'm getting 401 unauthorized error while calling Build Workflow API trigger from my SAPUI5 application (both locally running or from Build workzone). The URL called is "https://spa-api-gateway-bpi-us-prod.cfapps.us10.hana.ondemand.com/workflow/rest/v1/workflow-instance..." to get X-CSRF token. My Workflow created as per tutorial https://developers.sap.com/tutorials/spa-academy-run-salesorderprocess.html#fb19e3da-bee0-4477-afc4-... Can you suggest what is the possible resolution for this issue.
What is the correct URL to trigger the BPA workflow API from the SAP UI5 app. And what is the correct method to call the API ?
1. Calling SBPA Workflow API to trigger process from SAPUI5 app
2. 401 unauthorized error -
3. CORS issue while testing UI5 app locally or from Build Workzone
It doesn't seem you are calling via the destination. My colleague @nicoschoenteich did a 2-minute series on UI5, including this video how he set up access to external API using destination via approuter and to test locally.
https://www.youtube.com/watch?v=MHJzIz7iiHs&list=PL6RpkC85SLQC4kuj22e4hw85Sa1pClD8y&index=4
Check out the entire series and subscribe to SAP Developers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@VaradBhagwat The second 2 screenshots are hard to read.
1) Where are you sending the credentials?
2) We usually solve CORS by creating a proxy service, or more simply using BTP destinations
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've set up the destinations and provided the service key etc. however, I'm still having doubt how to call the SBPA API from UI5 app and using the destinations to avoid CORS issue. Is the code snippet provided a correct method or there is another way to trigger API as per current technical design/architecture ? My overall BAS code structure modules is as follows - 1. A MTAR module project which has a a. Managed App router, b. Workflow Start UI module for approval view layout 2. A custom UI5 app which will trigger the BPA API (separate from above mentioned MTAR module project) 3. SBPA approval project (API trigger process as per template Sales Order Management MI04 as per the tutorial https://developers.sap.com/tutorials/spa-academy-salesorder.html ) 4. SAP Build Workzone tile to launch app and trigger process (UI5 app as in #2 above)
2. Error in console
3. CORS error
I do not know if there is a special shortcut in SAP Business Application Studio as there is in SAP Build Apps, but you probably do this best by calling the SAP Build Process Automation APIS:
https://api.sap.com/package/SAPProcessAutomation/rest
The triggering API is under the Workflow tile. You need a service key and destination (generally created for you when you install Process Automation).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.