Skip to Content
Technical Articles

SAP Enterprise Messaging for SAP ERP: HowTo-Guide (Part 2 – First use case)

Since July the SAP NetWeaver add-on for event enablement is available to customers as anounced here. The Add-On enables SAP Netweaver systems to participate in an event driven architecture that is using SAP Enterprise Messaging.

This is part 2 in the blog series on the new event enablement add-on. In part 1 my colleague Florian Farr showed you already how to setup the connectivity between SAP ERP and SAP Enterprise Messaging.

In this blog post I will show you how to configure a notification event for Sales Order changes.
You can use these steps to configure a notification event for the business object of your choice or you follow along with the example for Sales Orders.

Step 1: Create Message Type

First we have to create a new logical Message Type. In SAP you can do this via transaction SPRO and the path “Integration with Other SAP Components → SAP NetWeaver AddOn for Event Enablement → ALE Delta Cusotmizing → Message Types in ALE for Cloud Interface” or you use transaction WE81.

For our example we create the message type Z_SALES_ORDER_CHANGE:

New Message Type

 

Important:
Be sure to not reuse existing message types as they will be used for change pointers that get consumed by the first subsriber. For the purposes of sending events each event must have its own message type.

To make use of the message type it also has to be activated. In transaction SPRO you go to “Integration with Other SAP Components → SAP NetWeaver AddOn for Event Enablement → ALE Delta Cusotmizing → Activate Change Pointers for Message Types” or you can use transaction BD50 directly:

Activate Change Pointers

Step 2: Customize outbound object

Next step is to configure a “Outbound Object”. For this you go to “Integration with Other SAP Components → SAP NetWeaver AddOn for Event Enablement → ACI: Connection Customizing File Transfer”.

There you select the cloud connection you created in part 1, go to section “Outbound Objects” and add a new entry:

Outbound%20Object

Outbound Object

Give the object a descriptive name, enter the message type created in step 1 and enter the suggested function modules /ASADEV/ACI_SIMPLE_NOTIFY and /ASADEV/ACI_SAP_EM_CLOUDEV_FM.

Now add details in the “Header Attributes” section for the individual event:

Header%20Attributes%20for%20the%20Event

Header Attributes for the Event

Important:
Make sure that the topic specified under SAP_EM_TOPIC matches the namespace of your Enterprise Messaging instance.

Step 3: Establish Business Object Event Linkage

Now we want to link the customizing we did so far to an actual Business Object Event so that we get notified when a Sales Order is changed in our system.
To create this link you go to transaction SWE2 and create a new entry. Here you link the business object event to a function module using the create message type as the receiver type.
Enter /ASADEV/ACI_EVENTS_SYNCH as the receiver function module and don’t forget to activate the linkage:

Event%20Linkage

Business Object Event Linkage

Step 4: Test the event

In order to test the event you can now go to transaction VA02, change a Sales Order and save it.

This now triggers the business event and through the event linkage also sends the event to Enterprise Messaging.

To see if the event was correctly triggered you can go to transaction /ASADEV/ACI_MONITOR or to SLG1 and verify the logs:

Monitoring%20and%20Logging

Monitoring and Logging

 

In Enterprise Messaging you can also create a queue subscribing to the selected topic in order to verify that it correctly reaches the Enterprise Messaging or of course directly consume the events with another application in your SAP Cloud Platform.

Conclusion

With the 4 steps described you can easily configure a notification event in your SAP ERP system to be sent out to your SAP Enterprise Messaging instance.

Please let me know which objects you connected, what your use cases are  and which further topics regarding the usage of the new add-on are most interesting to you.

