Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
xinye
Advisor
Advisor

Introduction


Last week at SAP TechEd 2023, the stage was set for the introduction of SAP Build Code, a solution designed to streamline the entire lifecycle of business applications. SAP Build Code is a turn-key environment for coding, testing, integrating, and managing applications by bringing together key design time, runtime services and tools in one single offering.

SAP Build Code combines the development environment from SAP Business Application Studio with the most essential services and SDKs on SAP Business Technology Platform (BTP). The objective is to significantly enhance the development experience, boost efficiency, and supercharge productivity. For more information, please see the announcement blog.

One way to supercharge developer productivity is utilizing Generative AI. With SAP Build Code developers can build rapidly using AI code generation with Joule copilot, including generating application logic from natural language descriptions.

In this blog, you will discover the revolution of regular development activities, with a particular focus on enhancing the development process for SAP Cloud Application Programming Model (CAP) projects.
Note: As of now, Joule is exclusively available for customers taking part in the SAP Build Code & Joule preview program and will be finally available as an add-on to SAP Build Code.

Instance


Let us build a customer loyalty application that can calculate and store reward points for customers based on their purchases. The purchase points are one tenth of the purchase value and are tracked for each customer. This is recorded along with basic contact data about the customer such as name, total points, total purchase value, number of purchases, and total points redeemed.

When you create a new project `lcapCustomerLoyalty` from Build Code lobby, the Business Application Studio will get launched with the Storyboard viewer opened.


To guide developers to use the Generative AI features more efficiently within Business Application Studio, a new guide `Generative AI-Powered Development` has been introduced into the Guide Center panel. So far, we support 4 main use cases that help you develop your application quickly.


Joule is activated by pressing the `Open Joule` button within the guide.


Besides the normal approach of manually modeling the data model with the CDS (Core Data Services) graphical modeler tool within Business Application Studio, this time we could ask Joule to generate it using a pure natural language prompt.


Typically, the response fully respecting the requirements will get returned, and it can be accepted directly to the working project, just by pressing the `Accept` button on the top-right corner of the code block within the response content. Storyboard will get refreshed automatically to reflect the newly generated result.


So, you can see that Joule in Business Application Studio with SAP Build Code not only generates code but also supports the visual modelers in SAP Business Application Studio, allowing users to continue using the existing visual editors.

Besides the generated data model and data service, contextual sample data also gets initialized based on the user’s prompt.


In addition, the UI annotations were also generated. This means that your application is ready, and you can do a quick preview for the generated content using the default Fiori Element preview application. For example, in this case with the support on association entity and date type input.


If you think the result is not good enough, you can also press the `Regenerate` button to see a different result with the same user prompt. As you may be aware, Joule does not consistently produce identical results. Instead, it often introduces slight variations to the generated output.


Or you can still refine your text by pressing the `Pencil` button beside the initial text and resend it.


Till now, we have seen the generation of CAP data models, sample data and UI annotations. Next, we shall see how we can customize the CAP service via application logic. This can also be done by Joule, which generates JavaScript code based on your prompt.

Within the graphical modeler editor, first select the service entity `Purchase`, and then press the `Add Logic` context menu.


Provide necessary information for the newly created application logic in natural language.


Map the new created application logic to standard CAP event as below within the Business Application Studio Application Logic editor.


Once the configuration is ready, the `Open Code Editor` button will be available to use.  Choose `Application Logic AI-enabled` item to ask Joule again for the custom logic implementation.


We could provide more detailed information to Joule for the generation, like below.


Joule returns a response based on the requirements. And once you press the `Accept` button, the corresponding file content will be updated directly.



Besides the `Regenerate` button and `Pencil` button on the initial text to do a reset, there is further support on the JavaScript code generation to improve the result using feedback message. You can ask Joule to generate the application logic one more time and get the improved response like below.


So, you see, it is a chat style conversation, all the history of your chat messages are sent along with the necessary project context information to the Generative AI model to generate the responses. However, when you think the history would be misleading, or the conversation has become too long, please reset the current conversation by pressing the panel top-right corner button. Then you could start your conversation from scratch once again.


Besides this, you can use the “Error Check” button to directly open the relevant log panel, such as `DEBUG CONSOLE`, to get the runtime errors. You can then copy the runtime error into Joule and Joule will generate an improved result for you.


 

In addition, besides the above shown scenarios, we also support the improvement on the existing sample data, and the unit test generation for the corresponding application logic. They all work similarly in this interactive chat style.

Summary


Leveraging Joule in the development environment of SAP Build Code, is just like having an AI assistant who knows your business context and the latest SAP technology sitting beside you and happy to give you help at any time. While it may not deliver perfect results consistently, it provides a solid starting point and opportunities for learning. We hope you enjoy its benefits and seamlessly integrate it into your work process.

 

What’s next?


If this has you excited, we have many more exciting features in store for you in 2024.

Drop us an email at SAPBusinessApplicationStudio@sap.com or comment on this post to talk to us regarding all things SAP Business Application Studio.

Until next time, happy coding!
12 Comments
PierreCol
Product and Topic Expert
Product and Topic Expert
0 Kudos
Great blog post, thank you xinye! 👍🏻
Vijayblr
Explorer
Insightful blog post, thanks Xin Ye,

By when will it be available in SAP BAS in SAP BTP trial, to try this?
rb
Active Participant
0 Kudos
Yeah would be interesting for general BAS development.
00022111734
Participant
0 Kudos
Hi xen ye

Thanks for sharing insights Appreciated
xinye
Advisor
Advisor
0 Kudos
Thanks for your interest.
As of now, it is only available on the Build Code Business Application Studio pilot environment with AI feature enabled, and it will be finally available as an add-on service to SAP Build Code GA (Generally Available).
azhar_parvez
Discoverer
0 Kudos
Hi Xin Ye
Execellent blog post latest insight thank you.

Joule available with SAP BAS in trail account?
xinye
Advisor
Advisor
0 Kudos
Hi Azhar Parvez,

Thanks for your interest. As of now, Joule on SAP BAS will be finally available as an add-on to SAP Build Code.
VijayReddy9
Participant
0 Kudos

Great blog, looking forward to see more updates from you.

Vijay 

aleserban
Newcomer
0 Kudos
I feel like the future of UI is Web Components as it is based on Open Source, will it support this tech? https://sap.github.io/ui5-webcomponents/
xinye
Advisor
Advisor
0 Kudos
Hi Ales Erban, yes, it's in our roadmap, please stay tuned.
PierreCol
Product and Topic Expert
Product and Topic Expert

In addition to what you've read recently on  Application Development with SAP Build Code including AI and Joule copilot on SAP BTP, I highly recommend this 1 hour demo session held bthomas_volmering last week 💡

AZAK
Discoverer
0 Kudos

Thanks for the nice blog,

Are there any plans for having Joule also in VS Code ? not just BAS ?