Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Karthik-Thiru
Product and Topic Expert
Product and Topic Expert

Goal

Call an OData API from SAP Build Process Automation by using Actions created from a Destination.

Background

In SAP Build, Actions are connectors that enable simplified, reusable consumption of APIs. Actions are consumable in SAP Build Process automation (Process, Automations, Forms) and in future planned to be consumable in SAP Build Apps.

New Improvements

    • SAP Build Lobby has a new improved experience utilizing a side navigation panel and Actions are available under Connectors node. Action Projects are not listed under Lobby anymore, rather under the Actions tab.

    • Actions can now be created directly based on SAP BTP Destinations for OData APIs. Previously, it was necessary to upload either an OpenAPI JSON or OData EDMX/XML specification file.

 

Sample Use Case

Consume Northwind OData API in a Process via Actions using a SAP BTP Destination.

In this sample use case, focus is on showing the steps to consume an API in a Process and not on demonstrating customization/simplification features of Actions or Process.

Part 1: Create, Test and Publish an Action

1. Create a Destination in the same sub-account of SAP BTP where the Process Automation is subscribed.

    • Maintain Destination Properties:
PropertyValue
sap.applicationdevelopment.actions.enabledtrue
sap.processautomation.enabledtrue
sap.build.usageodata_gen
    • Maintain Authentication as NoAuthentication. After creation the destination looks like below


Build Actions Help Page for reference

2. Create action from destination

    • In SAP Build Lobby, under Connectors node choose Actions. Click on Create.
    • Choose OData Destinations tile, choose the destination. In case there is only one destination it gets auto selected.
    • Choose next when the screen displays all the available entities and methods of the OData API. Behind the scenes “/$metadata” is appended to the destination URL to fetch this information.
    • Update the Project name and description then click Create.
    • This launches a new tab called Actions Editor. Here choose the methods that you would like to publish as Actions. For example, choose GET for /Customers under Customers Group. Click Add.

3. Test, release and publish actions

  • Inputs and Outputs can be customized or simplified as needed but in this simple example proceed without making any changes.
  • Switch to the test Tab to test the Action. Notice that the destination is pre selected as the Action was created based on a Destination.
  • Click on Test. A successful 200:OK response from the Northwind OData API is now shown at the bottom of the screen.


    • Now click on the Release button at the top right and then click on Publish. “Release” creates a non modifiable version of the Action and “Publish” publishes the Action into SAP Build library from where it can be consumed in different Build Artifacts.

 

Part 2: Consume the Action in SAP Build Process Automation

 

1. Destination needs to be made accessible in SAP Build Process Automation.

    • In SAP Build Lobby click on Control Tower node in left pane > Select Destinations tile
    • New Destination > Select Northwind destination that was created as part of 1st step > click on Add

2. Create a Process to call the action and view action response

    • Lobby -> Create -> Build an Automated Process -> Business Process -> Enter Project name and Description -> Create.
    • Create Process -> Enter Name -> Create
    • Click on + icon in the middle of the process -> Actions -> Browse library
    • Search for the Action “Get entities from Customers” and click on Add

    • Select the Added Action in the Process, create a destination variable with any name, for example “Northwind_dest”. This would be used during deployment of the process to link to an actual destination. A destination variable enables linking different destinations in different landscapes ( Dev, Test, Prod) without changing the Process.

3. Deploy the Process

    • Click on Save and then Release.
    • Click on Deploy > Next in Overview Dialog > Choose Northwind destination in the Runtime Variables Dialog then next > Deploy

4. Test the Deployed Process

    • A simple way to test the Process is to start a new instance and check the logs for the response received from the API.
    • Click on Monitoring node in Left Pane > Process and Workflows Tile > Select the Northwind Process deployed in previous step > Click on Start New Instance button

    • Ignore the input JSON, click on Start New Instance and Close button
    • Click on Show Instances. Update Status filter to also show Completed Process instances
    • Select the Process Instance to see the Logs and Context. If the API call was successful, the response of the API is seen in the context.

 

Conclusion


A list of Customers from the sample Northwind OData API was successfully retrieved in a Process of SAP Build Process Automation. This was achieved using the new feature of Actions creation from a destination.

Actions were intentionally underutilized in this example but they could enable simplification of the inputs, outputs, provide default values, filter data, make automatic CSRF calls and lot more but that is for subsequent Blogs.

6 Comments
Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
Nice blog 😺
arunsubbu
Explorer
0 Kudos
Hi karthik.thiru2,

Thanks for that detailed blog. I am facing an issue while trying to configure destination for my RAP service. I have used the property "sap.build.usage" as "RAP".
In the URL of the destination, I have provided the service URL of RAP developer in BTP ABAP instance.
I am facing an issue in the build while trying to create action and choose RAP. I get the error "Failed to fetch the metadata : Validation of EDMX failed".

Do you have any suggestion?

Vinay_kosaraju
Explorer
Dear Karthik

This works for the Northwind OData but when we are trying to connect to the SuccessFactors getting "failed to fetch the metadata : validation of edmx failed".

Do we need to maintain any specific parameter for SuccessFactors Destination , we have maintained sap.build.usage=odata_gen

Any pointers to fix the issue would be a great help.

Best Regards

Chandra

 
arunsubbu
Explorer
0 Kudos

Hope this is the same question, I had posted in the previous comment
https://blogs.sap.com/2023/11/06/sap-build-process-automation-consume-an-odata-api-as-actions-using-...

arunsubbu
Explorer
0 Kudos
Hi archana.shukla,

Do you have any feedback on this topic?

Thanks and Regards

Arun
Karthik-Thiru
Product and Topic Expert
Product and Topic Expert
Hi Arunkumar, Vinay,

 

To identify if the issue is with destination or EDMX definition, please use the option of Action creation by uploading the EDMX instead of the RAP option.

If you still get issue with the EDMX, then this needs to be debugged by the support team to identify the exact cause. Please create an incident in component CA-AP-ACT and attach the EDMX.

 

Regards,

Karthik