Rumble in the Jungle Round 1: Using OpenAI ChatGPT to Automate SAP SAC Script Code
Meet the Authors
Key Takeaways
⇨ SAP's cautious approach to integrating AI tools is crucial to maintaining security and financial stability for large corporations while ensuring that new innovations do not compromise valuable data.
⇨ AI chatbots, including OpenAI ChatGPT, can assist in SAP development processes, but their effectiveness requires human validation and troubleshooting to ensure code reliability and functionality.
⇨ Despite rapid advancements in AI, including tools like SAP Joule and OpenAI ChatGPT, the performance of AI chatbots can vary significantly, emphasizing the necessity of ongoing human interaction for optimal outcomes.
The past two years have ushered in an unprecedented wave of innovation across machine learning, AI, statistics, and simulation—bringing my college dreams to life. At the same time, Silicon Valley has long viewed SAP and ERP systems with a mix of envy and frustration. The sheer complexity of these systems, combined with SAP’s unwavering commitment to quality and security, sets them apart. Unlike many open-source integrations, SAP takes a measured and highly cautious approach to AI, ensuring that new tools do not compromise the financial stability of the world’s largest corporations.
As computing power continues to advance, future migrations will likely become far more seamless, perhaps even fully managed by AI agents. And who knows? With technologies like Neuralink on the horizon, the remaining human workforce might one day be directly connected, allowing AI to not only automate processes but also tap into managers’ thoughts, training them in real time and extracting whatever insights it needs.
That said, as members of the SAP community, we understand the ongoing concerns about SAP’s pace compared to other tech giants. However, this slower approach is intentional—driven by the need for enterprise-grade security. Integrating open-source AI agents or chatbots into business systems without proper safeguards can introduce serious vulnerabilities. Hackers understand SAP powers some of the world’s most valuable companies, making these systems high-value targets. As AI adoption accelerates, a poorly implemented chatbot could serve as an entry point for cyber threats, potentially exposing sensitive corporate data—such as next-quarter forecasts—through unauthorized access or data leaks. In this high-stakes environment, SAP’s cautious approach isn’t just prudent; it’s essential.
Explore related questions
AI advancements are evolving at a rapid pace, with innovations from ChatGPT, Deep Seek, Nvidia, Broadcom, Claude, Google Gemini, Grok3, Amazon AWS, Jasper, Microsoft Copilot, Meta AI, Zapier Agents, O9, n8n, and more. SAP is also making significant strides with SAP Joule, an upcoming AI tool designed for the SAP Cloud and S/4 HANA environments, offering capabilities like leading AI chatbots. Notably, SAP SAC has leveraged augmented analytics for years, enabling users to generate reports and visualizations simply by typing commands like, ‘Show me the sales for Company A over the past year.’ Furthermore, SAP’s Q1 2025 announcement of AI solutions developed in collaboration with Databricks signals a transformative shift, unlocking new possibilities and innovations within the SAP ecosystem.
However, just like humans, AI agents vary in performance. These tools are built by people and, in some cases, by AI agents themselves. Some AI chatbots excel at specific tasks due to more advanced algorithms or more comprehensive training, while others may struggle with certain tasks due to limitations in their training or available knowledge which means it just cannot do it efficiently or cannot do it at all. With the media frenzy surrounding AI—fueled by influencers, journalists, and anyone with a YouTube channel—not to mention stock market swings driven by AI trends, it’s easy to get caught up in the hype. However, it’s crucial to remember that AI, like any tool, has its limitations. Just as some people excel in music or painting while others do not, AI chatbots also vary in their strengths, with some performing significantly better than others depending on the task at hand.
In this article, I’m putting several AI chatbots to the test. Some of their companies are SAP clients, and some have been our clients too, which makes an interesting comparison since we know the corporate cultures and sometimes words do not mean quality in the final product, and as SAP users we know testing is the key to our business. To be clear, this is not a paid promotion in any way, but like many of you, I’ve often wished for an AI chatbot like SAP Joule is expected to be—something that could help streamline the coding process and accelerate delivery for clients as of Q1 2025 is in early stages in any SAP development effort, but as this article will show testing and human interaction might also be required so please do not fire all your SAP development help desk just yet.
AI chatbots promise to make code changes more agile, simpler, and faster, with many claiming to seamlessly handle tasks like coding in SAP ABAP, SAP ABAP Cloud, SAP HANA Script, SAP SAC, SAP Script, debugging, and even—perhaps—finding the cheapest eggs in town, all at lightning speed and do not worry does not matter what they say you “human” you just don’t get it. While a well-trained large language model (LLM) is undoubtedly invaluable, integration with SAP remains a challenge at the time this article was written in Q1 2025.
For instance, SAP SAC’s integration with Analytic Applications and custom widgets allows for tools like ChatGPT to interact with SAP SAC—a feature that, while not new, is still exciting that requires custom widgets in SAP SAC without even reviewing the different options ChatGPT claims that it will work as well. Other tools, such as SAP IBP, could significantly benefit from AI to provide end-users with better visibility into supply chain status and more—something SAP Joule will support, albeit with its own limitations.
The key takeaway here is that AI chatbots and LLMs are not omniscient. They don’t have the ability to fully understand your unique thought processes until they’re properly trained or provided with the right knowledge. Without sufficient training, even the most advanced AI can’t create those “TPS Reports” your manager keeps asking with the cup of coffee on hand every Monday morning —and they are rarely used.
Here are the rules of our “Rumble in the Jungle” Hackathon
Alright, since I don’t want to drown you in 200 pages of tests (and risk my editors working overtime while you, the reader, run for the hills), I’ve kept it simple. This is a three-part article series, we’re focusing on two of the biggest, most talked-about AI chatbots: OpenAI ChatGPT and Google Gemini. Yes, they’ve got a lot to brag about. And then there’s the underdog—Claude, developed by Anthropic and just released in March 2023, it’s emerging from the shadows and gaining attention. In this part I of the challenge we will focus only on OpenAI ChatGPT.
The test is the same for all three AI chatbots: improving SAP SAC JavaScript code within an SAP SAC Analytic Application that includes a table, a chart, and a button. The goal is to enhance the script so that on the third button click, both the table and the chart are displayed.
The initial SAP SAC script is the same for all chatbots, ensuring a fair comparison. The expected behavior is as follows:
- First click: The chart is hidden, and only the table remains visible. Included in the original code.
- Second click: The table is hidden, and only the chart is displayed. Included in the original code.
- Third click: Both the table and the chart appear. Not included in the original code, and that’s the change the AI Chatbots must perform to a minimum. Certainly, more credits are given for creativity to improve the requirements and user experience!
The challenge for the AI chatbots is twofold: first, they must demonstrate the capability to generate valid SAP SAC JavaScript code, and second, they must successfully modify it to introduce a third state where both elements are displayed. The chatbot that requires the fewest steps to achieve this solution wins.
Additionally, once the code works as expected, I want more enhancements: an initialization command when the page loads and a modification to the button’s text description that will change the default text displayed in the button. Let’s review the original code to be provided to all AI Chatbots.
if (Chart_1.isVisible())
{
Chart_1.setVisible(false);
Table_1.setVisible(true);
}
else {
Chart_1.setVisible(true);
Table_1.setVisible(false);
}
Let’s do this: OpenAI ChatGPT
To ensure a fair assessment of their capabilities, it’s important to acknowledge that this test carries significant bragging rights. Supporters of each AI chatbot—and skeptics alike—may argue that the evaluation is biased in one way or another. However, my goal is simple: I need to improve the code in the smaller number of steps in this case using only OpenAI ChatGPT. This is a real-world scenario—I urgently need a code fixed, I don’t have the answer, and it is midnight! By morning, I need a solution, making this a true test of their effectiveness under pressure. Remember, all AI or product testing in general are always pre-defined by the creators and certainly they are the ones generating the data and claiming that their model “reasoning” is working when you see a bunch of stuff happening on the screen.
Step 1: We must check that the OpenAI ChatGPT can work with SAP code otherwise why use it and make the selection invalid in this contest, and thus I need to find other option from my initial selections. So, I asked OpenAI ChatGPT if it can code SAP SAC Script, and what other SAP tools they code if they can, I let the agents brag about their capabilities. See the responses by product as follows, notice my human questions in the red boxes across the document, and I am using the out-the-box functionality in all AI chatbots I am not paying for any additional or upgraded version of the products, just the free versions available. Yes, all products offer upgraded versions, and advanced reasoning options that can be also checked but just doing a plain vanilla comparison, and I am skeptical of what “advanced reasoning” means besides a catchy phrase for all models which can also differ when you want to measure it accurately.
Figure 1. ChatGPT confirms it can code in SAP SAC Scripting
Figure 2. ChatGPT confirms what skills and SAP development capabilities are available
I cannot lie after seeing the output show in Figure 2, I am mega excited of the possibilities and applications of OpenAI ChatGPT within the SAP landscape. However, anybody can create an output box that says the same, the key here is to test the skills. Again, in this article I am focusing just on SAP SAC Script skills and the contests would be won or lost depending on the performance on this skill.
But let’s take a closer look under the hood and see if there is a secret engine to help us code almost any SAP technology based on Figure 1 and 2 answers from ChatGPT. It’s important to set the right expectations: generating a book chapter in the style of Mark Twain is one thing, but producing reliable code for business applications is a different challenge altogether. In theory, these AI tools could work their magic to refine your code, accelerate development, and maybe even help you catch some extra sleep. In addition, for this test, we’re not directly integrating our SAP systems with these tools. Instead, we’re simply copying and pasting code back and forth to evaluate their effectiveness, the integration of these tools will be a different document all together checking their API keys, webhooks, and other interface considerations.
Maybe in the future, I’ll explore how to integrate them with custom widgets in SAP SAC or other SAP tools. But for now, the focus is on evaluating their actual development capabilities. Hey, don’t blame me, they’re the ones making these claims!
Before you consider replacing your SAP developers, let’s put these tools to the test following all claims coming out from Silicon Valley these days. This evaluation is strict for SAP SAC Script, and just like humans, different AI models may excel in different SAP tools. For now, my primary focus is on evaluating how well this tool will perform within the SAP SAC environment. My approach is to write like you are reading this article about the functionality I want while letting the AI chatbots generate the original code, which will be presented later in Figure 4.
Step 2: Build your SAP SAC Analytic Application
Figure 3. Reviewing the initial SAP SAC Analytic Application setup
This document is not designed to explain how to build an SAP SAC application, so for that I recommend you check the different documentation available on SAP.com or their YouTube channel, and there are plenty of choices online. As shown in Figure 3, we have one model as part of our story in Page1, we have one button called “Button_1”, one Chart called “Chart_1” and one Table called “Table_1”. Inserting the original code into the on-click action in Button_1 as shown Figure 4, once inserted Save your story in the File menu, and then click on the View button on the top right corner, and a separate screen will be launched and click on the button to see the options. Remember, the code shown in Figure 4 will be provided to ALL AI Chatbots without modification to see what they recommend when simply writing our requests, and remember we need to use SAP SAC Java Script language.
Figure 4. Inserting the original code into your SAP SAC Analytic Application
As shown in Figure 4, we have a source code on the OnClick() event of the button object Button_1, basically every time that we click on the button either the chart appears or the table appears but not both. This is the problem we must resolve to create a third state, when we click on the button both the char and the table will appear. As shown in Figure 5, the look and feel of our SAP SAC Analytic application shows the chart, the table and the button defined in Figure 3 and 4, and see there is data for the BestRunBike SAP SAC model for Units Sold and Order Value with two Product Types Mountain and Racing. In the Chart shown in Figure 5, we can see the color coded of each of the elements mentioned for Units Sold and Order Value by Product Type to keep analysis fast and simple.
Figure 5. Launching your SAP SAC Analytical Application using the View Button
As shown in Figure 5, this is the startup view of how the SAP SAC Analytical Application looks BEFORE we even ask the AI Chatbots for help, and Figure 6 shows what happens to the chart and the table every time we click on it since we only have two states.
- First Click: the chart disappears, and only the table is visible.
- Second Click: the table disappears, and only the chart is visible.
Figure 6. Checking your initial SAP SAC Java Script code in your SAP SAC Analytical Application
Step 3: Feed the code and the instructions using natural language as shown in Figure 7, I am assuming the reader has a minimum level of understanding how to use OpenAI ChatGPT otherwise check this link https://chatgpt.com/c/67b1eedb-8240-800a-b41a-1c8edb35b0b2
Figure 7. First input to OpenAI ChatGPT: My requirements along with the original code.
As depicted in Figure 7, within seconds, ChatGPT delivers a brief analysis followed by an output box that claims to contain the ultimate AI-powered solution to our problem (see Figure 8). With a mix of anticipation and skepticism, I copy the code and paste it into the OnClick() function for Button_1 of our SAP SAC Analytical Application (Figure 4). I eagerly execute the code, expecting to witness AI magic in action—only to have it fail, resulting in unexpected behavior that falls short of the desired outcome.
Figure 8. First failed code recommendation created by OpenAI ChatGPT
Undeterred, I engage in a relentless back-and-forth with ChatGPT—tweaking inputs, testing variations, and troubleshooting through ten iterations. Each time, I watch ChatGPT scrambles to refine its response, eventually slipping into what feels like debugging mode after the third consecutive failure. It acknowledges that a particular command isn’t working as expected and, to its credit, suggests a replacement. But get to that solution? A true test of persistence.
After launching the SAP SAC Application, it quickly becomes clear that the ChatGPT-generated code is triggering unintended actions—doing things I never asked for. Multiple tests confirm the discrepancies, and despite ChatGPT’s reassurances that all issues are resolved, the results remain unchanged (see Figures 10, 11 and 12).
Once again, this underscores a critical truth: AI-generated code must be thoroughly tested and validated by a human. No matter how confident the AI sounds, its assurances are no substitute for real-world verification so far.
Figure 9—Updating the ChatGPT generated code into SAP SAC
Figure 10—new output provided by ChatGPT after first code failure
Figure 11—New output provided by ChatGPT multiple code failures
Figure 12—Human interaction with ChatGPT on why the code is failing
As I continue trying to find a solution, and testing of course, and telling ChatGPT that its code does not work, me human reviewing the recommended code identify errors in SAP SAC validation linked to console.log statement, and I inform the system to try to replace it. As shown in Figure 12, you see the response and the system tries to find an alternative. After the code provided in Figure 12, and tested again in SAP SAC, and on the 10th attempt SUCCESS! The code works as expected, and yes, the human got it right this time working in a team with the AI Agent.
Now like any human when something works, and you can do it, I want more. As shown in Figure 13, I am requesting ChatGPT to change the button description to be “please click here”, and I display the results of the code and moving the code to SAP SAC in Figure 14. Again, SUCCESS in the first attempt to a change, impressive. However, as human I want the text updated in the button when the page launches, as you can see in Figure 14, the change occurs only AFTER I perform the first click on the button.
Figure 13—ChatGPT code output after requesting text in the Button
Figure 14—Running the new ChatGPT code in SAP SAC Success!
Well technically it did work, but clearly a user wants to see the name change when the page loads, not after clicking on the button. I go back to ChatGPT as shown in Figure 15, and I request code adjustment so when the page loads the name has been changed to what ChatGPT responds, unfortunately it does not work, and then the system tries again as shown in Figure 16, and recommends a code to include on onLoad() event.
Figure 15—Requesting further changes to ChatGPT
Figure 16— ChatGPT recommends an OnLoad event code to be updated
As shown in Figure 16, ChatGPT suggests using the code for the OnLoad event or Page initialization. This code will automatically execute when the page is loaded, ensuring the desired behavior right from the start. As a user familiar with SAP SAC, I understand the process. To implement the changes, I need to navigate to the Page1 object in design mode and update the code based on the recommendation provided by ChatGPT, as shown in Figure 17 in the SAP SAC environment.
Figure 17— Adding the Onload code from ChatGPT in SAP SAC
Like with many other tests, I saved the story, clicked on the View button, and waited for the result shown in Figure 18. And… YES! All the requests were successfully processed with the updated code in the button using SAP SAC Java Script and no error messages. Thank you, ChatGPT! Phew… Done! After numerous tests, multiple failures, and human intervention to find alternative code solutions, the issue was resolved with the help of an AI chatbot assistant. It’s official – ChatGPT can assist in improving code and has real SAP development capabilities but well you need to work on it together.
Figure 18— Code implemented and successfully executed Thanks ChatGPT!
Conclusion
This journey has been incredible—not only in recognizing that open-source AI chatbots like ChatGPT can support the SAP development process. The excitement around AI has been clarified through this exploration, highlighting its role as a powerful tool while underlining the necessity of human intervention to validate and refine the outcomes of different AI tools.
It was clear that ChatGPT could solve the problem, but it needed human input to troubleshoot and fine-tune the solution while keeping the code relatively simple compared to the original. Just like a human who might not be able to paint the Mona Lisa but can play a Mozart piece on the piano, AI tools have their unique strengths and weaknesses, and they must be used accordingly like a human.
Feel free to check my other articles created on real-life AI case studies by www.arelliusenteprises.com such as https://sapinsider.org/analyst-insights/leveraging-sap-datasphere-using-intelligent-lookup-and-sap-ai-fuzzy-search-to-deliver-fast-business-solutions/,https://sapinsider.org/probabilistic-supply-chain-and-demand-forecasting-with-sap-ibp-deliver-results-using-data-science/, https://sapinsider.org/expert-insights/automating-your-financial-consolidation-process-using-automatic-jobs-and-job-templates/ and https://sapinsider.org/using-artificial-intelligence-with-sap-for-dynamic-financial-environments/.
I hope you enjoy this article as much as I did. It’s a thrilling look into a constantly evolving world where AI can be integrated into SAP programming, providing valuable support through the AI chatbots discussed here. In the next two articles we will explore and compare Round 1 of ChatGPT with Google Gemini and Anthropic Claude and let’s see who the winner would be.