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
Syedwahab93
Explorer
Awesome Content.
satishgunda
Product and Topic Expert
Product and Topic Expert
Great work, Well explained!!
DominikTylczyn
Active Contributor
Cool one!
mark_ma
Product and Topic Expert
Product and Topic Expert

Nice Blog!

As an extended reading for our readers. How SAP RISE PCE customers can use SAP solutions to manage user access workflow and security for ChatGPT. Enjoy 🙂
https://blogs.sap.com/2023/02/14/empower-sap-rise-enterprise-users-with-chatgpt-in-multi-cloud-envir...

PierreCol
Product and Topic Expert
Product and Topic Expert
Thanks for this interesting blog post, Sudip.

I just would like to add that any SAP customer can use ChatGPT with S/4HANA, for sure, at his own risks... but sharing end customer personal data to write an email is tricky, for countries ruled by GDPR. What if ChatGPT collects and store all of these data to nurture some algorithms?

Feel free to read more on GDPR from SAP.


brahms86
Active Contributor
Apart from the superb solution it is the most entertainingly written SAP blog post I have read so far!

Just wonder what the equivalent tool in the SAP product world that could take the role of Azure Logic App? Isn't there some process orchestration solution as well?
Sergiu
Contributor

I would rather ask to generate a Python code based on anonimoysed data, include a test unit and adapt the code to different scenarios. The code provides more capabilities and absolute control over the content. 

grafs
Explorer
Great use case and fun to read! Thanks for your work and sharing!

Let's just hope the customer does not respond aggressievly and the ChatGBT responses are getting more and more threatening, like i will kidnap your google home setup!   😉

 
S0019992647
Advisor
Advisor
Very interesting Blog Post. I rarely comment but here I had to.
aanumula
Explorer
0 Kudos
Wow... Thanks for sharing it.
BojanDobranovic
Product and Topic Expert
Product and Topic Expert
SAP solution is called SAP Build Process Automation (SAP Build Process Automation | Product Features). In this scenario SBPA actions can encapsulate S4 API so you can skip part with Integration Suite API Management (please note that this part of skipping "IS" is just related to this demo/example, Integration Suite is a vital component for enterprise integrations and API strategy).
0 Kudos
Good one and explained well:-)
NeeleshJ
Advisor
Advisor
0 Kudos
Interesting blog.  thanks for sharing. 👍
RedMonster_Vjay
Explorer
0 Kudos
Excellent! digital innovation Espresso !!

Thank you for sharing.

 

 
showkath_naseem
Product and Topic Expert
Product and Topic Expert
I agree with pierre.col  your observation that ChatGPT has become a versatile tool with various applications across industries. Customers, partners, and software professionals are leveraging ChatGPT's capabilities with S/4HANA or any other SAP product. However, it is important to be mindful of the potential risks associated with its use. While ChatGPT can assist with tasks such as generating emails, creating knowledge base articles, answering questions, transforming data into specific formats, generating test cases, providing software source code support in any programming language, and preparing user guides, it is crucial to exercise caution when sharing sensitive or personal data, especially in countries governed by GDPR regulations. To provide more insights into these concerns, I have written a blog post that delves deeper into the topic. I believe it may be informative for you, so please give it a read and let me know your thoughts.

KR,

Showkath.
nitindeshpande
Active Contributor
0 Kudos
As always great content again from you !! Loved the way you articulated it.
VenugopalA
Explorer
0 Kudos
Interesting blog & scenario was good to current processes! Thanks for your blog and sharing!
Ryan-Crosby
Active Contributor
The GDPR piece is quite huge, and beyond that there are other considerations regarding verification that Sudip is truly Sudip, and has rights to the information that has been requested.  The potential for abuse here is a Pandora's box that I wouldn't want to open.
marco_hammel2
Participant
Hi Sudiph,

I appreciate the innovative approach you proposed. However, aside from the mentioned GDPR issue, I'd like to emphasize that such an implementation exposes security risks for making the application act as a SPAM relay or for the disclosure of customer data.

The application misses the elementary principles of a secure application design. First and foremost, proper input validation and context verification.

BR

Marco
Ryan-Crosby
Active Contributor
0 Kudos
I’m confounded by the predilection for awe and marvel towards the act of technological creation, in such a manner that suggests that the act itself is the end goal. What happened to taking pause to contemplate if the act should be undertaken at all, or giving consideration for whether the final product has any semblance of usefulness?

