Technical Articles
CAI Challenge Submission: SAP CAI Chatbot Integration with SAP-TM – Cost Simulation –
This blog is part of the SAP Conversational AI Tutorial Challenge 2021 and I would like to share our business case “TransportBot” with you. With this bot, we are able to manage transportation quotations request and Freight order status via a bot.
What is our case?
Online platforms are experiencing tremendous economic growth, the market is booming and the trend is growing year after year.
Consequently, the logistical needs, in particular transport, are becoming more and more complex. The carriers’ call centers are crumbling under the various requests for quotation and no longer able to satisfy their customers’ needs.
Digital Assistants use a conversational user interface and help customers provide quality self-service.
The main purpose of this project is to design and build a digital assistant with all the necessary “skills” to process requests for quotation and hand over to the competence center for in-depth treatment.
Use Case: Cost Simulation
- User must, first, provide the following information:- Source Location- Destination location- Weight
- The Chatbot, already connected to the SAP Backend system, will reply the user with the calculated cost based on information received.
- Then, he will send an email to the competence center to request an appointment.
Technical Architecture
First of all, we have created a specific OData RESTful API service in the backend system and exposed it via SAP Cloud Connector (which serves as a link between the SAP Backend system and On-demand applications in SAP Cloud Platform).
Then, we used OData Provisioning service in order to access to backend service since no SAP Gateway was available.
Step1: Exposing OData Service using SAP Cloud Connector and OData provisioning Service:
Connect SAP Cloud Connector to SAP Backend System:
Please refer to this blog post in order to achieve this step.
As we are using Odata Provisionning Service, we have created our ODATA service directly in SAP Backend system. Beside this, we implemented CRUD operations in order to read the entitysets needed.
-
Connect ABAP Backend to SCP via OData provisioning:
Please refer to this blog post in order to achieve this step.
In order to test the newly created connection, we need to simulate a GET operation using source city, destination city and the weight to be transported.
Step 2: Building Chatbot on SAP Conversational AI Platform:
Intent Creation:
Conversation flow Build and manage:
Requirements
Create a requirement asking the bot to save the recognized “#location” entity into a memory variables called “location” and “delivery’. “#number” entity is used to store the weight of parcel.
{{memory.location.city}}, {{memory.delivery.city}}and {{memory.weight.scalar}} will be used as filters parameters in the API Query.
https://xxxxxxxxxxxxx.hana.ondemand.com/odata/SAP/ZCHARGES_SIMULATE_SRV_01;v=1/Cost_CALCSet?$filter=Source eq ‘{{memory.location.city}}’ and Target eq ‘{{memory.delivery.city}}’ and Qty eq {{memory.weight.scalar}}&$format=json
This will be done in Action tab under the chatbot Skill.
Actions
This section details how we can consume the API service. To display the response, and we will add another message.
If the customer is satisfied with transport costs, the chatbot will send an email to sales team for an appointment in order to prepare a quotation.
In order to configure email sending from SAP CAI, we designed mail template and provides API to configure and send emails using POST requests and integrate this API as a webhook for skill fulfillment in SAP CAI.
Test the bot on SAP CAI
Send Email
Step3 : WhatsApp Integration:
In order to facilitate its usage, Chatbot can be integrated into many messaging apps.
We have chosen WhatsApp since it is the most used messaging application in the world right now.
Here we will be using Cloud Communication Platform Twilio, we created and deployed a Twilio function which will interact with SAP CAI using SAP CAI SDK and use function URL as Webhook.
Conclusion
Following this blog, you will be able to create an natively integrated Chatbot with your ECC/TM backend and deploy it on a communication plateform.
Please share with us your feedback and comment about this use case, and feel free to get in touch with us for further details.
Your support / like would be very helpfull.
Hi Cylia
Thanks for sharing such valuable information in this blog.
This is really helpful.
Yassine
Hi Cylia
Amazing blog.
Abir.
Thank you Cylia for sharing with us your knowledges.
Congratulations for your work!
Great initiative ! Thank you for sharing.
Hi Cylia,
Thanks for your explanations. This could be great opportunities for our customers!
Amazing, I am sure it must be good learning experience!!
Merci
Outstanding, great post.
Thanks 🙂
Thank you for the Blog!!
Great work. It's very helpful
Great blog ! It was so helpful 🙂
Thank you for your sharing 🙂
thanks cylia , for this great blog 🙂
Thank you for sharing, it's a great job.
Very nice feature ! Many thanks for sharing Cylia. Great job!
Excellent case where the conversational AI is fully integrated into the Processes. Connecting the world and technologies! Great Job
Thank you !
Awesome use case proving the potential of innovation technologies.
Great job!
Thanks 🙂
Congrats Cylia!
Thanks Mauricio 🙂
Great Job Cylia. Bravo !!!
thank you !
Good job Cylia !
On the road toward automation and UX enhancement
Thanks for sharing Cylia, very instructive.
This Chatbot natively integrated with ECC/TM backend with capability to deploy on a communication platform-Sounds great!!
That's Great, thanks for sharing.
Nicely written blog and Very helpful.
Thanks for sharing.
Thank you for this great job, very helpful.
Thank you for this blog
Very innovative and helpful.
Definitely a brillant work !
Cheers Cylia
intéressant ! Merci pour le partage 🙂
Brilliant ! Thanks for sharing.
Thanks a lot Cylia, it's amazing !
Amazing! Thank you for sharing
Thanks a lot for sharing. This blog is well written and illustrated. It is clear and simple.
Thank you for this blog !
Great work & so helpful! Thanks for sharing
Excellent content ! Thank you for sharing !
Excellent post Cylia ! Thanks for sharing.
Thanks for this blog. Interesting !
Great POC with a lot of potential!
Thank you for this blog
Thanks for sharing, Cylia. Great job !
Thanks for sharing ! Great POC !!
Great job, thanks for sharing
Amine b.
Hi Cylia,
Could you please explain the steps of OData Provisioning rather than providing an older blog. As we all know SAP Cloud Platform has upgraded a lot.
It would be very helpful, if you can provide with latest BTP blog or screenshots.
Thanks,
Vignesh.
Hi Vignesh,
As shown in this blog post, the cloud connector must first be configured and connected to your backend system.
You need to make sure the /iwbep/ resource is active in the cloud connector.
Then go to your SCP NEO environment => services => search for Odata Provisioning service
Go to: Configure service
Add new Destination:
URL: according to the virtual host we have created on cloud connector
http://virtuel_host/sap/iwbep?sap-client=120
Save and check connection
Once the connection is ok, go to service
Click on Register to add an Odata Service
I hope this has clarified things for you; if you have any questions, please feel free to contact me 🙂
Regards,
Cylia
Hi Cylia,
Thank you for your brief explanation. As we all know, Neo trial is no more and in Cloud Foundry there is no option for OData Provisioning. Could you please explain how to go ahead for OData provisioning on CF trial ?
Thanks,
Vignesh.
Hi Vignesh,
We can connect directly to the backend system using Odata Provisioning instead of going through the gateway.
Unfortunately, the Odata Provisioning service is not available in the CF, but you can use gateway system to consume OData services.
Regards,
Cylia.