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: 
acharyaw
Product and Topic Expert
Product and Topic Expert
1,678

SAP Build Process Automation combines workflow management, RPA functionality, decision management, process visibility, and embedded AI capabilities into one intuitive low-code experience. It enables business users and technologists to become citizen developers. With powerful yet intuitive low-code and no-code capabilities, the solution supports you in driving automation by tapping into the expertise of citizen developers. Check here for What's New and Learn more from the roadmap.  

In SAP Build Process Automation, the event triggers onboard and listen to back-end events emitted from an external source system, and reacts to such events by triggering artifacts such as processes and automations. The current blog describes how to setup the Event Mesh on SAP BTP with SAP S/4HANA Public Cloud for receiving the business events in SAP Build Process Automation.

 

Before You Begin

Pre-requisites:
  1. You have SAP Build Process Automation Subscription in your BTP Subaccount and you have a service instance for SAP Build Process Automation in your subaccount and service key.

acharyaw_0-1725256319928.png

2. You have Event Mesh Entitlement in your BTP subaccount

acharyaw_1-1725256319932.png

 

Privileges Required:
  • Admin Rights on BTP Account at Global Level
  • Admin Rights on SAP S/4HANA
  • Roles to view and add service instances in the BTP Subaccount

Register Your SAP S/4HANA Public Cloud System

To build extension applications for your SAP S/4HANA Cloud system, you need to connect your SAP S/4HANA Cloud system to your SAP Business Technology Platform global account.

To be able to do this, in respect to authorizations you must be:

  • an administrator of the SAP Business Technology Platform global account
  • an administrator of the SAP S/4HANA Cloud system.

SAP Business Technology Platform

  1. In your SAP Business Technology Platform Cockpit, open your global account and choose Systems.
  2. In the Systems Landscape, choose Add System.
  3. In the Register System dialog box, enter a name for the SAP S/4HANA Cloud system you want to connect. Recommendation: use a name that uniquely identifies this system, for example, system ID. Example: <S/4HANA Cloud system name>
  4. In the Type dropdown list, choose SAP S/4HANA Cloud.
  5. Choose Add.

acharyaw_2-1725256319934.png

6. The SAP Business Technology Platform generates an integration token so the SAP S/4HANA Cloud system administrator can configure integration with the SAP Cloud Platform from your SAP S/4HANA Cloud system. Select the communication scenario groups from the drop down. Click on get Token.

acharyaw_3-1725256319938.png7. Copy the integration token and close the dialog box.

SAP S/4HANA Public Cloud

  1. Log onto your SAP S/4HANA Public Cloud tenant with a user having administrator role.
  2. Search for application Maintain Extensions on SAP BTP

acharyaw_4-1725256319941.png

3. On the Maintain Extensions on SAP BTP screen in the Integration section, choose New.

acharyaw_5-1725256319942.png4. In the Integration Token field, paste in the integration token generated and copied from the SAP Business Technology Platform.

acharyaw_6-1725256319943.png

5. Enter a description for your system integration token.

Recommendation: use the same name you entered in SAP Business Technology Platform when you generated the token.

Example: <S/4HANA Cloud system name>Choose Save.

6. If you get a pop-up to approve the creation communication scenarios, click Yes.

acharyaw_7-1725256319944.png

Note: A new entry is displayed for your system in the table with the status Enabling.

acharyaw_8-1725256319946.png

Wait for a few seconds.

  • After the automated integration, the status of your system integration changes to Enabled.
  • The same takes place on the SAP Business Technology Platform side. You will see the system as Registered – potentially after a quick refresh.

acharyaw_9-1725256319947.png

Set Up Entitlements for Your BTP Subaccount

After you have connected the SAP S/4HANA Cloud system (with status Enabled in your SAP S/4HANA Cloud tenant) to the SAP Business Technology Platform, you need to configure entitlements to make this system accessible in the SAP Business Technology Platform subaccount in

