Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
kunju1991
Participant
0 Kudos
Hi Experts,

Hope all is going well!

Quick Overview

Myself & kunjshukla has been working on SAP Conversational AI Chatbots for a while and want to share one of the interesting use case in which, we will do an end to end integration from the S/4 Hana system to SAP Conversational AI Chatbot and then access the chatbot from the MS Teams.

This blog post is the 4th part of the blog series SAP SAP S/4HANA integration with SAP Conversational AI Chatbot using MS Teams.

  1. SAP S/4HANA integration with SAP Conversational AI Chatbot using MS Teams - Part 1 ,

  2. SAP S/4HANA integration with SAP Conversational AI Chatbot using MS Teams - Part 2 ,

  3. SAP S/4HANA integration with SAP Conversational AI Chatbot using MS Teams - Part 3  and

  4. SAP S/4HANA integration with SAP Conversational AI Chatbot using MS Teams – Part 4


Let's have a quick recap of what we have already achieved in this blog series:

  • OData service has been activated / created in the S/4 Hana onPrem system

  • OData service has been exposed to the SAP BTP trial account via the SAP Cloud connector.

  • Successfully created Destinations

  • Successfully created Connectivity & Destination instance.

  • NodeJS application has been created and deployed to the SAP BTP using CLI.

  • We have a working public service API.




By the end of the last blog post we had a working API using which the purchase order, purchase requisition and sales order data can be easily accessed from the backend system.

In this blog post we will create a SAP CAI chatbot (by forking a chatbot) and integrate it to the service API created in the last blog post. Once done, integrate the CAI chatbot with MS Teams so that users can easily access the chatbot.

Agenda:

  1. Create SAP CAI Chatbot — In order to limit the scope of the blog we will create a SAP CAI chatbot by forking an existing bot).

  2. Integrate Chatbot to the Service API — to access OData services in the CAI Chatbot, integrate the chatbot created with the service API.

  3. Integrate the chatbot with the MS Teams — to consume the chatbot over teams, so user can access the chatbot during their day to day work

  4. Final Testing -- of the bot


Prerequisite:

  1. Access to SAP CAI community edition account.

  2. Basic Understanding of how to create a chatbot. For the same please go through the below tutorials:

    1. Build Your First Chatbot with SAP Conversational AI

    2. Create a Business-Oriented Chatbot with SAP Conversational AI

    3. Level Up with SAP Conversational AI



  3. Access to Developer portal or App Studio app in MS Teams.


 

Create SAP CAI Chatbot



  1. Lets create a chatbot. To create a chatbot we will fork the chatbot.

  2. To fork the chatbot open the link https://cai.tools.sap/kunju1991/automation-bot/train/intents and click the fork button

  3. Once the chatbot is successfully created, click on the bot to edit the details.

  4. Since its a new bot we need to train the bot by clicking the train button. Once done you will see the green light next to the Train button.


Integrate Chatbot to the Service API


Lets now Integrate the CAI Chatbot to the service API we generated in the last blog. For the same do follow the below steps:

  1. Click the Settings button

  2. On the left side menu, click on the environments tab and paste the URL as obtained earlier (in the last blog post) and click on the save button.

  3. Once done we have a working chatbot.



Chatbot integration with MS Teams


Now the chatbot has been tested, lets integrate the chatbot with the MS Teams, so user can access the chatbot with much more ease. Lets get started.

  1. Go to MS Teams search for the Developer Portal app in the search box, once found open it and navigate to the App studio tab.

  2. In the app studio tab click on the button Create a new app

  3. Enter all the necessary details for the app as in the below image

  4. So now for the MS Teams app we need to create an azure hosted bot. This bot will be linked to the SAP CAI Chatbot. Do follow images to setup the bot.

  5. During this next few steps, we can see the App ID, for password do click the Generate password button. We will also get the messaging endpoint URL which needs to be maintained in the Azure bot as bot endpoint address. These three details are important for integration of the CAI chatbot with the Azure bot.

  6. Open the SAP CAI chatbot in the SAP conversation AI portal and click on the connect tab

  7. Select the third party channel to be added for us we will go with Teams via Azure

  8. Enter the App ID and password and click on the connect button

  9. Once done a Messaging endpoint URL will be generated, copy it and maintain at step 5.

  10. In the MS Teams azure bot, download the package

  11. In order to test the bot in MS Teams, create a Teams Team for the same we have created Innovative Tech Lab Team. In the team go to Apps tab and click on Upload a custom app link to upload the package downloaded in step 10.

  12. Once done a popup with add button will be diplayed, click the Add button.



Test The chatbot


description text


 

Conclusion:

We are done with the High level Architecture overview in this blog post, It’s time to get into action. We will come up with follow-up blog posts very soon.

Feedback :

Thanks for taking your time to go through this article, we hope you liked the content. We would appreciate if you can spare few minutes to leave us feedback on your experience.
1 Comment
Labels in this area