Enevoldsen
ServiceNow Employee
ServiceNow Employee

In Servicenow we have different methods to read, create, update and delete data in SAP. Using these methods, we can build workflows and applications which will be integrated with SAP. One important pattern regarding these methods is that the initiative to call SAP would always be coming from Servicenow. But wouldn't it be great if you also could automatically get notifications whenever any changes occurred in SAP? So instead of trying to keep in sync with SAP data, which means you need to refresh your data of a regular basis, then SAP will also send you an update, when data is changed in SAP. This would get your Servicenow applications much more in sync with SAP, and events taking place in SAP could trigger immediate actions in Servicenow Workflow, giving the users a much more integrated experience of business taking place in both SAP and Servicenow.

 

This blog series takes you through the steps needed to create an Event Consumer in Servicenow which will enable you to get all these nice notifications from SAP, and use them in your Servicenow Workflows and Applications. 

 

The blog series will cover the following areas:

  • What is Event Driven Architecture (this blog)
  • Building the Event Consumer in Servicenow using standard components
  • Building the Event Consumer application to setup and monitor notifications
  • Building a demo workflow which uses the Events from SAP

What is Event Driven Architecture

According to Wikipedia, Event Driven Architecture (EDA) is :"a software architecture paradigm promoting the production, detection, consumption of, and reaction to events"  (https://en.wikipedia.org/wiki/Event-driven_architecture)

 

It's a design pattern where decoupled application can publish and subscribe to events. The events are send asynchronously from Event producer to Event receiver using an Event Broker/infrastructure. It's an architecture which enables you to build applications with loose coupling. An Event producer don't know who will receive the events and the Event Consumer don't know who sent the Event.  

Screenshot 2023-06-29 at 17.25.43.png

 

The Business value of reacting to an Event just after it has occurred in your ERP system is much higher, compared to a design pattern where you synchronise data on an hourly or daily basis. So using EDA will give your Business a better experience and it will also bring you a lot of benefits on the implementation side of it.

 

An example of a use case could be the following: "As a Commercial Manager I would like to approve Service Orders in Servicenow when the Service Order is referring to a specific type of Contract in my ERP system".

Using EDA, this would be translated into:

  • Whenever a service order is created or changed an Event should be send from the ERP system
  • The Eventing infrastructure will pass the Event to all relevant Consumers
  • The Consumer (Servicenow) will start a Workflow with the following steps
    1. Read the Service Order details and the Contract information from the ERP system
    2. Depending on the Contract type, route the Workflow to the relevant Manager
    3. Display the details to the Manager - if the Workflow is approved, the release the Service Order in the ERP system.  

Could the same logic be implemented without EDA?? Yes... but you would need to read all the relevant Service Orders e.g. on a daily basis, and then process the data whenever the data was read. But this would also mean that all creations and  changes happening until the next synchronisation would be delayed in the approval process and the Business value of the Workflow would decrease.

 

And does SAP support EDA? Yes, and its has been available for quite some time now. If you want to work with Events coming from S/4HANA, then visit https://api.sap.com/products/SAPS4HANA/events/events where there is a lot of Events ready for you to start consuming. 

For SAP ECC you will need an Add-On in order to use Events, you can find more details here: https://blogs.sap.com/2020/07/01/event-driven-architecture-now-available-for-sap-ecc-users/  and find Add-On details here: https://help.sap.com  

 

In the following blog we will start building the needed endpoints in order for you to start consuming Events in Servicenow. The Event specification used in the upcoming implementation will follow the definition from https://cloudevents.io/ 

 

Also, feel free to share your own experience with using EDA between SAP and Servicenow in the comments section or by reaching out to me. 

 

Stay tuned for the next blog: "Building the Event Consumer in Servicenow using standard components"


 

3 Comments