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!
Showing results for 
Search instead for 
Did you mean: 


Last year at TechEd, SAP unveiled Build Code, and now it's accessible to the users through trial accounts, offering them a firsthand experience of its generative AI capabilities. SAP Build Code stands as a cornerstone in the realm of SAP Cloud Application Programming Model (CAP), SAP Fiori, mobile, and SAPUI5 development. Tailored to enhance the application development journey on SAP BTP.... it integrates coding, testing, and application management seamlessly. Leveraging SAP Business Application Studio alongside essential services and SDKs on SAP BTP, SAP Build Code simplifies and accelerates the development process.

At its core lies Joule, the AI copilot of SAP, facilitating the automatic generation of application code, data models, services, and sample data. This integration ensures adherence to the best practices delineated in the SAP BTP Developer's Guide. With AI-based code generation optimized for Java and JavaScript, SAP Build Code offers a comprehensive solution for coding, testing, integrations, and application lifecycle management.

Recently I got a chance to do a test drive on build code and I have tried out a full stack use case. In part 1 we will create a simple CAP and UI App using Joule and we'll deploy it to the BTP subaccount. We will test, create a managed app router configuration, and access the UI and service endpoints successfully. 

Check out the SAP documentation to know more about the SAP Build Code.

Now Let's get into action!!!

  • As an initial step setup the Build code subscription in your BTP account. Follow this blog to achieve that.
  • Inside your service marketplace under subscription hit on the SAP build code and click the goto application.


  • Inside your service marketplace under subscription hit on the SAP build code and click the goto application.



  • Inside the build lobby, hit the create button and select Build apps and then Build code





  • We are going to build a full stack application use case here so hit the full stack option and fill in the basic details and hit create.




  • Click on your newly created project which will be available in the Build lobby, this opens up your BAS IDE and You can also look for your projects in this path “/home/user/projects” if you are not able to locate it when you launch the BAS.


  • Your storyboard shows the project's partial skeleton with a service and no model exists right now.


  • So far we have created a project using your Build code now lets make use of SAP Joule – the copilot to generate other technical artifacts.
  • As described in the introduction, we will give a simple text-based prompt to Joule as below, and let's anticipate the surprises it has in store.
  • Click on the Joule icon on the left side panel and provide the prompt now.. to create simple entities with a few fields also let's mention data types of them.

Prompt – “Create an employee details app with 2 entities “Project allocation” and “Employee Info”. 
Project allocation entity should have the following fields cust_Activitycode of type String and size 20, cust_Allocation of type decimal,cust_CTC of type decimal,cust_Closuredate of type Date,cust_Costcenter of type String,cust_Costcontrolmanager of type String,cust_Enddate of type Date,cust_Initiationdate of type Date,cust_Jobcode of type String,cust_Jobtitle of type String,cust_ProjectID of type String,cust_ProjectLocation of type String,cust_Projectname of type String.

  • Employee Info entity should have the following fields startDate of type Date, endDate of type Date, seqNumber of type Integer,userId of type String, company of type String,costCenter of type String, countryOfCompany of type String”


  • On click on generate, in a few seconds you’ll get your data model ready based on your prompt like below.. Jaw-dropping isn’t it? Accept it as such and now you can see new two entities under the DB section of your storyboard.



  • Lets load some sample / mock data into the models for our further testing. Click on the Open Editor drop-down and select Sample data, select your entity and click Add.


  • Click on Import and repeat the same for the second entity.. The sample data was generated by the Build code itself and we haven’t fed any inputs yet.


  • Validate the cells and in case of corrections click on the enhance option, now we are going to make use of the Joule copilot to correct the data generated..

Prompt – “Correct the custCTC and custAllocation data in projectallocation table to two decimal precisions”



  • Now, joule has generated the sample data based on your prompt and the decimal places are rectified. Accept the changes and the rectified data reflects in your project allocation data model.


  • Analyse the data and proceed further to test your CAP output.
  • Now lets run the app locally to see the output of the service… Open the terminal and provide the “cds serve” command or you can click on the play icon on the top right corner.


  • Upon running the local run the mock data is accessible as below when the entities are hit from the browser, the same works positive when tested via Postman.



  • Let's quickly create a UI app based on the Fiori elements template … Click on Add under the UI section and then fill in as below.



  • Select template based and proceed next…


  • Select List report page … we’ll explore Custom page in part two of the blog.


  • Select the data model from our CAP app… here im going with project allocation. Click on Generate.



  • Run the application, and you’ll be able to see the output as a list report page as below.


  • Now lets deploy your app to the subaccount.. Your app will not be having mta file so provide “cds add mta” command in the terminal.


  • Right click on the mta file and select build.. once the mtar is generated, deploy your application to your subaccount…


  • Select your cloud foundry settings.. here I have logged in to my global account using my credentials.


  • Before deployment, make sure that you have subscribed to the HANA cloud instance if not you might face issues during deployment.
  • Once deployed, your CAP application route is available, and you can quickly test it out from Postman.



  • Now, the UI app should be available post-deployment… Ohoooo Nooo! We forgot to add an approuter to our application to access the app via Build Work zone standard edition… Let's add that now and then do the rebuild, deployment.
  • Right click on the mta.yaml and select “Create MTA module from template”


  • Select the approuter type as ‘Managed approuter’…and click on create.


  • Your mta.yaml should automatically get updated with the needed configurations that are used by the SAP Build Work Zone, standard edition.
  • Build your project again and then redeploy… You should find the UI app under the HTML5 Applications


  • Open the deployed application route and hit go you should find the results from our full stack app which is built out of Build Code.



We have explored a full stack scenario covering the creation of CAP, a UI app using SAP Joule co-pilot on Build code. In the next part we'll add application logic to the cap app, consume data from external services and configure the portal site using the build work zone standard edition.

Thank you for going through the blog. Stay Tuned for the next part! 🙂



Labels in this area