In this blog post, I’ll show you with simple steps how can you configure a custom approval workflow for creating Business Partners in the S/4HANA Cloud system. For this purpose, you’ll need to configure a communication arrangement in your S/4HANA Cloud tenant. Once this is done, SAP Build Process Automation will be able to call the related S/4HANA API for creating such Business Partners after approvals have been executed.

The main steps we’ll do are:

  1. Set up a Communication Arrangement in your S/4HANA Cloud tenant to expose the S/4HANA Cloud Business Partner API
  2. Set up a Destination in your BTP Cockpit and in your SAP Build Settings to consume the S/4HANA Cloud Business Partner API
  3. Create a Business Process project in SAP Build Process Automation
  4. Create a custom application using SAP Build Apps for triggering the workflow (or enable a Process Trigger Form)

Let’s start with the first main step:

1. Create a Communication Arrangement in S/4HANA Cloud

This process is needed to be able to consume S/4HANA APIs from other applications.

The first step we need to do is to create a Communication User. You will need an admin user to do this. Big shout out to my colleague Artem Zhuchkov, who helped me to configure this.

  • Create a Communication User.
    • Go to the Maintain Communication Users app in your S/4HANA Cloud
    • Click on New and give it a name, a description and click on Propose Password (you can put one on your own as well)
  • Now, let’s create a Communications System
    • Go to your S/4HANA Cloud tenant and search for the Communication Systems app
    • Click on New and give it a name. I’m using “NA_SA_SANDOX”
    • For demo purposes, you can set up the Host Name, Logical System and Port as:
      ○ Host Name: Default
      ○ Logical System: Sandbox
      ○ Port: 443
    • Add as an Inbound Communication User, the user you created before:
    • Click on Save
  • Now, it is time to create a Communication Arrangement.
    • Go to the Communication Arrangement to expose the Business Partner API service. Click on New:
    • Search for the Business Partner service and give it a name. I named mine SAP_COM_008_BP
    • Now add the Communication System and User you previously created
    • If you go down, you’ll be able to see the services that this Communcation Arragement is exponsing.

 

2. Set up a Destination in your BTP Cockpit and in your SAP Build Settings to consume the S/4HANA Cloud Business Partner API

  • Go to your BTP Cockpit, to the subaccount where you have your SAP Build services enabled, and go to Destinations on the Menu.
  • Create a New Destination, and add this configuration:
    • Name: S4HANACLOUD_BusinessPartner (you can set a different name)
    • Type: HTTP
    • Description: Business Parter Odata service
    • URL: (copy the Service URL from the Inbound Services section on your previoulsy configurated Co,munication Arrangement) it should be something like this: https://<TenantID> api.s4hana.ondemand.com/sap/opu/odata/sap/API_BUSINESS_PARTNER
    • Proxy Type: Internet
    • Authentication: BasicAuthentication (For demo purposes, I’m using a Basic Authentication)
    • User: The user name of the Communication User that you previously created
    • Password: The password of your Communication User
  • Add Additional Properties:
    • sap.processautomation.enabled: true
  • Now, we need to create a Destination in the SAP Build Settings, to be able to consume this service in an Action Project within SAP Build Process Automation. Click on New Destination and select the one you just created in the previous step. Once you finished, you should see it like this:

 

3. Create a Business Process with SAP Build Process Automation

In this section is where we are going to spend the majority of the time in this tutorial.

We need to create a few things in order to make this demo:

  1. Create a Business Process Project, then within your project:
    1. Create a Process (which is going to be your Workflow)
    2. Create an application using SAP Build Apps or a Form as the Process Trigger
    3. Create an Approval Form
  2. Create an Action Project to call the S/4HANA API

