SAP BTP Event Mesh — from S4 to SCI
SAP BTP Event Mesh is a service that allows applications to communicate through asynchronous events. It supports a plethora of SAP standard events from BOR objects and classes (on S/4HANA systems). However, if you need custom events or events from older R/3 systems, you must install the ASAPIO Integration Add-on.
Our recent side-by-side extension solutions are all implemented using EDA (Event-Driven Architecture), which, in the SAP BTP portfolio, is supported by Event Mesh. SAP BTP Cloud Integrations serve as an enterprise integration platform, usually acting as a central communication hub that also has access to on-premise systems within a corporate network.
This blog post integrates all these services and components into one solution, providing a method to relay information about an event from on-premise SAP to the SCI (SAP Cloud Integration) and beyond (e.g., SAP BUILD, Fiori Applications, third-party apps, etc.).
Create instance on BTP
Add json configuration — I use template below, where
{
"options": {
"management": true,
"messagingrest": true,
"messaging": true
},
"namespace": "<ns1>/<ns2>/<ns3>",
"rules": {
"topicRules": {
"publishFilter": [
"${namespace}/*"
],
"subscribeFilter": [
"${namespace}/*"
]
},
"queueRules": {
"publishFilter": [
"${namespace}/*"
],
"subscribeFilter": [
"${namespace}/*"
]
}
},
"version": "1.1.0",
"emname": "<name>"
}
Note: namespace creation is just my personal best practice — you can create your own one
Create service key for that instance and download it. We will need it in next step.
We will start by creating connection from on premise SAP to the SAP BTP Event Mesh instance.
Go to the SE38 and run report ASADEV/ACI_EM_RFC_CREATE.
This record will create two necessary destination for you automatically, just add Cloud Instance name, RFC Name and load your downloaded json from service key.
As an Cloud Instance Name, you should put name of your BTP EM instance (you can make some up).
Also dont forget to add endpoint certificate to the STRUST. Endpoint can be found in service key under http protocol uri
Execute, and you should see message showing success
Now you can check created destinations in SM59. Look into G category.
In SPRO tcode go to Integration with Other SAP Components/SAP NetWeaver AddOn for Event Enablement/Connection and Replication Object Customizing
There you can find almost all configuration — so choose your newly created Instance and add destinations + ISO Code and Cloud Type.
Note: If you dont have ISO Code and Cloud Type configured, you can do it in spro (1) and (2)
Next, you should check/maintain default values for connection.
And also maintain error type mappings
Now to the core of our topic — add outbound type details
I will use USER object as an example
Maintain:
Note: There are many more function modules to configure here, but they are out of scope of this blog
Now for your outbound object, maintain event linkage
Add:
Header Attributes should be added as
This should be all, what we need to configure in an on premise system.
Select you event mesh client and create new QUEUE
Now, when you have queue created, you need to subscribe this queue to the topic
Copy name of the topic, you maintained in SAP Header attributes and put it as topic name (1) then push button Add (2) and you should see added topic in list of subscribed topics (3)
Note: Now you should be able to test if you will be able to receive event in BTP Event mesh. Just trigger that event in SAP and refresh queue. You should see new message.
Now we will create and configure webhook, which will propagate that event from SAP BTP EM to the SAP SCI (Cloud Integration). We should have iFlow in SCI, with HTTP sender adapter. Copy endpoint URL of that http adapter, and also get credentials from SCI instance service key in order to authenticate with webhook towards SCI.
In Event Mesh go to the Webhooks tab and push Create Webhook Button.
Maintain:
Newly created webhook is paused, so you must trigger handshake to initiate connection
Confirm dialog
and webhook should be active
Now you should be able to receive event from the backend SAP system up to the SCI as a http message.
Disclaimer: I have posted this blog post also on my personal blog https://medium.com/@vbalko/sap-btp-event-mesh-from-s4-to-sci-47d1a273739c