Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
geert-janklaps
Active Contributor

SAP Build Code comes with SAP Joule as your personal pair developer. If you have never heard of SAP Joule, I recommend you to read this article. To summarize in short, Joule is SAP’s generative AI copilot which will be embedded throughout their product portfolio. You can already activate SAP Joule in SAP SuccessFactors & SAP S/4HANA Cloud (early adopter program) for example.

In this blog we’ll use SAP Joule to generate a data model & some test data for our custom logic.

To open SAP Joule in your dev space, you can use the Joule plugin in the left side of your screen.

geertjanklaps_6-1711461437328.png

Generating a new data model & service for our project

After opening up SAP Joule, the guided experience will show up which allows you to start the SAP Joule experience based on what you want to achieve. In this case we’ll go for “Data Model and Service Creation”.

Once you open Joule with the button in the central of the screen, you’ll be able to provide the input you want to give Joule to generate a new data model and service.

I used following input:

“Create an app to manage sales orders with entities salesorders and salesorderitems where each salesorderitem is linked to its salesorder.”

geertjanklaps_7-1711461479461.png

If you’re happy with Joule’s proposed data model, you can easily accept these changes with the button in the top right corner of the proposal. After accepting the proposal, you’ll see the storyboard gets updated automatically to reflect the changes applied by SAP Joule.

We now have an updated data model and a service reflecting the data model in our project.

 

geertjanklaps_8-1711461523951.png

Generating test data for our project

As a developer, the development as such is our main responsibility, but what would we be without doing at least some testing to verify that everything is working as expected?

Instead of creating test data manually, we can use SAP Joule to do this for us! Let’s create some test data using SAP Joule! To do this, open up the SAP Joule experience again through the SAP Joule plugin in the left side of the screen.

In the guided experience open the Sample Data topic and open SAP Joule. After opening SAP Joule, you can very easily ask Joule to generate some test data for you.

I’ve used following input: “Generate sample data for entities salesorders and salesorderitems”.

If you’re happy with the test data, you can easily accept the test data with the button in the top right corner of the proposal.

geertjanklaps_9-1711461553319.png

After accepting the test data, you’ll be greeted by the sample data editor where you can very easily browse through the test data.

If you have a close look at the generated sample data, you’ll notice that SAP Joule even took into consideration that the totalAmount of the SalesOrders entity should be the sum of the totalPrice of the SalesOrderItems entity.

SalesOrders entity:

geertjanklaps_10-1711461581959.png

Sales Order Items entity:

geertjanklaps_11-1711461611825.png

Isn’t this beautiful? With only a few simple interactions with SAP Joule, we already have a working backing service with some realistic sample data to test our development in SAP Build Code!

While it is great SAP Joule took into consideration that the totalAmount of our SalesOrders entity should be the sum of our totalPrice of the SalesOrderItems entity, we’d like to see this logic reflected when actually creating / updating a new Sales Order. In the next blog post, we’ll use SAP Joule to add some application logic to this automatically and a unit test to validate the logic applied in our application logic.

Blog series navigation

1 Comment
SRINIVAS_KATTA
Explorer
0 Kudos

Very Helpful Blog.. Thank you @geert-janklaps 

Labels in this area