10 Comments
You must be Logged on to comment or reply to a post.
  • Thanks Martin, very good explained.

    I have already installed the add-on in our ERP sandbox and it's all configured based on the help from SAP (https://help.sap.com/viewer/e966e6c0e61443ebaa0270a4bae4b363/1.0/en-US/3eba827c531344eb879d8e35022d90ba.html) and from the blog from Florian Farr .

    Then I've followed the example for Article Create explained in the help.sap and now I have replicated your example for the Sale Order Creation. But my problem is that I don't see any event after that in the monitor neither in the logs.

    Is there any extra config that I have to do in order to create these events?

    For the Article example I was able to see some entries in the table BDCP2 but in fact nothing happens in Enterprise messaging, and i don't see any message in the /ASADEV/ACI_MONITOR.

    For the Order example I don't see any entry in the BDCP2.

    I see in the spro these 2 options but as they are not mentioned here neither in the SAP help, i'm not sure if something is missing in my side:

    spro%20asapio

    spro asapio

    In case an extra configuration is needed to produce the events, could you please share it ? It would help a lot.

     

    Thanks a lot for your fantastic blog.

    Best Regards

    /
    spro%20asapio
    • Hi Carlos,

      can you please check in "Activate Change Pointers - Generally" if this is active?

      If this is already set then the next step is to activate and check if the event trace shows the linkage you configured (transactions SWELS and SWEL).

      If you have an entry in BDCP2 I would assume the event trace shows that the business event triggered but perhaps it will show an error in the details.

      Please also check the logs in SLG1 for object /ASADEV/AMR_LOG.

      Best regards

  • Hi Martin,

    Thanks for your answer, very helpful.

    The trace was active but with restrictions and I was not able to see anything. After removing the restriction the light come to me.

    Another problem that I've founded was that the entries in the Transactional RFC monitor were recorded but not processed. I've processed manually and after that everything start working.

    So now I'm in a better situation, I see my events in the monitor:

    So I was checking and I've found a problem when I try to setup the Cloud shared Secret:

     

    So I don't know if you know why this is happening. Another question is regarding the ASAPIO monitor, when I try to reprocess a message I got the following error:

    Do you know where I can create this Variant?

     

    I'm sorry to bombard you with questions, but I don't find many documentation regarding this topic and I feel a bit alone in the dark 🙂

    Thanks again

     

    Best regards

    • Hi Carlos,

      to investigate the techincal issues regarding the secure store please open an OSS incident with SAP for component OPU-ASA-EE. To me this seems to be some issue when installing the add on.

      Regarding the calls being parked instead of executed directly please check if the basic workflow customizing has been done in your system (transaction SWU3).

      The re-processing in the monitor currently does not work for calls like this.

      There is a transaction /ASADEV/ACI with which you can plan a background job to pick up failed calls. This will have a variant and with that you can re-process the calls.

      Best regards,

      Martin

      • Hello Martin,

         

        Is it possible to re-trigger the Events from the monitoring transaction ( /ASADEV/ACI_MONITOR ) with the buttons. "Process the selected Variant" " process the selection variant via selection screen".

        My requirement is : we sent an event to the a third party system, Event has been processed successfully. however they have some issue and we need to re-trigger the event. How can i do this ?

        Regards

        • Hi Metin,

          there is a possibility to reset the change pointers the framework uses as indicator if the event has been sent.

          For this you can go to transaction /ASADEV/SCI_CP_RESET, select your message type and for which date range to reset the change pointers.

          After you did this you can then trigger the re-processing via transaction /ASADEV/ACI where you can configure your cloud connection and outbound object and trigger the framework to send the event again.

          We are also working on enabling re-sending from the monitor transaction for the next release.

          Kind Regards

  • Your blogs made me finally start getting into the topic. Thank you very much.

    Are you guys planning a third blog with more advanced topics like message mapping, own FMs, BAdis, ...?

    • I would also like to know more about the more advanced possibilities. For example we would like to distinguish on business partners based on bptype (customer, client, contact person etc.), and send them to different topics. I assume that we should implement a check function, but I would love to see an example.

       

  • Hi Martin Schöffler,

    I have a question about the configuration of the Event Enablement Add-On. What is Field Mapping all about? Is there a documentation for this? I have not found a tutorial on the SAP help pages or somewhere else.

    Kind Regards