Rumble in the Jungle Round 2: Using Google Gemini to Automate SAP SAC Script Code

Reading time: 9 mins

Meet the Authors

Key Takeaways

⇨ The test of Google Gemini in enhancing SAP SAC JavaScript code highlighted its inefficiency, as it produced overly complex code with numerous errors compared to ChatGPT, which delivered a functional solution with minimal adjustments.

⇨ The objective of the 'Rumble in the Jungle' Hackathon is to evaluate the capacity of AI chatbots like Google Gemini to generate and modify SAP script code with minimal human intervention, aiming for simplicity and effectiveness in coding.

⇨ Despite presenting a wide array of capabilities, Google Gemini failed to successfully complete the task within the scope of SAP SAC JavaScript, demonstrating that not all AI tools are suited for every specific coding need.

Welcome to Round 2 of our “Rumble in the Jungle” SAP Hackathon. This time we continue our review of Google Gemini the popular AI Chatbot and its capabilities with SAP development. We will follow the same procedure and code utilized in the OpenAI ChatGPT test in Round 1 where the code was successful in 10 tries, and you can review this article here: Rumble in the Jungle Round 1: Using OpenAI ChatGPT to Automate SAP SAC Script Code. 

For a refresher for those new, what we are trying to achieve with this article is something similar what SAP Joule is promising to do, for full transparency the first version is being released in Q12025 and probably we will test it later in the future, but as we all expect there would be limitations as any other SAP product in the beginning. In this article we will focus our attention to Google Gemini, I am completely excited since I have been using it for a bit already, and the results are very interesting. However, does it hide a secret SAP development AI chatbot that can compete with SAP Joule? That’s the purpose of this article, let’s find out! 

Here are the rules of our “Rumble in the Jungle” Hackathon  

Explore related questions

The test is the same for all AI chatbots being tested: 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. Once again, the goal is that the corrective code is completely generated using Google Gemini in this case with the minimum human interaction otherwise why use it if we can do this ourselves! 

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 Google Gemini! 

To ensure a fair assessment of the capabilities of Google Gemini, 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 least number of steps. 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 is 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. And remember, what you think is “reasoning” maybe not the same thing that it means to me, so I have to assume all AI Chatbots can do some level of reasoning. 

Figure 1. Google Gemini confirms it can code SAP SAC Script  

 

After the confirmation shown in Figure 1, that we have an extremely powerful AI Chatbot saying it can code in SAP, including debugging and troubleshooting, API assistance, provide even examples and best practices! Right now, Google Gemini is on standby for me to provide the SAP SAC script code, and it will fix it. As shown in Figure 2 I ask Google Gemini to tell me what other areas it can help me code me code in SAP, and the results are truly amazing ….if true. 

Figure 2. Google Gemini confirms the other SAP tools it can code (the longest brag of skills so far) 

  

Before you consider replacing your SAP developers, let’s put these tools to the test. 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 evaluating how well Google Gemini will help me resolve my coding issue in SAP SAC.

Step 2: Build your SAP SAC Analytic Application, you can skip this step if you review our Round 1 with ChatGPT. 

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 4, 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 8, 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 4 and 5, 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 6, 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 to Google Gemini and the instructions using natural language, which means like a social media app or chat tool you are familiar with using as shown in Figure 7 into Google Gemini using 2.0 Flash. 

Figure 7— Initial code output from Google Gemini 

 

As shown in Figure 7, we received the code output from Google Gemini, which was unexpectedly long. Following the same process, I copied the code from Google Gemini and pasted it into the OnClick action of the button in JavaScript within SAP SAC, similarly to what we did in Round 1 with ChatGPT. The result? A flood of errors and a noticeably larger codebase compared to ChatGPT’s more concise solution. This was surprising and highlighted Google Gemini’s inefficiency in this scenario, like why so much unnecessary code!!! For a detailed look at the errors and key lines of code generated, see Figures 8, 9 and 10. 

Figure 8— Updating Google Gemini code recommendation as SAP SAC displays errors 

Figure 9— Reviewing some of SAP SAC errors from the Google Gemini code (what in the world!!) 

As you position your cursor, the numerous errors in Figure 9 become immediately apparent. Attempting to execute the SAP SAC Analytical Application results in the error message shown in Figure 10. After saving the code and replacing ChatGPT’s version with the solution recommended by Google Gemini, I run the application again—only to encounter yet another set of errors within the SAP SAC Analytical Application. 

Figure 10— Executing the SAP SAC Application with Google Gemini with errors  

 

Like the process with ChatGPT, as shown in Figure 10, I copied the error to the clipboard and informed Google Gemini to begin the debugging process. I then pasted the error back into Google Gemini, following the same troubleshooting approach I used with ChatGPT to resolve the issue. While both AI chatbots are intelligent enough to identify the errors and suggest solutions, it’s important to note that this doesn’t necessarily mean their solutions are correct without testing and transferring the recommended code into SAP SAC. 

Despite multiple attempts at running different versions of the code generated by Google Gemini, the results remained frustratingly consistent. Each time, it provided lengthy explanations, suggested I might have overlooked something, and proposed alternative solutions. Yet, errors persisted, and with every iteration, the suggested code grew unnecessarily complex. 

After 15 attempts, I gave up. Google Gemini simply couldn’t produce a working solution for this SAP SAC JavaScript issue. Instead of refining the fix, it kept expanding the codebase, introducing more errors flagged by SAP SAC. In contrast, ChatGPT required only a single statement substitution to resolve the issue. Google Gemini, on the other hand, added so many extra statements that the sheer number of mistakes was staggering. 

Ultimately, this test was a failure for Google Gemini. While it provides extensive explanations of its capabilities, it tends to overcomplicate solutions, fails to deliver a functional fix, and demand significantly more human intervention, making it a far less viable choice in a corporate setting. 

Conclusion  

The verdict of Round 2 with Google Gemini: Defeat.

Our champion ChatGPT still stands as the best one so far waiting for Round 3 contender Anthropic Claude of this “Rumble in the Jungle” challenge. Unfortunately, Google Gemini overcomplicated the task, introducing new issues and ultimately failing in this test. Instead of being a useful tool to resolve the problem, Google Gemini became a liability and truly made my life a living hell if I was using it at midnight to try to go to sleep! However, this does not mean that Google Gemini lacks other valuable skills; it simply wasn’t designed for this specific task. Just like a human who might not be able to paint the Mona Lisa but can play a Mozart piece on the piano, still a human is an intelligent agent but not designed to do one of the other. Similarly, 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. Next, let’s check our final contender Anthropic Claude, the dark horse of this challenge. 

More Resources

See All Related Content