In the next steps you will configure the entitlements and assign the corresponding quota and service plans to the subaccount in which the extension application will reside.

Hint: Please note that as a prerequisite both a subaccount with Cloud Foundry enabled and a space need to have been created. In case you have not created a subaccount or a space yet, follow the instructions given in the documentation.

Please note: it should be the same subaccount where the SAP Build Process Automation is already setup. For the SAP Build Process Automation setup, please refer to this help documentation.

In case you have no SAP Business Technology Platform subaccount in place yet, you would have to follow these steps:

  1. Create a Subaccount
  2. Enable Cloud Foundry
  3. Create a Space

Detailed Instructions can be found here:

https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/05280a123d3044ae97457a25b30...

https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/2f6ed22ccf424dae84345f4500c...

Also, make sure to set up SAP Build Process Automation. For the SAP Build Process Automation setup, please refer to this help documentation.

Add S/4HANA Cloud Extensibility

1. In your SAP Business Technology Platform Cockpit, open your global account and choose Entitlements --> Entity Assignments.

2. Select your subaccount and click Edit

acharyaw_10-1725256319949.png

3. Click Add Service Plans.

acharyaw_11-1725256319951.png4. In the Subaccount Entitlements dialog box, select the service SAP S/4HANA Cloud Extensibility and then select the system that you have configured in the previous step.

5. In the Service Details: SAP S/4HANA Cloud Extensibility screen area, select your newly registered system name from the dropdown help to list the available service plans. These available service plans are:

  • messaging to consume SAP S/4HANA Cloud events and create event-based extensions using the event bus from SAP Event Mesh
  • api-access for generic access to SAP S/4HANA Cloud APIs

acharyaw_12-1725256319952.png6. Select both service plans and press the Add 2 Service Plans button to add these entitlements for the SAP S/4HANA Cloud Extensibility service for your SAP S/4HANA Cloud system registered to your subaccount.

7. Press Save.

acharyaw_13-1725256319954.png

Set up your subaccount entitlement for SAP Event Mesh

  1. Click on Configure Entitlements and then on Add Service Plan
  2. In the Subaccount Entitlements dialog box, select the service Event Mesh

acharyaw_14-1725256319954.png

3. In the Service Details: Event Mesh screen area, select the default service plan

4. Press the Add 1 Service Plan button to add this entitlement for the Event Mesh service for your subaccount.

5. Press Save.

Set up your subaccount entitlement for Cloud Foundry Runtime

  1. Click on Configure Entitlements and then on Add Service Plan.
  2. In the Subaccount Entitlements dialog box, select the service Cloud Foundry Runtime

acharyaw_15-1725256319955.png

3. In the Service Details: Cloud Foundry Runtime screen area, select the following service plan: MEMORY

4. Press the Add 1 Service Plan button to add this entitlement for the Cloud Foundry Runtime service for your subaccount.

5. Press Save.

Create Service Instances of SAP S/4HANA Cloud Extensibility Service with Service Plans

To allow SAP Business Technology Platform applications to consume events and APIs from SAP S/4HANA Cloud, you need to create the relevant service instances of SAP S/4HANA Cloud Extensibility for the service plans api-access and messaging.

SAP BTP Cockpit: Create a new service instance of SAP S/4HANA Cloud Extensibility with service plan “messaging” for enterprise eventing integration

  1. Go to your subaccount.
  2. Go to the Service Marketplace and click on SAP S/4HANA Cloud Extensibility

acharyaw_17-1725256319957.png3. Click on Create.

acharyaw_18-1725256319958.png

4. In the Create wizard in the Plan dropdown list, select the service SAP S/4HANA Cloud Extensibility with plan messaging. Choose a CLI friendly name for your instance (e.g.s4-messaging ).

acharyaw_19-1725256319959.png5. Click Next

6. In the Specify Parameters dialog box, use the following template, which should have been prefilled for you.

