Technical Articles
Configure SAP Enterprise Messaging for SAP S/4HANA On-Premise 2020 via Service Key
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, Florian Farr blog post for configuration.
SAP S/4HANA Cloud
Check out Taranamjit Kaur Dhindsa‘s blog post using the SAP S/4HANA Cloud Extensibility service, Pradeep‘s blog post for manual configuration.
SAP S/4HANA On-premise
Check out Paolo Sfilio blog post, Vijay Sharma‘s blog post and Makoto‘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”.
- 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.
Happy Eventing 🙂
This is nice. Thanks for sharing and mention Syed Ejazuddin .
Hi @vijay.sharma4 and @ejaz123
I am using S4HANA 2020 Fully activated appliance On Premise trial to test out the Enterprise messaging
I am also using SAP BTP Cloud Foundry trial, i've followed pretty much all the blogposts and SAP Help portal,
I was able to get to all the steps mentioned but am not able to get the messages to the EM queue in the cloud
I am getting this error in the logs "Not all daemons for channel '<Channel name>' are up and running."
The connection is showing successful
Tried multiple channel names and topic names but of no use, can you direct me to a documentation or a hint in this regards
Hi Rohit,
Not sure if you were able solve this issue... But we had the same problem and we asked SAP and got response to do one of the following steps, and we were able to fix it..
Thanks Syed Ejazuddin for sharing this ; this has simplified the set up for On Premise .
Hi @https://people.sap.com/vijay.sharma4 and https://people.sap.com/ejaz123
I am using S4HANA 2020 Fully activated appliance On Premise trial to test out the Enterprise messaging
I am also using SAP BTP Cloud Foundry trial, i've followed pretty much all the blogposts and SAP Help portal,
I was able to get to all the steps mentioned but am not able to get the messages to the EM queue in the cloud
I am getting this error in the logs "Not all daemons for channel '<Channel name>' are up and running."
The connection is showing successful
Tried multiple channel names and topic names but of no use, can you direct me to a documentation or a hint in this regards
Hi Rohit,
First of all, Thanks for referring the blogs for EM. Could you please have a look at SU53 to check any failed authorization. Also just to ensure your user should be mapped to role SAP_IWXBE_RT_XBE_ADM. You can generate profile for this role from PFCG and assign your user. Once you assign your user, Then Deactivate your existing activated channel and then Activate it.
Hi Syed
Thanks for Replying,
i was able to create a profile from role and add the User to it
when i restarted the Channel, i was getting the following error in SU53
can you redirect me from here, I am starting at s4h, redirect me to the documentation if you find this naive.Thanks again
Issue still like missing roles. just ensure that in your role SAP_IWXBE_RT_XBE_ADM, authorization and user tab should be green. Also ensure you should have done full user comparison in user tab. Once you do that steps, deactivate your channel and then activate it. Let me know if that works. also please send me the snapshot of the error if you get while do connection test.
I've done those things and now it shows Same authorization check unsuccessful message in SU 53
Here are the screenshots of the errors
Logs of the errors from SLG1
The connection test for RFC destination is working fine, STRUST :Added required certificates
The SDAEMON shows the 3 services in "Pending" state
is it possible to get into a quick call? Thanks for the replies
Also attaching the trace from SL01 during restarting of the channel
Did you find a solution?
I am facing the exact same iss at present.
Thanks,
Philip
Hi Rohit J , hi Philip Ursi , hi Syed Ejazuddin
has either one of you found a solution so far? I am facing the same issue.
Also, when the channel is not activated, the connection test succeeds; when I activate the channel and test again or trigger an event that is part of the event topic it fails with the same "Not all daemons for channel '<Channel name>' are up and running." error you were facing.
Any ideas?
Thanks,
Deniz
Hi Deniz,
I had 2 problems. The first was the authorizations. You need to generate this role in PFCG (it is not generated by default) and assign it to your user:
SAP_IWXBE_RT_XBE_ADM
Then delete your oauth and channel and redo the steps. I tried by deactivating and reactivating, but this did not help.
Then, a second thing missing in this blog is the new naming convention for the queue subscription. Now your subscription should look like this:
<namespace>/ce/<topic>
The ce stands for cloud event and is something new they added I think.
Example:
a/b/c/ce/sap/s4/beh/businesspartner/v1/BusinessPartner/*
Hope this helps as not much documentation is available.
Best regards,
Philip
Hi Philip Ursi
I had the user role in place and the profile created, but it still was not working and driving me nuts. Thanks to your input I got it working now. The clue was actually deleting the channel, oauth and destination I had previously created; I had not tried that. I tried logging in and out with the specific user, restarting the environment, but not that.
I had my topic for the queue subscription set up as a/b/c/* so I'm uncertain whether that would've worked or not – but thanks for that tip, too. I've also changed this now.
Anyways, works like a charm now! Thanks a bunch! 🙂
Kind regards
Deniz
hi Syed
It would be good if you can mention trouble shooting and known issues as well while using Service key . Since I also ran into issues while trying this option in 2020 .Example I had to maintain the Proxy settings manually in transaction OA2C_CONFIG as i was getting error "Verify channel Oauth 2.0 client Profile and Configuration " while activating in /IWXBE/CONFIG.
Regards
Taranam
Hi Syed,
We are able to simulate the events and get the messages in EM queue. But the realtime events are not getting propagated to the queues. can you help with the steps to activate auto trigger.
Thanks,
Tinu Jose
Hi Syed,
While trying to create channel in /IWXBE/CONFIG via service key, I am getting below error.
"Provided service key is initial".
Can you help me to understand, what could be the issue?
Hi Saumya,
It happens when you try to paste service key not in the correct screen. It happens sometimes. what you can do is either to come out of transaction and then try again. or else try to scroll screen up/down and then you will able to see the correct dialog screen.
Thanks Syed Ejazuddin
It worked fine, we were able to push the events and consume it. But now again when I am trying to open the em dashboard, its leading me to this error which I am facing since today only.
'You do not have sufficient permissions to access this page.'
Is there any maintenance/upgrade happening?
Hi Syed,
All the configuration has done but still I am not getting messages in my Event Mesh account .
The Verion I am using is Dev Plan
Hi Syed,
Thanks for your nice blog.
The example which is given for Standard Business Partner Event. But is there any way that we create Custom Events? Use Case: for any document, we want to trigger a Custom Event if its Status changed to some value. Please advice.
Regards,
Rajesh
Hi Rajesh
you might want to check these two blogs
https://blogs.sap.com/2021/06/01/sap-netweaver-addon-for-event-enablement-now-also-released-for-s-4hana/
https://blogs.sap.com/2022/03/04/data-events-scenario-with-sap-event-enablement-add-on-for-sap-s-4hana-sap-event-mesh-and-sap-cloud-integration-step-by-step-guide/
Mario