SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Create and Configure Action in the process flow

Create an action project from Open API specification.

Overview

🎓 beginner 30 min. SAP BTP ABAP EnvironmentBeginnerABAP DevelopmentSAP Business Technology PlatformSAP Build Process Automation
Ruchi Dobriyal R Ruchi Dobriyal November 22, 2024
Created by June 20, 2024
Contributors

Prerequisites

Prerequisites

  • You have created a Business Project and Process in SBPA as described here.
  • You have created a process trigger as described here.
  • You have created a configured an Approval form as described here.

Steps

You will Learn

  • To create and configure action project based on the API specification
  • To release and publish action project to be consumed in the business process modelling
  • To add action to the business process
  • To map input fields of the action to the actual process content
  • To release and deploy business process with actions

Intro

Action is a feature in SAP Build Process Automation to connect processes with external systems, be it SAP or non-SAP systems. This is an important piece of the puzzle especially if you want to automate or extend your business processes for any available LoB processes like S/4HANA, SAP BTP ABAP Platform, SuccessFactors etc. These extensions can be easily built using SAP Build Process Automation, and using actions you can connect to your given S/4HANA, SAP BTP ABAP Platform, Ariba or other SAP LoB systems for any kind of GET, POST, PATCH, and other calls.

In this tutorial, you will create an action project based on Open API. The Workflow Notification API is an OData V4 service available to send the notification at the completion of a workflow step back to the calling system. You will use the POST call from SBPA to BTP ABAP environment to notify if the travel request has been Approved or Rejected on completion of workflow.

Step 1 Create an Action Project
โ€”

  1. Open SAP Build Lobby with your username and password, then do the following:

    • Under Connectors, select Actions.
      SAP Build Lobby
      SAP Build Lobby
  2. Save the below Open API Specification file as local .edmx file.

    Sample
    {
       <?xml version="1.0" encoding="utf-8"?>

<edmx:Edmx Version=“4.0” xmlns:edmx=“http://docs.oasis-open.org/odata/ns/edmx" xmlns=“http://docs.oasis-open.org/odata/ns/edm"> edmx:DataServices </edmx:DataServices> </edmx:Edmx> }
``` 3. Choose Create

 ![CreateActionPlan](https://raw.githubusercontent.com/sap-tutorials/abap-core-development/main/tutorials/abap-environment-sbpa-workflow-action/CreateActionPlan.png)
  1. In the Choose an API Source popup, under API Specification, select Upload API Specification.

    ChooseAPISource
    ChooseAPISource

  2. Drag and drop or click Browse Files to upload open specification file saved in step above.

  3. Choose Next.

    UploadAPI
    UploadAPI

  4. In the Create an Action Project Popup do the following:

    Enter the Project Name as Workflow Notification.

    Enter the Description as Workflow Completion Notification.

    Click Create.

    CreateActionProject
    CreateActionProject

    As soon as the Workflow Notification Action gets created, SAP Build Actions will automatically open and the Add Actions to Workflow Notification pop up will appear.

  5. Select Service Operation Post. Click on Add

    AddActions
    AddActions

  6. SAP Build Actions will open with the selected APIs which can be further configured based on the requirements.

    • To update the project name, click on the pencil icon next to the project name.

    ProjectName
    ProjectName

    This action project name will help you search your action project from your API list,once published in action repository.

    • Change the name to Workflow Completion Notification.
    • Once done, Select Update to submit the changes.

    WorkflowComplete
    WorkflowComplete

    • Enter the default value for outcome Input field by clicking on it.
      Set the value for outcome to Approved.

    Outcome
    Outcome

    It is also possible to change the field labels and update the input/output fields of the action project to keep only the mandatory fields that are needed.

    • As BTP ABAP environment APIs need CSRF token, you need to enable it. Select Settings icon.

    EnableCSRF
    EnableCSRF

    • In the Project Settings window select CSFR and do the following:

      • Enable CSFR by selecting YES.
      • Under the Token Fetch End Point enter: /

    TokenFetch
    TokenFetch

    • In the Project Settings Window, Select URL prefix and do the following

      • Enter Resource Path /sap/opu/odata4/sap/api_workflow_notification/default/sap/api_workflow_notification/0001.
      • Choose Save.

    Resource Path is required to create the Final Action URL by combining {Destination URL} + {Resource Path} + {API Endpoint}.
    If you’re exposing multiple services from the same system, you don’t have to create different destinations to access those services. By configuring the resource path, you can set only one destination. Resource paths must begin with / and can’t end with /.

    URLPrefix
    URLPrefix

    If you get Gateway Timeout issue while saving, then close the error dialog and refresh the browser.
    If you see that changes are not saved, then try saving again and refreshing the browser.

  7. Save the Action Project.

    SaveProject
    SaveProject

  8. Release the action project.

    You will now release the action project to create version(s) and then publish a selected version in the action repository. It is then these published actions that can be used in different processes and applications to connect to external systems.

    • To release a version of the action project click Release from top-right corner.
    • Enter the Release Notes: Workflow Completion Notification V1.
>Notice the version of the project. It is in `majorVersionNumber.minorVersionNumber.patchNumber` format.   

   ![ReleaseActionProject](https://raw.githubusercontent.com/sap-tutorials/abap-core-development/main/tutorials/abap-environment-sbpa-workflow-action/ReleaseActionProject.png)
  1. Publish Action Project

    Once the action project is released, you can then publish any release version of the action by clicking Publish to Library from top-right corner.

    PublishActionProject
    PublishActionProject

    With this you have successfully completed creating, configuring, releasing, and publishing of action project. Now you will use this published action to connect workflow business process to external systems via API.

Step 2 Add Action Project to Business Process
+
Step 3 Test Yourself
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 3
1. Create an Action Project 2. Add Action Project to Business Process 3. Test Yourself

Learn more →