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