Functional creating CAP application for recording and tracking eating sensations using SAP Joule

 

Introduction

In today’s fast-paced world, understanding our eating habits and sensations can provide valuable insights into our overall well-being and improve our performance in work. Inspired by concept from “The Personal MBA by Josh Kaufman” about how tracking your food sensations could improve a little bit your performance in work and eager to test AI capabilities from SAP Joule, this blog post will guide you through the process of creating a CAP (Cloud Application Programming) application designed to record and track eating sensations.

The main goal of this proof of concept is to demonstrate that functional users, even those without extensive coding backgrounds, can effectively generate and comprehend code using powerful AI tools like SAP Joule and Microsoft Copilot Webbrowser. By leveraging these advanced technologies, we aim to bridge the gap between functional expertise and technical implementation, empowering more individuals to contribute to innovative solutions.

Join me as we explore the steps to build this application, from initial setup to deployment, and discover how AI can enhance our ability to create meaningful and user-friendly applications.

Creating and translating requeriment using Microsoft Copilot

Creating a requirement in your native language and then translating it can be much easier than doing it directly in English. In this case, I decided to add to the prompt to simplify and make the requirement much more understandable for later programming. The quality of the documentation and its understanding is essential for artificial intelligence to program correctly.

VictorSevilla_2-1726422881960.png

 Once we have the requirement, we will set up an SAP BTP account to test creating a CAP application using SAP Build and SAP Joule without extensive knowledge of these technologies.

IMPORTANT: In this test, we will only program using natural language.

Set-up SAP Build Code using boosters

First of all, we need to get the SAP Build application running on our SAP BTP account. In this case, I don’t have technical knowledge in SAP BTP, but we can use boosters to have a fully operational SAP Build programming environment without needing extensive knowledge.

Setup SAP Build Code in SAP BTP | SAP Tutorials

Special thanks to Paola Laufer for the tutorial.

Programming application using SAP Joule and understanding details with Microsoft Copilot

IMPORTANT: Highlight that the steps used were taken from material provided by SAP and adapted to my application. Once again, special thanks to Paola Laufer for this SAP Build Code Test Drive that has served as my guide.

Create a Full-Stack Application with SAP Fiori UI using Joule in SAP Build Code | SAP Tutorials

Let’s get started with our application!

Artificial intelligence always needs to be reviewed and adapted by humans. Although this could probably have been done through a series of prompts, I have adapted the requirement to a format that I believed SAP Build would understand better.

VictorSevilla_3-1726423053231.png

 Create Data Entities with SAP Joule

Using the requirement and the SAP Joule option in SAP Build Code, we can specify that we want to create a CAP application and generate the necessary data models and services.

1. Prompt SAP Joule with requirement:

VictorSevilla_8-1726424269572.png

2. Accept the response:

VictorSevilla_9-1726424281977.png

3. Results:

VictorSevilla_10-1726424294854.png

Enhance the Application Data Using SAP Joule

The data for testing applications must be real and reflect reality. Generating these datasets can be a tedious task that consumes a lot of time and imagination. You’ll never have to do this again because SAP Joule can generate the data you need to work on your application!

1. Prompt to generate data:

VictorSevilla_11-1726424303762.png

2. Accept and trigger the information for your testing table:

VictorSevilla_12-1726424327763.png

3. AI makes mistakes, but we review and correct them by filling in some fields that were left empty:

 

VictorSevilla_13-1726424343495.png

Sorry my mistake here, I should request to SAP Joule to delete ‘minutes’ column because it’s duplicated with ‘hour’.

Create Application Logic with SAP Joule

Now it’s time to add logic to our application to ensure that the behavior of the fields is as expected.

1. Add logic:

VictorSevilla_14-1726424614844.png
VictorSevilla_15-1726424624705.png

2. Prompt SAP Joule with data validation logic that you want to perform:

VictorSevilla_17-1726424739725.png

 3. SAP Joule triggers a proposal of the code:

VictorSevilla_18-1726424756589.png

4. As I’m a noob in CAP language, I’ve requested to Microsoft Copilot to ensure that all steps are good and to understand the code:

VictorSevilla_19-1726424768229.pngVictorSevilla_20-1726424775210.png

5. Once code is reviewed and understood that works fine, this code is accepted and trigger to the application:

VictorSevilla_21-1726424828271.png

Add UI to the Application

We have all the code now; it’s time to create the screens to enter and view the information. Let’s do this!

 

1. Create UI application:

VictorSevilla_22-1726425378947.png

2. Most important step here is to decide which actions will be performed by this application. In this case, we’ve selected ‘Form Entry Object Page’ because UI application will be responsible to collect data from user:

VictorSevilla_23-1726425457076.png

3. UI application is created with few easy steps:

VictorSevilla_24-1726425477738.png

4. Repeat steps for application which is responsible to show information. In this case, we need to select ‘List Report Page’:

VictorSevilla_25-1726425511792.png

5. Finally, we can show how both applications are created:

VictorSevilla_26-1726425541149.png

Run application

Everything is ready! Now let’s run the application and test it.

VictorSevilla_27-1726425611125.png

Overview about ‘Food tracking for your job performance’ application

Application screen

The requirement called for two applications: one to add food items and another to review the data. We have successfully met this requirement:

VictorSevilla_28-1726425682485.png

Add a new entry

The requirement called for help fields to enter the data and only allow certain values.

VictorSevilla_29-1726425862105.png

The day and time fields have the correct drop-down menus.

VictorSevilla_30-1726425876420.pngVictorSevilla_31-1726425883177.png

But it wasn’t able to create a drop-down menu for the ‘Type of food’ and ‘Transmitted Sensation’ fields (it probably could have done this by iterating the system). Despite not having a selection menu for ‘Type of food’ and ‘Transmitted Sensation’, the system was able to create validations to ensure the correct field is selected.

 

VictorSevilla_32-1726425910145.png

Show your data

The system was able to generate the table to display and it works correctly, showing the entry added in the previous step:

 

VictorSevilla_33-1726425995649.png

Additionally, the requirement asked to group by ‘Day’, ‘Type of food’, and ‘Transmitted Sensation’, and this requirement has been met:

 

VictorSevilla_34-1726426048096.pngVictorSevilla_35-1726426053768.pngVictorSevilla_36-1726426060389.png

Conclusion

The application requirement wasn’t complicated, but I believe it’s enough to demonstrate that for simple application cases, we can use SAP Joule to generate a fully operational application. As we can see from the analysis, the application meets 90% of the requirements and only failed in generating the drop-down menu.

For me, the conclusion is clear: without any CAP knowledge, I was able to create an application in less than 45 minutes and generate a blog in less than 2 hours. Now, I’m excited to see what I could achieve with a bit more time!

End credits

Time is very valuable and creating blog easy to understand and with high quality content are difficult with few time. AI can help us doing it and you have an example with this post which mainly created using Microsoft Copilot (AI).

VictorSevilla_1-1726422829956.png

 Time consumed for this PoC: 2.5 hours of a boring Sunday

Scroll to Top