{

"emClientId": "<Add your emClientId here>",

"systemName": "<S/4HANA Cloud system name>"

 }

Please enter the systemName you have entered in the first step for example, S4H5

acharyaw_20-1725256319960.png7. Click Create. The newly created instance appears in the list of instances in the Instance panel.

Note: The above steps will create a channel named SAP_CP_XP_S4EM in SAP S/4HANA Cloud. This will be used in the later steps.

It will create an event mesh message client s4EM which will receive events from SAP S/4HANA Cloud.

Manage Your Solution for Event Handling in SAP S/4HANA Public Cloud System

You need to enable the events that are to be sent from your SAP S/4HANA Public Cloud system to SAP Business Technology Platform. For this enablement step, go to your SAP S/4HANA Public Could System.

SAP S/4HANA Public Cloud: Maintain Event Topics in the Enterprise Event Enablement app

Find additional information here:

https://help.sap.com/viewer/7dde0e0e3a294f01a6f7870731c5e4ad/SHIP/en-US/1aafa0717c08461ba05ee846caec...

  1. Log onto your SAP S/4HANA Public Cloud system with administrator user.
  2. Search for the application Enterprise Event Enablement - Configure Channel Binding

acharyaw_21-1725256319962.png3. Click Go

4. Look for your emClientId that you had provided in an earlier step by clicking on Channel Name Value help.

For example, if you have provided the emClientId as S4EM, the channel name will "contain" the term S4EM.

acharyaw_22-1725256319963.png

After filtering, the channel name is displayed as below:

acharyaw_23-1725256319964.png5. Select your event channel from the list

6. Click Create for your Outbound Topic

acharyaw_24-1725256319965.png7. Click on the Topic selector

acharyaw_25-1725256319965.png

Select the Topic Selector

acharyaw_26-1725256319965.png8. Enter asterisk SalesOrder asterisk into the Topic Filter and click Ok.

acharyaw_27-1725256319966.png9. Click Go to search with SalesOrder

10. Select sap/s4/beh/salesorder/v1/SalesOrder/Created/v1

acharyaw_28-1725256319966.png11. You can also add other topics similarly. For example, if you want to receive events for Billing Block Status on Sales Order, then the Topic sap/s4/beh/salesorder/v1/SalesOrder/OvrlBlgBlkStsChgd/v1 needs to be selected.

Copy the topic namespaces ( for example - sap/s4/beh/salesorder/v1/SalesOrder/OvrlBlgBlkStsChgd/v1) that are being added now. They will be used later for subscriptions in Event Mesh.

acharyaw_29-1725256319967.png

12. Click Create.

Configure Event Mesh in SAP Business Technology Platform

Create a new service instance for SAP Event Mesh

When you create a new service instance for SAP Event Mesh, you create a new messaging client, which then receives events sent from your registered SAP S/4HANA Cloud system. The parameters you enter in the JSON file are the service descriptors that are later visible on the Messaging Client UI and dictate the rules to be used for creating queues and their subscriptions.

  1. Go to the SAP Business Technology Platform Cockpit.
  2. Open your subaccount.
  3. In the Navigation area, choose Services --> Service Marketplace
  4. Choose the Event Mesh tile.

acharyaw_30-1725256319969.png5. Click on Create.

6. Select Event Mesh from the Service Drop Down

7. Select default from the Service Plan Drop Down

8. Enter the Instance Name: you can use s4-event-mesh for the instance name

acharyaw_31-1725256319970.png9. Click Next

10. Copy the template into the parameter field and adjust relevant data:

  • Line 3: emname
  • Line 11 and 16: namespace

Note down the emname used in this step. We will use the event mesh instance to configure webhooks and queues later.

Example:

