Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Ajit_K_Panda
Product and Topic Expert
Product and Topic Expert








Blog post series

[Part-1] ‘Events-to-Business Actions’: An event-driven architecture on SAP BTP to implement Industry 4.0 scenarios with Microsoft Azure Services (click here)
[Part-2] Understand the details of “Events-To-Business Actions” framework (click here)
[Part-3] SAP Integration Suite’s upcoming event bridging functionality for outbound scenario (click here)
[Part-4] Try out ‘Events to Business Actions Framework’ for SAP Service Cloud scenario (This Blogpost)
[Part-5] Collaborative Event-Driven Business Applications with SAP BTP and Microsoft Teams (click here)

Introduction


In previous blog post of this series, “Using Events-To-Business Actions framework for building event driven business applications”, we have seen the details of the framework and how to design applications in SAP BTP to strengthen customer business processes and boost operational effectiveness by linking industry events to business actions. 

In this blog post, we will examine how this framework can be used with SAP Service Cloud for Service Order creation process. It is highly recommended to go through previous blogs of this series starting with Event-to-Business Actions" architecture: An event-driven framework on SAP BTP (Business Technology ... by PVN Pavan Kumar.

Overview of Business Process


Let us look at a simple business process flow of Service Ticket creation as shown in Figure -1.


Figure - 1: Business Scenario


In this scenario, we will consider Microsoft Azure IoT as the system for event source. Microsoft Azure IoT can be used to connect and control numerous devices or pieces of industrial equipment, and these devices are constantly sending data to the platform. To find equipment anomalies in Microsoft Azure IoT, various rule-based conditions are applied. It is possible to send the specifics of an anomaly that has been raised to SAP BTP Event Mesh as an event once the "Events to Action framework" has been configured. The extension application of the framework on SAP BTP responds to the event and determines the business action to be carried out based on the specifics of the anomaly.

With this setup and configuration, for the business process mentioned above, we will use an Industrial Pump as an example device in which a rise in temperature creates an anomaly event, based on the set up of action framework, it will eventually generate a repair "Service Ticket" in the SAP Service Cloud.

Before you start to implement this scenario, follow the documentation in GitHub repository SAP BTP - Events to Business Actions Framework to download and deploy the application in your SAP BTP subaccount. The repository provides detailed documentation and steps on how to configure, deploy and build event-driven applications using this framework.

Configuration Set Up in SAP BTP and Microsoft Azure


[In Microsoft Azure] Create Device Template and a Simulated Device


In Microsoft Azure, a device template ‘Industrial Pumps’ is created with PumpId, PumpType, Status, Service Ticket property and Temperature telemetry information as shown in Figure - 2. To know more about how to setup and configure devices in Microsoft Azure, refer to this GitHub repository here.


Figure - 2: Device Definition in Microsoft Azure


A simulated device is created in reference to a registered product in SAP Service Cloud as shown in Figure - 3.


Figure - 3: Registered Product in SAP Service Cloud


The Status property of device is set to ‘Provisioned’ and Service Ticket property is set to empty as shown in the Figure - 4.


Figure - 4: Device Information in Microsoft Azure



[In Microsoft Azure] Create Data Export representing an Anomaly


In data export configuration, events from Industrial Pumps devices are exported if temperature of the devices rises beyond 30 degrees Celsius.  This configuration is shown in Figure - 5.


Figure - 5: Data Export Configuration in Microsoft Azure


In addition to telemetry information like temperature, the event is also enriched with additional information like PumpId, PumpType, System etc. Finally, destination is set to SAP Event Mesh to forward the event details to SAP BTP as shown in Figure - 6.


Figure - 6: Destination Configuration in Microsoft Azure



[In SAP BTP] Create an SAP Destination for Service Cloud API


As shown in Figure - 7, a destination named ‘cx-service-cloud-api’ is added using BTP cockpit with details of SAP CX Service Cloud api details and relevant credentials. The API url for this destination is: https://<<cxservicecloudsystemid>>.crm.ondemand.com/sap/c4c/odata/v1


Figure - 7: Destination Configuration in SAP BTP



[In SAP BTP] Deploy and Access action modeler application to configure your scenario.


Create Business Rule for Service ticket classification data: Post deployment of the framework application, create a new business rules project ‘Service Ticket Configuration’ similar to ‘Event to Actions Rules Project’ as shown in Figure - 8. This will have a decision table rule to determine required classification data like service category, priority etc to create the ticket in Service Cloud.

You can download the Service Ticket Configuration Business Rules Project from here.


Figure - 8: Business Rule Configuration in SAP BTP


Configure Business Action: In action modeler application, we will configure the business action with following details:

  • Figure - 10: Get Ticket Configurations from Business Rule Project in SAP BTP.

  • Figure - 11: Create Repair Service Ticket in SAP Service Cloud.

  • Figure - 12: Once ticket is created, update device status and service ticket property in Microsoft Azure.


You can find the configuration details in an excel here.


Figure - 9: Manage Actions Configuration in SAP BTP



Figure - 10: Action Configuration 1



Figure - 11: Action Configuration 2



Figure - 12: Action Configuration 3


Update Decision table in SAP Business Rules application with Action Id: As shown in Figure - 13, in ‘Events to Action Rules Project’, update main action id (Create Service Ticket) for ‘Industrial Pumps’ device template.


Figure - 13: Decision Table Configuration in SAP BTP



[In Azure/BTP/Service Cloud] Test the Application


To test the end-to-end process, start with configuring the data export condition in Microsoft Azure and verifying the Service Ticket creation in SAP Service Cloud.

Enable data export and wait for it to be healthy as shown in Figure - 14.


Figure - 14: Enable Export in Microsoft Azure


Repair Ticket created in SAP Service Cloud as shown in Figure - 15.


Figure - 15: Service Ticket in SAP Service Cloud


Verify the device status in Microsoft Azure.  The status should be updated as ‘Under Maintenance’ as shown in Figure - 16.


Figure - 16: Deice Status in Microsoft Azure


Check Action Logs Application to view the transaction logs as shown in Figure - 17.


Figure - 17: Action Logs in SAP BTP



Conclusion


In this blog post, I have tried to consume real-time events from Azure IoT and integrate it with SAP Service Cloud, in a similar way you can develop multiple use cases and integrate events into any SAP business application with minimum configuration.

Below is the link and detailed documentation of the framework.
Build Events-to-Business Actions Scenarios with SAP BTP and Microsoft Azure

Deploy in your SAP BTP subaccount and start developing your event-driven business applications.

To learn more about SAP BTP, see the learning journey on SAP Learning called Discover SAP Business Technology Platform, a great introduction to BTP and the Intelligent Enterprise strategy to see what it’s all about for free or check out Develop Advanced Extensions with SAP Cloud SDK plus much more free learning at SAP Learning site.

For more information about this topic or to ask a question, please contact us at paa_india@sap.com.