Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
sudipghosh
Active Contributor

Introduction


Hey there, fellow techies! As businesses continue to rely on technology for growth and success, it's time to shake things up with some ChatGPT magic!

We've all heard the same old stories - developers using ChatGPT to generate code, script writers churning out viral content, copywriters producing content at lightning speed. But what if we told you there's a new way to use ChatGPT that'll blow your mind?

As someone from a SAP background, I knew I had to do something totally epic with this technology. And guess what? I did! But don't worry, it's not another ABAP code - we're way too cool for that!

By integrating ChatGPT with SAP S/4HANA, we can revolutionize the way businesses operate. We're talking natural and efficient communication that saves time and increases productivity. It's like having a secret weapon that'll take your business to the next level!

So, buckle up and get ready to discover how ChatGPT integration with SAP S/4HANA can change the game. It's time to think outside the box and embrace the endless possibilities of this amazing technology!

Business usecase


Picture this: You're a supplier and your inbox is overflowing with emails about purchase orders. Your customer support expert is slogging through the SAP system like a snail on a rainy day. It's slow, it's tedious, and you're ready to pull your hair out!

Well, hold onto your hats, folks, because ChatGPT integration with SAP is here to save the day! Say goodbye to tedious manual tasks and hello to relatively automated fast responses. It's like giving your business a shot of espresso straight to the veins!

 

You might be thinking, "what big deal, Isn't he just a chatbot crap trying to sell?" But creating a chatbot for SAP requires a relatively more development, including training the bot with intent, developing different skills, and testing it extensively. It can be a time-consuming and expensive process.

 

That's where ChatGPT integration with SAP stands out. With good prompt engineering, you can use ChatGPT to generate  context in JSON format from customer queries which could be used as input for API and seamlessly integrate with the SAP system to retrieve infortmation in JSON/XML format and generate meaningful text from that JSON/XML. In just two hours, you can have a fully functioning customer support system that can respond to queries with meaningful replies over email.

It's generative AI at its best. Instead of relying on traditional chatbot type development, you can harness the power of ChatGPT and SAP integration to make your business more efficient and productive. The possibilities are endless, and it's just one example of how technology can transform the way we do business.

 

Technical Architecture



 

 

Listen up, folks! If you want to integrate ChatGPT with SAP S/4HANA, you're gonna need some important tools in your arsenal:


First up, we've got Azure Logic App - the cloud-based hero that'll help you develop the integration between ChatGPT and SAP S/4HANA. This thing is like the Robin to your Batman!

But wait, there's more! You'll also need an OpenAI ChatGPT API key - it's the key that unlocks the magical ChatGPT model that makes everything possible.

And let's not forget about the SAP S/4HANA system itself. This is the big boss that holds all the important info, so make sure the Standard Sales Order API is properly configured in the S/4HANA system.

Now, things start to get a bit technical, so bear with me. You'll need to install the SAP Cloud Connector in the same network as the SAP S/4HANA system. It's like a secret agent that'll establish a super secure connection between the SAP S/4HANA system and Azure Logic App via SAP API Management.

Last but not least, we've got the SAP API Management. It's like the bouncer at the door, making sure only the cool cats get in. It's part of the SAP BTP Integration Suite and will help you develop a wrapper API on top of Standard Sales order API that can be accessed from Azure Logic App.

So, there you have it, folks! With these tools in your utility belt, you'll be ready to take on the world of ChatGPT and SAP integration like a boss!

 

Alrighty, folks! It's time to connect the dots and get this party started!


Step 1: Activate SAP Sales Order API in S/4HANA , get some inspiration from this official sap help document.

Step 2: Test the odata service in Postman


Step 3: Install and configure SAP Cloud Connector, there are many blogs which covered this topic but i am dropping here the link of official sap help documentation.

Step 4: Consume S/4HANA OData API in SAP API Management follow this blog.

Step 5: Test ChatGPT to generate JSON from from customer query