Beyond the obvious potential encroachment of security and privacy concerns, and the fact that email is probably the most abused form of digital communications today, there is also the question of trust. Below is an excerpt that only took a couple of minutes and a handful of attempts to produce because the initial responses focused too much on toppings. A half-wit could’ve produced a more reliable answer.

If I am hungry and looking to satiate myself and am really in the mood for pizza, am I better off eating a pizza made up of 6 slices or one made up of 8 slices if they have comparable toppings?
If the pizzas have comparable toppings, then it may be better to choose the pizza with 8 slices, as it will provide you with more total food to help satiate your hunger.

Now the question of usefulness… one wouldn’t have to look far to find an alternative that unwinds the timeline paradox that is born of the fabricated use case scenario. Some person(s) expending minimal effort to enable automated shipment notifications in SAP S/4 HANA via email, managed to metamorphose the message sender into a message recipient. Hardly an unusual expectation in any industry for such a feature to be configured.
sudipghosh
Active Contributor
0 Kudos

Hey Marco! It looks like the flow checks for PO status related emails only, but won't respond to anything else. I totally understand your concerns about GDPR compliance, and you're right. on this hashing technique could be a solution. Instead of giving ChatGPT the actual customer info, we could send a hash value instead. It's a quite easy fix with some simple Javascript magic!

Not only that, but this could actually create an opportunity for others to create a plug-and-play solution to tackle GDPR compliance. It's always important to consider different perspectives, so thank you for bringing this up. And just for an example, let's say that instead of sending

{"customer" : "Marco"}, we could send something like {"customer" : "276HBG6"} to get the email reply and replace the hash with correct value before sending.

sudipghosh
Active Contributor
Hey Pierre, I totally get where you're coming from with your concerns about GDPR compliance. It's important to keep our customers' information safe and secure, and hashing could be one way to do that! Instead of sending ChatGPT the actual customer info, we can send a hash value that's totally scrambled and unreadable. And the best part is, it's super easy to do with some simple Javascript magic!

And you know what else? This  could actually create an opportunity for others to create a plug-and-play solution to tackle GDPR compliance. So thank you for bringing this up and for considering different perspectives. And let's just say that instead of sending {"customer" : "Pierre"}, we could send something like {"customer" : "9826HBG6"} - it's like we're playing a little prank on ChatGPT by making it work a little harder to figure out what's going on.
sudipghosh
Active Contributor
0 Kudos
I understand where you're coming from and appreciate your concerns. The example given is just one way to use this technology, and of course, there are many other methods to achieve the same result. The idea behind this blog is to showcase different possibilities and inspire creativity.

I think you might find an interesting article on Forbes that talks about how Shopify is planning to use technology in a unique way. And the best part about using generative AI is that we can always ask it to write a reply in a respectful and empathetic manner, which is so important in customer service.

Regarding GDPR compliance, hashing is definitely one way to ensure that customer information remains safe and secure. Instead of sending actual customer info to ChatGPT, we can send a scrambled hash value, which is very easy to do with some simple Javascript magic! For example, instead of sending {"customer" : "Ryan"}, we could send something like {"customer" : "276U5BG6"} and then replace the hash with the correct value before sending.

Also, I wanted to mention that Algolia, the most widely used product search engine for ecommerce customers, is using ChatGPT. It's amazing to see how technology can be applied in different ways to create better experiences for customers.
Ryan-Crosby
Active Contributor
0 Kudos
I'm not particularly concerned with what other people or companies are doing, and I'm not going to undertake an activity simply for the sake of integrating with ChatGPT.  If other companies are prepared to adventure into the ChatGPT space, then so be it, and best of luck to them.  What I have seen thus far is boundless reactionary excitement without any real thought about implications - I'm not jumping in while everyone else is because I don't care what everyone else is doing.  The normal process is to identify a problem and work forward to a solution while evaluating many alternatives.  What you have done here is find a solution and work backwards to an invented problem.