{

    "emname": "sbpa",

    "namespace": "sap/sbpa/events",

    "options": {

        "management": true,

        "messaging": true,

        "messagingrest": true

    },

    "resources": {

        "units": "10"

    },

    "rules": {

        "queueRules": {

            "publishFilter": [

                "*"

            ],

            "subscribeFilter": [

                "*"

            ]

        },

        "topicRules": {

            "publishFilter": [

                "${namespace}/*"

            ],

            "subscribeFilter": [

                "*"

            ]

        }

    },

    "version": "1.1.0",

    "xs-security": {

        "oauth2-configuration": {

            "credential-types": [

                "x509",

                "binding-secret"

            ]

        }

    }

}

11. Click on Create.

12. Once the instance has been created you can check on it in the SAP Business Technology Platform Cockpit under Instances.

Enable Event Mesh Cockpit

In order to access the Event Mesh Cockpit, you need to subscribe to SAP Event Mesh and assign a number of roles to your user.

  1. Subscribe to Event Mesh
  • Select Subaccount
  • Select Service Marketplace → Event Mesh → Create

acharyaw_32-1725256319970.png

Hint: You can either click on the tile and select Create or select Create from the menu of the tile

Note: If you don't see the Event Mesh tile or the Subscription option, get in contact with the administrator of the Global Account or check whether the plan standard has been assigned to the entitlement of event mesh standard plan has been assigned or not.

2. Go through the subscription process and select standard Subscription from the list

acharyaw_33-1725256319971.png

Once the subscription is completed you'll find additional Role Collections for Event Mesh available in your subaccount.

3. Assign newly created role collections to your users

  • Select Subaccount
  • Select Security → Role Collections
  • Click on the right arrow button in the "Enterprise Messaging Developer":

acharyaw_34-1725256319971.png

4. Click on Edit

acharyaw_35-1725256319972.png

5. Go to users tab and enter the email of the user and click on + sign.

Repeat this for every user that needs to have access, then click Save button.

6. Click on your subaccount

7. Select the Instances and Subscriptions tab

8.Click on the three dots under subscriptions and behind your application

9. Select Go to Application

acharyaw_36-1725256319972.png

10. Go to the Event Mesh Cockpit and confirm it works

acharyaw_37-1725256319973.png

 Note: The s4EM message client is created automatically as a part of the S/4HANA Extensibility service instance creation to receive events from S/4HANA Cloud system. The namespace is generates automatically.

Create Queues and Webhook 

Choose the event mesh message client created manually in the earlier step to create webhooks and queues. For example, in this blog, the name is sbpa.

  • Create your queue.

acharyaw_38-1725256319973.png

  • Create queue subscriptions. Note: We are subscribing to the events from the message client s4EM hence the namespace has the s4EM namespace plus ce plus the namespace of the subscribed topic.

For more information, see Manage Queues.

acharyaw_39-1725256319974.png

acharyaw_40-1725256319975.png

acharyaw_41-1725256319976.png

Test the Connectivity

Create Sales Order in SAP S/4HANA Cloud

Perform Steps in SAP S/4HANA Public Cloud system that dispatches the event. For example, the below example creates a Sales Order in the SAP S/4HANA Public Cloud.

Verify Event Connectivity1.png

Note the Sales Order number.

Confirm in Monitor Events Tile in BTP

The same business event is then captured in SAP BTP under SAP Build Process Automation -> Lobby -> Monitoring -> Business Events.

Verify Event Connectivity2.png

Check the Sales Order number is the same as the one that is shown in the previous step.

This confirms that the setup is complete.

Business Scenarios for Event Triggers

You can try out the following scenarios for business event triggers:

Business Event Triggers in SAP Build Process Automation for SAP S/4HANA Cloud : The Customer Return ...

Business Event Triggers in SAP Build Process Automation for SAP S/4HANA: Manage Credit Block on Sale...

Business Event Triggers in SAP Build Process Automation for SAP S/4HANA: Manage Billing Block on Sal...

Do write to me in case of blockers, queries and feedback.