I have observed in Azure Logic App email body get stored as html text rather than normal one, but not to worry ChatGPT is quite powerful to extract the context and put into JSON form without any problem


Step 6: Test ChatGPT to generate meaningful email from SAP API Response



Step 7: Get a API Key and Try out the ChatGPT Latest Model turbo via Postman

Login to OpenAI Platform,Navigate to API Key section in Account and Create API Key Secret


 


More details about ChatGPT API Usage could be found in their documentation page

Step 8: Build a Integration flow using Microsoft Azure Logic App



For all the noobs out there who are curious about Azure Logic App, listen up!

Azure Logic App is like having a magic wand that can connect all your apps and services. It's like having the ultimate Swiss Army Knife for integration, with the power to connect different apps and services in ways you never thought possible. Need to connect your CRM with your email marketing tool? Azure Logic App has got your back! Want to link up your inventory management system with your shipping provider? Easy peasy, Azure Logic App can wave its wand and make it happen!

And the best part? You don't need to be a tech wizard to use it! Azure Logic App gives you a drag-and-drop interface that makes it super simple to build your integration workflows. So even if you're a noob, you can bring all your apps and services together like a boss!

So don't stress about integration - let Azure Logic App be your integration wizard in the cloud, ready to make all your integration dreams come true with just a wave of its wand!

Microsoft created this amazing documentation from where i have also learnt to build Integration using Azure Logic App


Check out my Azure Logic App workflow - it's like a digital Swiss Army Knife, connecting all my apps and services in the most magical ways!


Last but not least I've unleashed my epic Azure Logic App project template onto the world of Github, like a fire-breathing dragon breathing its fiery code. But don't worry, it's easy to tame - just download it from my Github lair and import it into your Azure Logic App like a fearless knight on a noble quest!


Drumroll, please... it's time for the grand performance, the show-stopping, jaw-dropping, demo time!




Alright, folks, it's time to wrap this bad boy up with a bow on top! We've covered everything from snails on rainy days to fire-breathing dragons, and I think we can all agree that ChatGPT and SAP integration is the shot of espresso our businesses need. So don't be a snail, embrace the power of ChatGPT and SAP, and let's revolutionize the way we do business! And hey, before you go, don't forget to share this blog with your friends and colleagues. If they don't like it, tell them it was a viral marketing experiment gone wrong.

** I understand how valuable it is to have practical demonstrations when learning new concepts, and this blog is designed with that in mind. We're utilising the public version of ChatGPT in this instance, purely because the Azure Open AI service wasn't accessible for individual developers at the time of writing this blog. I appreciate your understanding on this.


However, I'd like to emphasise that for real-world, enterprise-level applications, it is essential to employ a dedicated Azure Open AI service instance. This is vital not only to address and uphold the principles of the General Data Protection Regulation (GDPR) but also to ensure other security measures are effectively in place. It's all about safeguarding your data and ensuring the integrity of your applications, and we take this very seriously. Thank you for your understanding and support.


Also very important to know this blog doesn't cover email authentication and authorization. In Part 2, I'll show you how to handle it, and it should be included in the general template. Heaven forbid I should suggest that anyone ship this blog to production without making the necessary adjustments themselves!

There is also interesting Blog  by neu-mark_ma  on this topic, You might be interested to have a look.
64 Comments
joshiparth151
Explorer
0 Kudos
This is supercool!
0 Kudos
I think the focus seems to have been diverted into the security aspects. There is enough precedence currently of companies sending out even sensitive HR data to partner companies. The guy has only done a technical proof of concept of what things need to be done to technically integrate SAP to the GPT models. Having said that, I have a question for sudip.ghosh4 .

The capability of chatGPT you are trying to demonstrate here is not fully clear. Are you saying that chatGPT will search for the PO and sender values from any email and that the mail does not have to be in a specific format? And the response email too might not always be containing the exact same static content but will surely make sense to a human reader?

The blog is very good, but it might not be hitting home the point on what additional value this integration with GPT and S4 is bringing as per this demo. Or was your intent only to show technical integration steps?
MarcoHoepner
Explorer
At 05.05.2023 there was an online event sponsored by DSAG in cooperation with Mircosoft and SAP.