Let’s go with the 1st step: Create a Business Process Project

  • Enter your SAP Build Looby and create a new Business Process. I named mine testBPcreation.
  • Create a Process (which is going to be your Workflow). Click on Create and then on Process. Give it a name. I named mine “testBPcreationProcess”
  • Now create an Approval Form. In the screenshots you’ll see the whole workflow right away, as I already built it, but I’ll try to mention the step by step process here.
  • Add the fields you are going to get from the Trigger Application*.
    • *In my case, I’m triggering the Workflow from a custom SAP Build Apps application, but you can absolutely trigger the workflow with a Form from SAP Build Process Automation. I’ll cover this later on.
  • These fields needs to be added as Input parameters for the Approval Form:
  • Now we need to create an Action Project to be able to call the S/4HANA API (leveraging the destinations we previously created.

Let’s go with step 2: Create an Action Project.

  • Go to the SAP Build Lobby, click on create Business Process and then on Action Project. I named mine “CreateBP”.
  • You could leverage the Business Accelerator direct integration to upload the Business Partner API specification or you can just simply download the Specification JSON file from the SAP Business Accelerator web site here:
  • Once you have created the Action Project, now you need to select the input parameters you want to send in order to successfully create a Business Partner in the S/4HANA Cloud environment. For demo purposes, I selected:
    • PersonFullName
    • NameCountry
    • LastName
    • BusinessPartnerCategory
    • FirstName
  • You can test it, adding values to the payload and selecting your previously configurated destination:
  • You should get a 201 response, and you’ll be able to see the Business Partner ID:

Now, let’s go back to the 1st step of this section to continue with the Workflow Process.

  • Add an action project into your workflow as the task to execute when the outcome of the approval task is positive.
  • Select your Action Project from the library:
  • Now include the input parameters into the action task:
  • Check that the response structure in the output tab, in this case Business Partner (ID):
  • You can add other Forms or Email tasks as notifications. In this case, I previously configured the email destination in the BTP cockpit to be able to send email notifications from a SAP Build Process Automation workflow. Here’s the documentation in case you want to do it too.
  • Check here how you can get the BP ID from the response to send it in the approval notification email.
  • Save, Release and deploy your project!

Great 🙂 so you have successfully created a working workflow!

4. Create a custom application using SAP Build Apps for triggering the workflow (or enable a Process Trigger Form)

Go to the SAP Build Lobby and create a SAP Build Apps project. In this case I’m using a custom app using SAP Build Apps, but you can also leverage Forms from SAP Build Process Automation to trigger your workflow. Here I’m in the SAP Build Lobby with the application I created before:

In the application, I’m capturing different attributes to create the Business Partner in the S/4HANA Cloud system. However, for demo purposes, I’ll only use First Name, Last Name, Full Name, and Country/Region.

You must add the logic to call the SAP Build Process Automation API in order to trigger the approval workflow. Check out this awesome blogpost from my colleague Manuel Namyslo for more details on how to configure this integration between SAP Build Apps and SAP Build Process Automation.

You can also deploy this SAP Build Apps application and consume it in your SAP Work Zone environment. How to currently do that? checkout these:

  • Tutorial for deploying your app to your SAP BTP runtime.
  • Tutorial for creating the app in the SAP Work Zone Content Manager

 

Now let’s test the whole Approval Workflow for the Business Partner Creation!

Here I’m accessing the SAP Build Apps application through the SAP Work Zone environment

Now include some values for the Business Partner creation, here we are triggering the SAP Build Process Automation workflow, by clicking in Submit Request

Let’s get back to MyInbox application to see the incoming request

Check the values and approve it

Expect the Email notification with the already created Business Partner and its ID

Copy the ID and enter your S/4HANA Cloud environment with rights to access Business Partner information. Go to the Maintain Business Partner application

Click on OpenBP and past your Business Partner ID. You should see it like this:

 

Now you have successfully created a Business Partner in S/4HANA Cloud leveraging approval workflow capabilities and calling a S/4HANA Cloud API directly from SAP Build Process Automation 🙂

 

Do you want to know more about SAP Business Technology Platform?

To learn more about SAP BTP, see the learning journey Discover SAP Business Technology Platform, a great introduction to BTP and the Intelligent Enterprise strategy to see what it’s all about for free. Discover BTPLCNC plus much more free learning at SAP Learning site.

 

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x