Skip to Content
Author's profile photo Meet Vajaria

Chatbot on S/4 HANA (Google Assistant and SCP)

This is the 1st blog I am writing. Please have some mercy 🙂 .

I was attending courses on openSAP for SAP HANA Cloud Platform and exploring it to get the best out of it. So I created few chatbots by end of the last year. This is before SAP acquired .

For this blog, I have created chatbot for Overdue accounts. We can ask chatbot about overdue accounts for particular customers. If there are customers with the same name, we can provide city as well. We can also send the Statement of account to customer via Email.

The Chatbot follows MVC concept. So here it goes –


  1. Dialogflow (by Google) – View – Face of Chatbot

Dialogflow serves NLP which we need to build the chatbot. It has all the necessary NLP components like Intents, Entities, Fulfillment and most importantly, Integrations with Google Assistant, Facebook, Skype, Alexa; which makes chatbot easy-to-use and interesting.

  1. SAP Cloud Platform (by SAP) – Controller – Handles and connects View and Model

SCP provides so many services and APIs. Using SCP, It is really convenient to connect to SAP ERP, S/4 HANA On-Premise and S/4 HANA Cloud.

I have created JAVA Application and deployed on SCP. The Java Application interpretes the request from Dialogflow and accordingly forwards it to SAP Systems. Here we can call APIs provided by SAP and enhance functionality of Application accordingly.

  1. SAP System (by SAP) – Model – Executes Database / Process Logic

SAP Systems can be connected to SCP via Cloud Connector. For that, we have options to communicate with Systems via HTTP or RFC. We can use HTTP for OData services and RFC to call BAPI and RFC-enabled Function modules.

I have created custom RFC-Enabled Function modules that have all the necessary logic based on the request from SCP.


Lets deep dive into Implementation.


The OverdueAccounts chatbot is deployed on Google Cloud. Via Google Cloud, we can assign chatbot to other users easily.

  • Intents – There are 3 main intents. DisplayOverDueAccounts will provide Overdue account data. SendStatement will send statement to customer. Help intent will show some sample queries.


  • Entities – Entities like Account, Customer and City are created with synonyms to construct wide range of words for Chatbot NLP.


  • Fulfillment – Here goes the url for Java Application. Dialogflow will send POST request on this URL.


  • Integration – We can integrate the chatbot with Google Assistant, Skype, Alexa, Facebook, Twitter and so on. I have integrated with Google Assistant.



  • Java Application – Java application has been deployed on SCP which has all the logic that should be called on SAP System when It gets request from Dialogflow. For eg. When DisplayOverDueAccounts intent has sent the request, call RFC Function module ZDisplayOverDueAccounts. When SendStatement intent has sent request, call RFC Function module ZSendStatement.


  • Cloud Connector – I have added SAP System to SCP via cloud connector. I have exposed only necessary Function Modules for security reason.


SAP System

  • Function Modules – I have created 2 RFC-based Function modules which will do all the work in the system and return the data to Java Application.  These 2 Function Modules have functionalities of Transactions FB12 and F.61 .


Here is the video of Overdue Account Chatbot.

Chatbot also talks (as the name suggests 🙂 ). In Overdue Account information response, it tells only final amount instead of speaking every detail shown in screen. That makes it even cooler.


Video Description :

1st, I am showing Business Partner and its Email address. There are no Email in SOST.

2nd, Communication with Chatbot for getting Overdue Accounts Detail and then Sending the Statement to Business Partner.

3rd, Chatbot has sent Email to Business Partner that we can see in SOST.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Moya Watson
      Moya Watson

      Very nice -- thanks for tying this together! I'll even forgive you for calling it "SAP HANA Cloud Platform" since you may have taken those courses way back before our name change:)

      Hope this is far from your last post!

      Author's profile photo Anton Orlov
      Anton Orlov

      Hello Meet,

      congrats with your first blog here!

      On the architecture picture you mentioned HANA DB inside SCP. For what purposes did you use it in this scenario?


      - Regards,


      Author's profile photo Meet Vajaria
      Meet Vajaria
      Blog Post Author

      Hi Anton,

      On Trial version of SCP (P-Trial), We don't necessarily have to connect On-Premise or S/4 HANA Cloud System via Cloud Connector. We can directly create Databases and Schemas under "SAP HANA / SAP ASE". These Database instances are HANA DB. So we can use these Database Instances in our Java Application.

      This option is freely available only in Trial version.




      Author's profile photo Nabheet Madan
      Nabheet Madan

      Congrats Meet Vajaria for the great blog.  It will be great if you can also share the sample code so that if some one wants to implement at his/her end it will help them.