An Event as a significant change in state. Change in one system will be informed to another system and that make event driven architecture, the heart of building Intelligent Enterprise in
SAP Business Technology Platform (SAP BTP).
For example, you create a Business Partner in SAP S/4HANA system which will trigger a event to SAP BTP through SAP Enterprise Messaging. This has many advantage and the first one which comes to my mind is that you don't need any Badi/Exit to be implemented in SAP S/4HANA to update business partner later. You can create application on SAP BTP and that will do all the jobs and keep your SAP S/4HANA Core clean.
There are few blog post for SAP Enterprise Messaging which is quite useful to refer for a smooth configuration.
SAP ECC
Check out
martin.bachmann blog post for overview,
f_farr blog post for configuration.
SAP S/4HANA Cloud
Check out
taranam‘s
blog post using the SAP S/4HANA Cloud Extensibility service,
pradeep.panda‘s
blog post for manual configuration.
SAP S/4HANA On-premise
Check out
pspaolo blog post,
vijay.sharma4‘s
blog post and
makoto.sugishita‘s
blog post.
Troubleshooting
An Excellent
blog post from
tobias.griebe which has covered all the probable troubleshooting which you might need during your journey to setup enterprise messaging.
What's new in SAP S/4HANA 2020
SAP S/4HANA 2020 has really simplified the steps for enterprise messaging by a great number. This time you can create all your channel, RFC destination, OAuth 2.0 destination in just less than 5 clicks. The good thing is that you don't need any much detail except enterprise messaging service key and everything will be done through that. I would also like to mention that there is still an option to follow manual steps apart from doing directly via service key.
I would also like to mention about the new cloud event version 1.0 which are going to come as payload from SAP S/4HANA 2020.
{
"specversion": "string",
"type": "string",
"source": "string",
"subject": "string",
"id": "string",
"time": "2021-02-15T10:34:56.685Z",
"datacontenttype": "string",
"data": {
"BusinessPartner": "string"
}
}
Create Enterprise Messaging Instance and Service Key
Creating Enterprise Messaging instance in SAP BTP is one of the primary steps which we have to do as it will allow you to manage messages in it's dashboard.
Refer the
documentation of creating enterprise messaging and creating
service key.
Create Roles and Authorization through PFCG
To setup enterprise messaging, user need to have required authorization. There may be a case where you have setup all the configuration and still you are not able to send event. It's better to check transaction
SU53 which will show all your failed authorization. In general, you need below roles to perform all your task.
- SAP_IWXBE_RT_XBE_ADM
Role for Enterprise Event Enablement administrator.
You can use this role to perform all admin tasks, such as checking logs, CCMS, OAuth 2.0 client and RFC destination creation.
- SAP_IWXBE_RT_XBE_BUSI
Role for Enterprise Event Enablement business administrator.
You can use this role to maintain event topics for the channel.
- SAP_IWXBE_RT_XBE_MDT
Role for Enterprise Event Enablement metadata administrator.
You can use this role to check metadata of the service, BROWSER_SRV and to explore events from SAP Enterprise Messaging.
You can see the
documentation which have explained all the required roles and authorization. For Creating PFCG roles from template, refer the the documentation
here.
Configure Enterprise Messaging through /IWXBE/CONFIG.
If you have followed all the above steps, it's time to configure enterprise messaging. You can also follow this
documentation. Navigate to transaction
/IWXBE/CONFIG.
Click on "via Service Key".
A popup will ask you to enter few details. Just ensure you have service key detail of your SAP Enterprise Messaging instance be with you.
Enter any "Channel name" and "Description". Open your service key and paste all the service key detail in the "Service Key" space. Your can give your "Preferred RFC Destination Name" and "Preferred OAuth 2.0 Destination Name" of your choice but it is still a optional. If you don't give any thing there, system will automatically create and assign the name for you. Isn't this cool.
Click on "Save".
Once you save the detail, below thing will happen.
- Channel will get created.
- RFC Destination will automatically get created and assign to your channel.
- OAuth 2.0 Destination will automatically get created and assign to your channel.
Click on "Activate < - > Deactivate" to activate the channel. You can see below successful message if channel is activated.
Click on "Check connection". You can see below successful message if connection to channel is successful.
Click on "Outbound Bindings" to configure topic for which you want to trigger the event.
Click on "Create" icon. Also ensure that your activated channel should have Green icon and it should be inside "Activate Channels" folder.
Select your topic from the list. Here we have selected
sap/s4/beh/businesspartner/v1/BusinessPartner/* . This will ensure that both created and changed event should trigger.
Test your Setup
Now your setup is done and it's time to test. Create Business Partner in SAP S/4HANA using transaction BP. Here our created BP ID is 1000172.
Refresh your SAP Enterprise Messaging Dashboard. You can see that you have received 1 message. I would also like to mention that you need to create a topic inside your queue. As you want it to get open for any business events, you can put topic name as sap/s4h2020/abc/* so that any business event coming from SAP S/4HANA will get listened to this queue. However to consume in business applicaton exact topic name will be needed. The structure of exact topic will be
<topic name space>ce<topic filter>
Go to "Test" tab and Consume Messages from Queue. Here you will see the Cloud event version 1.0 which is also a new feature of 2020 Edition. You can also see the Business partner ID in the payload.
Additional Information:
If you want to check the eventing in SAP ECC through
SAP NetWeaver Add-On for Event Enablement, please check the below blogs.
https://blogs.sap.com/2021/08/01/sync-sap-ecc-event-payload-with-sap-s-4hana-through-sap-netweaver-a...
Happy Eventing
🙂