Technical Articles
Challenge Submission: Building Chatbot using SAP Conversational AI for Creating Maintenance Request & Integration with SAP S/4HANA Backend System
Intro
Hello everyone!
This blog post is part of the SAP Conversational AI Tutorial Challenge 2021. This tutorial describes how to build a digital assistant, maintenance-bot whose main purpose is to generate malfunction reports for the right equipment. Our main objective is to provide flexibility to users for handling maintenance notifications conveniently via maintenance-bot.
Case Description
Generating malfunction reports in real time as part of maintenance management plays a significant role in production plants especially for reducing downtime, increasing efficiency, reducing maintenance costs and standardizing maintenance management.
At this point, users could generate malfunction reports via simple dialogue with the chatbot. Thanks to seamless integration with SAP S/4HANA and messaging applications, maintenance-bot would be favourite digital assistant for the users. Consequently, building the digital assistant provides huge flexibility and operational efficiency.
In our scenario, users contact with the chatbot on a messaging platform which is WhatsApp for our case, then they provide necessary parameters such as malfunction description, equipment number or barcode. After that, malfunction report is generated on SAP backend system. Then, chatbot gives information about the final status of the report and its details to users. A diagram which describes the workflow is below;
Technical Architecture
For our scenario, we use a specific existing OData Service called “EAM_NTF_CREATE” in order to generate malfunction report. We exposed it via SAP Cloud Connector which serves as a link between backend system and applications in SAP Business Technology Platform. Then, OData Provisioning service is utilized as an access point to the SAP S/4HANA backend system.
In order to integrate SAP Conversational AI with WhatsApp Messenger, we used Chat-API platform that provides WhatsApp Business API and middleware that is written in node.js for communicating between WhatsApp Messenger and SAP Conversational AI.
Step-by-Step Implementation Guide
Step1: Integration between SAP S/4HANA Backend and SAP Business Technology Platform
To setup and configure Cloud Connector, please refer to this blog post. (https://blogs.sap.com/2018/11/12/how-to-setup-cloud-connection/)
After exposing SAP backend system to SAP Business Technology Platform, we need to call related OData service via OData Provisioning service.
In order to call related OData service and configuring OData Provisioning service, please refer to this blog post. (https://blogs.sap.com/2016/10/14/connect-apab-backend-hcp-via-hci-odata-provivisioning/)
If we check OData Provisioning service administration panel, we are able to confirm, related OData service is registered and ready to be consumed by authorized users who have correct GW roles in OData Provisioning service.
We could use simple GET and POST operations to test the integration between SAP Business Technology Platform and SAP Backend system. We would see that we call the service to get equipment details.
Also if we check whether failure notification is created, we need to give the sample payload below before executing POST operation. After that we could see that failure notification is created successfully.
{
"ShortText": "Test Failure Notificaiton ",
"ReporterDisplay": "TR29114",
"TechnicalObjectType": "EAMS_EQUI",
"NotificationTimestamp": "\/Date(1614168821925)\/",
"TechnicalObjectNumber": "217100044",
"NotificationType": "M2",
"Reporter": "TR29114"
}
Note: Alternatively, we could have called OData service directly within SAP Conversational AI platform by using Destination URL that is corresponding to SAP S/4HANA backend system. As pre-requisite, enterprise edition for SAP Conversational AI is needed for this solution. In order to integrate in this alternative way, please refer to this blog post. (https://blogs.sap.com/2020/12/09/connect-an-sap-conversational-ai-chatbot-to-sap-s-4hana-tutorial/)
Step2: Building Malfunction Report Chatbot on SAP Conversational AI Platform
Intent Structure
Content of @maintenance
Triggers of Maintenance
Skill Structure
When the user requests maintenance, the user enters a flow. The user can process both the barcode photo and the equipment number of the product. The router decides whether this is a barcode or an equipment number.
Requirements of Router
External API Configuration
The error description of the product, which is read from the barcode with OCR API or given an equipment number, is sent with a timestamp which is created in the payload.
Action of Information
Step3: Configuration for Middleware – Webhook
In order to create a link between SAP Conversational AI and WhatsApp Messenger, a middleware is written in Node.js. Webhook provides communication between Whatsapp and SAP Conversational AI, allowing the user to communicate with the chatbot over Whatsapp.
Here we will be using Chat-API platform as a WhatsApp Business API provider. Configurations may differ for other cloud communication platforms.
Step4: In Action!
SAP Conversational AI Tests
When we test the chatbot on SAP Conversational AI platform, we could see the successful notification creation.
Here it is the dialogue after WhatsApp integration,
When we check the SAP S/4HANA system, we could see the malfunctions reports are created successfully.
Conclusion
I would like to specially thank to Berkay Bas for his assistance in SAP S/4HANA Backend.
We hope this tutorial is helpful for you to build an integrated Chatbot with SAP S/4HANA backend system.
Thank you for reading and please share with us your feedbacks and comments about the scenario.
Innovative with detailed explanation, well done.
I find your tutorial on building Chatbot with SAP S/4HANA backend system!!
Thank you! I hope you would find it useful.
Even me i was wondering how to make a chatbot in S/4 Hana system. Very useful article thx a lot for sharing with us.
Thank you for your valuable comment! I hope this article will help you.
Congratulations! Nice work!
Congrats !
A nice example where the Chatbot contributes to lowering the cost and speeding up the communicaton process, which has a positive influence on the business case. It also takes away burden and traditional tresholds in between disciplines which makes the overal performance better. Lesswaiting time, shortens the MTTR and therefor improves the overall OEE.
Thanks for this Use Case it certainly will be working in practice with ever increasing connectivity!