The title was "Online-Session: DSAG-Academy Online-Session: "Introduction to OpenAI: How AI-based technologies can improve business processes and accelerate transformation".

In this session Microsoft and SAP have introduced the new Azure Service called AZURE OpenAI.

Maybe the AZURE Service Azure OpenAI ("https://azure.microsoft.com/de-de/blog/chatgpt-is-now-available-in-azure-openai-service/) is a solution for the GDPR requirements.

Best Regards

Marco
sudipghosh
Active Contributor
0 Kudos
I understand your perspective: email content doesn't need to follow a specific format, and the process of extracting meaningful information from it is known as Information Extraction. Generative AI models have the potential to not only extract information accurately but also produce meaningful outputs that can be directly utilized. Another way to achieve this is by training a custom NLP machine learning model and using a small program to convert the extracted values into a JSON format for further processing. But effort wise would be much more compare to this and also need a conversational AI expertise. There are countless applications for this, such as generating base integration mapping sheets directly from platforms. While the developer version of OpenAI has been used in proof-of-concept demonstrations in this blog, enterprise use cases would benefit from a dedicated Azure OpenAI dedicated instance to ensure security risks are mitigated.
GJASPALADL
Participant
0 Kudos
Can't agree more.
sudipghosh
Active Contributor
0 Kudos
I completely understand the importance of GDPR-related security concerns, and indeed, the Azure Open AI Dedicated Instance is a solution for all these issues. When I initially wrote the blog, this instance was not available for developers, hence I demonstrated the technical steps using the Open AI public instance. Nonetheless, it's crucial to note that it still falls within the Azure infrastructure.

Microsoft has been kind enough to confirm this information after reading my blog. I am now planning to update the blog or write a new one to include the use of Azure Open AI. I'm eagerly awaiting the release of the developer instance in Azure Open AI. As per my latest discussion with Microsoft, at present, this is only available for Enterprise Accounts.
rajeshps
Participant
0 Kudos
sudip.ghosh4

Really a great blog and lot of stuffs to read and implement. I wanted to perform a poc of this. I'm puzzled what will be the starting point 🙂 😄

 

Also I wanted to check if this can be achieved vi SDI with AI and ML capabilities / python libraries ?
a_hariharan
Member
0 Kudos

Hi SudipHcp,

I Hope you are well.

I am following your Flow and doing ChatGPT Integration with SAP S/4HANA in PowerAutomate, you have done an Amazing job. I am new to PowerAutomate, And this is my first task. Your Flow Looks verygood but the values it uses internally are not correctly understood,
I humbly request you to Please Explain Clearly, It is better if only the values used internally by the flow are available your help is greatly Anticipated.,

Thanks & Regards

RajaGopalan
Participant
Great work!  You can check out this finished product as well, based on the ChatGPT API for SAP at:  https://ai4erp.onlinegbc.com.  Thank you,
shivamshukla12
Contributor
0 Kudos
Yeah really good point -- Adaption is super important that's where we should look for --- Utilize open source and make S.4 More smart than ever.

 

 
0 Kudos
Hi Guru,

 

This blog is excellent and explained  usage of chatGPT in coding . Can we use ChatGPT in Functional consultancy ? if yes how ?

 

Regards,

 

Praveen
0 Kudos
Hi,

I am trying to fetch PO details for a single PO number while consuming odata service in sap api enterprise business hub, I have passed the po number in the parameters shown in below screenshot but I am getting as po number does not exist.


 

https://<HOST>:<port>/cd4135fctrial/PurchaseOrderSet/PurchaseOrderSet('{PoNumber}')

Jay2
Product and Topic Expert
Product and Topic Expert
0 Kudos
sudip.ghosh4 thanks for sharing. Got late on this post but still relevant for me.
Frank1
Participant
0 Kudos
Great blog and so much need to learn. Thank you.
Labels in this area