Your proposal regarding GDPR also only addresses the technical aspects related to privacy, but overlooks other potential problems as I noted in another reply above.  How do we know Sudip is actually Sudip, and how do we verify that Sudip has access rights to the information that has been requested.
sudipghosh
Active Contributor
0 Kudos
Oh, how absolutely thoughtful of you mate to inquire! It's just common sense, really - when building an enterprise chatbot or conversational AI, one simply must ensure that authentication and authorization are properly in place. This is very similar to implementing enterprise chatbot, But heaven forbid I should suggest that anyone ship this blog to production without making the necessary adjustments themselves! I have faith that people are intelligent enough to figure out how to finetune things themselves (authentication, and authorization, no biggie).And if anyone does decide to use this little blog, they'll need to roll up their sleeves and tackle those pesky building blocks of authentication, authorization, and GDPR on their own. But don't worry, it's just a one-time activity in general template with correct strategy, and I'll be covering it all in Part 2. Who doesn't love a good sequel, right? So in Part 2, we'll be delving into the authenticating email addresses against a particular information and generating responses that deny access to said information if the authentication and authorization standards aren't met. And of course, And if you happen to come across any other issues, well, I'm positively itching to hear about them. Because really, who doesn't love a good challenge?
Ryan-Crosby
Active Contributor
0 Kudos
Interesting that you are calling it a chatbot now, but your blog is about email exchange... you do realize those are two entirely different things right?  Don't worry... you'll get a pass on part II because you can't bother to address any of the obviously itchy topics in part I.  You managed to solve a problem that does not exist, and you have delivered a solution that can be fooled by a stupid question about pizza.
sudipghosh
Active Contributor
0 Kudos

Dont you think its a another conversational system, the only difference is when you build enterprise specific conversational system you train the model and build particular skills which get trigger based on intent and it execute the microservice to get info and display it. But here we are using it for generating context instead of training and building bot. But end of the day its a conversational system we are trying to build. In any enterprise conversational system when you integrate with any channel like whatsapp telegram ms team , you need to build additional layer to handle security, so here it is also not an exception. I never said it’s a chatbot though,  please read properly the complete comment.

cneuhaus
Member
Hi Sudip,

thanks for your post - like it a lot. With the simple API there are many ways to integrate this type of KI into SAP S/4 Hana or even ECC.

I checked the understanding of ChatGPT on data-models to write an invoice or show a P&L statement - here I would envision a KI with world-knowledge and additionally trained e.g. on a BW Reporting Layer,

You can follow the "experiment" here: How ChatGPT is changing the game of Data Analytics - not thought through -just a starting point.

 
marco_hammel2
Participant
Hi Sudip,

According to how the implementation is described here, Anybody who can send emails to the inbox can:

- Enumerate purchase order numbers and (maybe) respective customers (in case of non-existence, there they'd receive an error message. In case of success, they know about the existence of the PO)

- Additionally can get information on purchase orders they're not permitted to see, as there is no validation if the sender email address used for the response belongs to the business partner of the PO. See, you get the receiver email address right from the received email without any validation. As already mentioned, because the "from" field in an email is completely user-controlled, this can be used as a SPAM relay too. This can destroy the email reputation of an organization providing such an interface within hours.
"inputs": {
"variables": [
{
"name": "email_sender",
"type": "string",
"value": "@triggerBody()?['From']"
}
]
}

 

I'm not even talking about exploit vectors such as insufficient email sender validation by the mail server or about possible prompt compromises to fill a single email with thousands of name and purchase order combinations in parallel emails to create a denial of service scenario for the SAP backend.

Exploiting this is as simple as 5-liner in a bash script to send emails to the address with an incrementing number of purchase orders in a loop.

As a former developer, I can only advocate that we all need to get better at understanding threats and becoming good in the fundamentals of application security.

Thanks

Marco
showkath_naseem
Product and Topic Expert
Product and Topic Expert
Hi sudip.architect ,

 

Thanks for sharing nice blog post. Did you also get chance to go through  blog post that delves deeper into the security topic as general topic (not limited to SAP) . I believe it may be informative for all enthusiastic ChatGPT Users,Developers , so please give it a read and if you like spread the word.

 

Thanks,

Showkath.
PierreCol
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Steffen,

Feel free to read this overview on process / task automation in an SAP context: "The Way Ahead with Hyperautomation"




To move forward, feel free to engage with our product experts and process automation practitioners in our SAP Community topic page!


You will find tons of examples of SAP Build Process Automation extending SAP S/4HANA, SAP SuccessFactors, SAP Ariba etc.
PierreCol
Product and Topic Expert
Product and Topic Expert
Oh, and if you are interested in cow eggs, ChatGPT can help you, very seriously 🙃

 



Ryan-Crosby
Active Contributor
0 Kudos
Even better than my query on slices of pizza above... definitely need to integrate with it.
sudipghosh
Active Contributor
The model you are using, thats old model i belive. Its legacy


 

With GPT 3.5 better Answer


 

And with GPT 4 even better, very concise


 
sudipghosh
Active Contributor
0 Kudos
Going to give a try on this weekend. Thanks for sharing
sudipghosh
Active Contributor
0 Kudos
Thanks for sharing i am going to read your article on this weekend and share the feedback.
sudipghosh
Active Contributor
This is in GPT 4 Model


 

 
Ryan-Crosby
Active Contributor
0 Kudos
Only because the new model was released today, and even then, there will be examples where it will bomb gloriously.  You still haven't managed to deal with anything regarding email and attack vectors that Marco has spelled out in great detail, and you still solved a problem that doesn't exist... but congratulations on that.
sudipghosh
Active Contributor
0 Kudos
Oh, please, let's not kid ourselves. I'm not here to sell anything, and community projects are just a fun pastime for me. But it's painfully clear you're utterly lost when it comes to creating enterprise conversational systems with proper authorization and authentication, which is why my comments are light years beyond your comprehension. Had you ever dipped even a pinky toe into the world of enterprise-level systems with legit authorization and authentication, you'd grasp my point in a heartbeat. This blog is all about showcasing the magic of generative AI in these systems, but it could be applied to any communication platform. Then again, why bother explaining this to a someone who's never even come close to crafting a single enterprise conversational system?
sudipghosh
Active Contributor
Indeed, it is crucial to implement security practices akin to those used in the creation of any enterprise conversational system. In Part 2, I will be offering some guidance on this matter. I kindly request your patience until then, and I would be grateful if you could share your feedback once it is available. Thank you for your understanding.
Ryan-Crosby
Active Contributor
0 Kudos
Nice try pal 🤣
GJASPALADL
Participant
0 Kudos
I am glad I saw your post. I was about to reply OP saying SAP will not like the idea of using ChatGPT and/or Azure logic apps. They would ask to use the BTP AI services, Build automation and integration suite. 😄
PierreCol
Product and Topic Expert
Product and Topic Expert
0 Kudos

May be the ChatGPT playground provided by SAP AI could be updated with GPT-4?

Indeed, I just asked:

"What is better, cow eggs or chicken eggs?"

and I got this answer:

"This is a matter of personal preference. Both cow eggs and chicken eggs have their own unique flavor and texture. Cow eggs tend to be larger and have a richer flavor, while chicken eggs are more common and have a milder flavor. Ultimately, it comes down to what you prefer."

 

 

aamitlal
Explorer
0 Kudos
Hi Sudip, solid article, as usual, my friend! Cheers!
shivamshukla12
Contributor
0 Kudos
As always a great content i see with great Presentation the Good thing is - you see it differently & am amazed to see & thinking where else this Natural Language processing can help.

 

You know everyone out there got so many ticketing tools for different problems - As i see with Client consent this can really do wonders --- Unattended mode.

 

Thank you for sharing this beautiful content Sudip.

 

Thanks - Shivam
joao_sousa2
Active Contributor

They may not like, but the reality is that customers use other tool vendors. As SAP consultants we can’t be funneled into a “just SAP mindset” otherwise we may miss out on making SAP solutions like S/4 shine. In many customers there is this idea that SAP is closed which only hurts them at the end.

aamitlal
Explorer
@ pierre.col Pls check again! The exact same question I asked, is responded to below by GPT-4, 3.5-turbo both, stunning answers! trained these models to support 🙂

Answer >Cows do not lay eggs. Only birds and some reptiles lay eggs. Chickens are birds and they lay eggs that are commonly consumed by humans. So, in this context, chicken eggs would be the only option for consumption.

Just to connect with an audience who shares similar interests on this topic - I recently published a tech. article discussing various technical scenarios where Azure OpenAI and SAP can be leveraged in the future.

Unbelievable Whiteboard Scenarios for SAP S/4HANA & Azure OpenAI -MSFT-SAP

Cheers,
Amit Lal
pkar036
Advisor
Advisor
0 Kudos
Nice blog, well detailed on the process...However i have a question on the very need of chatgpt with the usecase you have chosen.. Kindly correct me if my understanding is incorrect.

Its a standard document, with finite fields. So it leads to finite scenarios of discrepancies or miss out on data from suppliers.

What is that hyperautomation cannot do that chatgpt will solve in this scenario you have chosen?

If errors are limited and are already accounted for by the product testing teams, what more generative narratives we would need and why ?
Shakeel_Ahmed
Product and Topic Expert
Product and Topic Expert
0 Kudos
Awesome blog. I am sure with it people will get inspired to bring lots of new ideas on the table for practical use cases in SAP and outside SAP.
Saurabh
Explorer
0 Kudos
pierre.col

ChatGPT playground provided by SAP AI  : this is not very responsive . It generates code much better than Open.AI but it does not consider suggestions to correct the code once it builds. Am i missing something.
Labels in this area