Skip to Content
Technical Articles
Author's profile photo Syed Ejazuddin

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.

  1. 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.

  2. SAP_IWXBE_RT_XBE_BUSI

    Role for Enterprise Event Enablement business administrator.

    You can use this role to maintain event topics for the channel.

  3. 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.

  1. Channel will get created.
  2. RFC Destination will automatically get created and assign to your channel.
  3. 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-add-on-for-event-enablement/

Happy Eventing 🙂

Assigned Tags

      22 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Vijay Sharma
      Vijay Sharma

      This is nice. Thanks for sharing and mention Syed Ejazuddin .

      Author's profile photo Rohit J
      Rohit J

      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

       

      Author's profile photo dinesh k
      dinesh k

      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..

      • Change a parameter: rfc/selftrust to 1
      • Create a trusted relationship to itself
      Author's profile photo Taranam Dhindsa
      Taranam Dhindsa

      Thanks Syed Ejazuddin for sharing this ; this has simplified the set up for On Premise  .

      Author's profile photo Rohit J
      Rohit J

      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

       

      Author's profile photo Syed Ejazuddin
      Syed Ejazuddin
      Blog Post Author

      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. 

      Author's profile photo Rohit J
      Rohit J

      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

      Author's profile photo Syed Ejazuddin
      Syed Ejazuddin
      Blog Post Author

      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.

      Author's profile photo Rohit J
      Rohit J

      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

      Author's profile photo Rohit J
      Rohit J

      Also attaching the trace from SL01 during restarting of the channel

      
      	Client: 100  User: S4H_EWM  Transaction: /IWXBE/CONFIG  Trans ID: C83CB3D2A1420010E0060472E683B964
      	Start: 03/09/2021 01:33:54,105988  Finish: 03/09/2021 01:33:54,223220  File Version:  3  No. of Records: 10 Reason 0
      	EPP Full Context ID: 0E295800F34D1EEBA0974F40437AE30A  EPP Connection ID: 00000000000000000000000000000000  EPP Call Counter: 0
      	Block Version: 5,124  First Block of Dialog Step  Last Block in Dialog Step
      	Work Process: 12  Process ID: 10,416
      
      	hh:mm:ss:ms	Type	Lasts(us)	Object	Text
      
      	01:33:54,106	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP= ;DAEMON_ID= ;ACTVT= ;type=TR;name=/IWXBE/CONFIG;reason3=X;contextid=000
      	01:33:54,107	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_CONSUME;ACTVT=03;type=TR;name=/IWXBE/CON
      	01:33:54,107	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_PUBLISH;ACTVT=03;type=TR;name=/IWXBE/CON
      	01:33:54,107	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_SUBSCRIBE;ACTVT=03;type=TR;name=/IWXBE/C
      	01:33:54,107	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_SUBSCRIBE;ACTVT=05;type=TR;name=/IWXBE/C
      	01:33:54,109	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_PUBLISH;ACTVT=05;type=TR;name=/IWXBE/CON
      	01:33:54,109	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_CONSUME;ACTVT=05;type=TR;name=/IWXBE/CON
      	01:33:54,126	AUTH	      ---	/IWXBE/ADM RC=0	ACTVT=02;type=TR;name=/IWXBE/CONFIG;reason3=X;contextid=000050010E295800F34D1EEBA09
      	01:33:54,137	AUTH	      ---	S_GUI      RC=0	ACTVT=61;type=TR;name=/IWXBE/CONFIG;reason3=X;contextid=000050010E295800F34D1EEBA09
      	01:33:54,177	AUTH	      ---	S_GUI      RC=0	ACTVT=61;type=TR;name=/IWXBE/CONFIG;reason3=X;contextid=000050010E295800F34D1EEBA09
      
      	Client: 100  User: S4H_EWM  Transaction:   Trans ID: C83CB3D2A1420060E0060472E6845968
      	Start: 03/09/2021 01:34:01,600149  Finish: 03/09/2021 01:34:01,600269  File Version:  3  No. of Records: 2 Reason 40
      	EPP Full Context ID: 00000000000000000000000000000000  EPP Connection ID: 00000000000000000000000000000000  EPP Call Counter: 0
      	Block Version: 1,532  First Block of Dialog Step  Last Block in Dialog Step
      	Work Process: 6  Process ID: 10,410
      
      	hh:mm:ss:ms	Type	Lasts(us)	Object	Text
      
      	01:34:01,600	AUTH	      ---	S_RFCACL   RC=4	RFC_SYSID=S4H;RFC_CLIENT=000;RFC_USER=DDIC;RFC_EQUSER=N;RFC_INFO=INITIAL;ACTVT=16;t
      	01:34:01,600	AUTH	      ---	S_RFCACL   RC=4	RFC_SYSID=SAME_SYSTEM;RFC_CLIENT=000;RFC_USER=DDIC;RFC_EQUSER=N;RFC_INFO=INITIAL;AC
      
      	Client: 100  User: S4H_EWM  Transaction:   Trans ID: C83CB3D2A1420060E0060472E6845969
      	Start: 03/09/2021 01:34:01,620608  Finish: 03/09/2021 01:34:01,620699  File Version:  3  No. of Records: 2 Reason 40
      	EPP Full Context ID: 00000000000000000000000000000000  EPP Connection ID: 00000000000000000000000000000000  EPP Call Counter: 0
      	Block Version: 1,532  First Block of Dialog Step  Last Block in Dialog Step
      	Work Process: 6  Process ID: 10,410
      
      	hh:mm:ss:ms	Type	Lasts(us)	Object	Text
      
      	01:34:01,621	AUTH	      ---	S_RFCACL   RC=4	RFC_SYSID=S4H;RFC_CLIENT=000;RFC_USER=DDIC;RFC_EQUSER=N;RFC_INFO=INITIAL;ACTVT=16;t
      	01:34:01,621	AUTH	      ---	S_RFCACL   RC=4	RFC_SYSID=SAME_SYSTEM;RFC_CLIENT=000;RFC_USER=DDIC;RFC_EQUSER=N;RFC_INFO=INITIAL;AC
      
      	Client: 100  User: S4H_EWM  Transaction:   Trans ID: C83CB3D2A1420060E0060472E684596A
      	Start: 03/09/2021 01:34:01,635377  Finish: 03/09/2021 01:34:01,635458  File Version:  3  No. of Records: 2 Reason 40
      	EPP Full Context ID: 00000000000000000000000000000000  EPP Connection ID: 00000000000000000000000000000000  EPP Call Counter: 0
      	Block Version: 1,532  First Block of Dialog Step  Last Block in Dialog Step
      	Work Process: 6  Process ID: 10,410
      
      	hh:mm:ss:ms	Type	Lasts(us)	Object	Text
      
      	01:34:01,635	AUTH	      ---	S_RFCACL   RC=4	RFC_SYSID=S4H;RFC_CLIENT=000;RFC_USER=DDIC;RFC_EQUSER=N;RFC_INFO=INITIAL;ACTVT=16;t
      	01:34:01,635	AUTH	      ---	S_RFCACL   RC=4	RFC_SYSID=SAME_SYSTEM;RFC_CLIENT=000;RFC_USER=DDIC;RFC_EQUSER=N;RFC_INFO=INITIAL;AC
      
      	Client: 100  User: S4H_EWM  Transaction: /IWXBE/CONFIG  Trans ID: C83CB3D2A1420010E0060472E683B964
      	Start: 03/09/2021 01:34:01,559727  Finish: 03/09/2021 01:34:01,681111  File Version:  3  No. of Records: 9 Reason 0
      	EPP Full Context ID: 0E295800F34D1EEBA0974F40437AE30A  EPP Connection ID: 00000000000000000000000000000000  EPP Call Counter: 0
      	Block Version: 4,674  First Block of Dialog Step  Last Block in Dialog Step
      	Work Process: 12  Process ID: 10,416
      
      	hh:mm:ss:ms	Type	Lasts(us)	Object	Text
      
      	01:34:01,560	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_CONSUME;ACTVT=03;type=TR;name=/IWXBE/CON
      	01:34:01,560	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_PUBLISH;ACTVT=03;type=TR;name=/IWXBE/CON
      	01:34:01,560	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_SUBSCRIBE;ACTVT=03;type=TR;name=/IWXBE/C
      	01:34:01,561	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_SUBSCRIBE;ACTVT=05;type=TR;name=/IWXBE/C
      	01:34:01,561	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_PUBLISH;ACTVT=05;type=TR;name=/IWXBE/CON
      	01:34:01,561	AUTH	      ---	S_ADF_CFG  RC=0	DAEMON_TYP=CLAS;DAEMON_ID=/IWXBE/CL_DAEMON_CONSUME;ACTVT=05;type=TR;name=/IWXBE/CON
      	01:34:01,578	AUTH	      ---	/IWXBE/ADM RC=0	ACTVT=02;type=TR;name=/IWXBE/CONFIG;reason3=X;contextid=000050010E295800F34D1EEBA09
      	01:34:01,591	AUTH	      ---	S_GUI      RC=0	ACTVT=61;type=TR;name=/IWXBE/CONFIG;reason3=X;contextid=000050010E295800F34D1EEBA09
      	01:34:01,632	AUTH	      ---	S_GUI      RC=0	ACTVT=61;type=TR;name=/IWXBE/CONFIG;reason3=X;contextid=000050010E295800F34D1EEBA09
      
      	Client: 100  User: S4H_EWM  Transaction: /IWXBE/CONFIG  Trans ID: C83CB3D2A1420010E0060472E683B964
      	Start: 03/09/2021 01:34:05,968024  Finish: 03/09/2021 01:34:06,061241  File Version:  3  No. of Records: 2 Reason 0
      	EPP Full Context ID: 0E295800F34D1EEBA0974F40437AE30A  EPP Connection ID: 00000000000000000000000000000000  EPP Call Counter: 0
      	Block Version: 1,240  First Block of Dialog Step  Last Block in Dialog Step
      	Work Process: 12  Process ID: 10,416
      
      	hh:mm:ss:ms	Type	Lasts(us)	Object	Text
      
      	01:34:05,968	AUTH	      ---	S_GUI      RC=0	ACTVT=61;type=TR;name=/IWXBE/CONFIG;reason3=X;contextid=000050010E295800F34D1EEBA09
      	01:34:06,010	AUTH	      ---	S_GUI      RC=0	ACTVT=61;type=TR;name=/IWXBE/CONFIG;reason3=X;contextid=000050010E295800F34D1EEBA09
      
      27 Records read
      
      Author's profile photo Philip Ursi
      Philip Ursi

      Did you find a solution?

       

      I am facing the exact same iss at present.

       

      Thanks,

       

      Philip

      Author's profile photo Deniz Cengiz
      Deniz Cengiz

      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

      Author's profile photo Philip Ursi
      Philip Ursi

      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

      Author's profile photo Deniz Cengiz
      Deniz Cengiz

      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

      Author's profile photo Taranam Dhindsa
      Taranam Dhindsa

      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

      Author's profile photo Jose Tinu
      Jose Tinu

      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

      Author's profile photo saumya das
      saumya das

      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?

       

      Author's profile photo Syed Ejazuddin
      Syed Ejazuddin
      Blog Post Author

      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.

      Author's profile photo saumya das
      saumya das

      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?

       

      Author's profile photo Tushar Rajput
      Tushar Rajput

      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

      Author's profile photo Rajesh Kumar Katkoori
      Rajesh Kumar Katkoori

      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

      Author's profile photo Mario De Felipe
      Mario De Felipe

      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