SAP-samples/cap-hana-exercises-codejam
An eight-exercise CodeJam that builds a full-stack CAP application on SAP HANA CloudSAP HANA CloudThe managed database under most of this: CAP's default target, the store Datasphere and Analytics Cloud sit on, and a service with plans and components.sap official, btp, from HDI containers to calculation views and stored procedures.
Eight exercises take a CAP Node.js project from a fresh SAP HANA CloudSAP HANA CloudThe managed database under most of this: CAP's default target, the store Datasphere and Analytics Cloud sit on, and a service with plans and components.sap official, btp HDI container through a CDS data model and a generated Fiori Elements list-report UI, add XSUAA-based authentication and role-based access, then expose two HANA-native artifacts through CAP: a calculation view as a read-only entity and a stored procedure as a service function. A bonus exercise packages the result as an MTA and deploys it to SAP BTP Cloud Foundry. Completing all eight at an in-person event earns a Credly badge.
Facts
Where it sits
Who is behind it
In the atlas: maintains 222@SAP-samplesmaintainerAjinkya PatilContributes to this
In the atlas: contributes to 112@ajinkyapatil8190Brian BernardContributes to this
In the atlas: contributes to 64@btbernardDJ AdamsContributes to this
Developer Advocate
In the atlas: contributes to 20, wrote 22@qmacroThomas JungContributes to this
Developer Advocate
In the atlas: contributes to 15, wrote 6@jung-thomasKevin RiedelsheimerContributes to this
In the atlas: contributes to 11@KevinRiedelsheimerNico SchoenteichContributes to this
In the atlas: maintains 3, contributes to 16, wrote 3@nicoschoenteich6 contributors
What it declares
Every artifact
- Type
- Sample
- Origin
- By SAP
As a sample
- Form
- Workshop or CodeJam material
Connections
Connecting a data model and its queries to a database
Download
README
quoted from SAP-samples/cap-hana-exercises-codejam under Apache-2.0, readCodeJam - Combine SAP Cloud Application Programming Model with SAP HANA Cloud to Create Full-Stack Applications
Description
In this CodeJam you will build a full-stack application using SAP Cloud Application Programming Model (CAP) and SAP HANA Cloud, progressing through 8 exercises from project setup to deployment.
Tech stack at a glance:
- SAP Cloud Application Programming Model — Node.js
- SAP HANA Cloud (HDI containers)
- SAP Business Application Studio
- SAP Fiori Elements UI (OData V4)
- XSUAA authentication
- HANA-native artifacts: calculation views and stored procedures
Complete all 8 exercises at an in-person CodeJam event to earn a Credly badge.
What is an SAP CodeJam?
SAP CodeJam is a hands-on, collaborative event where developers come together to learn about SAP technologies, share knowledge, and work on practical exercises. These events are typically led by SAP experts and provide a great opportunity to network with peers, ask questions, and gain a deeper understanding of SAP solutions through guided tutorials and real-world scenarios.
Before you start
Review the introductory slides and video below before or during the opening session.
- SAP Cloud Application Programming Model Presentation from Introduction
- SAP HANA Cloud Presentation from Introduction
- SAP Business Application Studio Presentation from Introduction
- Introduction to SAP Cloud Application Programming Model Video
If you prefer to develop locally or in a container, see the Dev Container and Codespace options in the prerequisites.
Requirements
The requirements to follow the exercises in this repository, including hardware and software, are detailed in the prerequisites file.
Material organization
The material consists of a series of exercises. Each exercise is contained in a directory, with a main 'readme' file containing the core exercise instructions, with optional supporting files, such as screenshots and sample files.
Following the exercises
During the CodeJam you will complete each exercise one at a time. At the end of each exercise there are questions; these are designed to help you think about the content just covered, and are to be discussed with the entire CodeJam class, led by the instructor, when everyone has finished that exercise.
If you finish an exercise early, please resist the temptation to continue with the next one. Instead, explore what you've just done and see if you can find out more about the subject that was covered. That way we all stay on track together and can benefit from some reflection via the questions (and answers).
The exercises are written in a conversational way; this is so that they have enough context and information to be completed outside the hands-on session itself. To help you navigate and find what you have to actually do next, there are pointers like this 👉 throughout that indicate the things you have to actually do (as opposed to just read for background information).
Known Issues (affects Exercise 3)
When creating the HDI Container instance in Exercise 3, the Business Application Studio tooling sometimes does not properly wait for the container creation. In these situations, simply wait a moment for creation to complete and then repeat the step.
The exercises
Here's an overview of the exercises in this CodeJam.
- Make certain that you have successfully completed all the prerequisites
- Exercise 1 - Set Up SAP HANA Cloud and Development Environment — Set up an SAP HANA Cloud instance and configure your development environment in BAS
- Exercise 2 - Create an SAP Cloud Application Programming Model Project for SAP HANA Cloud — Scaffold a CAP Node.js project and connect it to your HANA Cloud HDI container
- Exercise 3 - Create Database Artifacts Using Core Data Services (CDS) for SAP HANA Cloud — Define the data model using CDS and deploy database artifacts to HANA Cloud
- Exercise 4 - Create a User Interface with CAP (SAP HANA Cloud) — Generate an SAP Fiori Elements list report UI served by the CAP service
- Exercise 5 - Add User Authentication to Your Application (SAP HANA Cloud) — Add XSUAA-based user authentication and role-based access control
- Exercise 6 - Create Calculation View and Expose via CAP (SAP HANA Cloud) — Build a HANA calculation view and expose it as a read-only CAP entity
- Exercise 7 - Create HANA Stored Procedure and Expose as CAP Service Function (SAP HANA Cloud) — Implement a HANA stored procedure and surface it as a CAP service function
- Bonus Homework - Deploy CAP with SAP HANA Cloud project as MTA — Package and deploy the full application as an MTA to SAP BTP Cloud Foundry
Feedback
If you can spare a couple of minutes at the end of the session, please help me improve for next time by giving me some feedback.
Simply use this Give Feedback link to create a special "feedback" issue, and follow the instructions in there.
How to obtain support
Create an issue in this repository if you find a bug or have questions about the content.
For additional support, ask a question in SAP Community.
Further connections and information
Here are a few pointers to resources for further connections and information:
What is the SAP Cloud Application Programming Model?
The SAP Cloud Application Programming Model (CAP) is a framework of languages, libraries, and tools for building enterprise-grade services and applications. It provides a consistent end-to-end programming model with built-in best practices and out-of-the-box solutions for common tasks.
For more information, visit the following resources:
What is SAP HANA Cloud?
SAP HANA Cloud is a fully managed, in-memory cloud database as a service (DBaaS) that provides advanced analytics and data management capabilities. It integrates seamlessly with other SAP services including CAP, and supports real-time processing for modern enterprise applications.
For more information, visit the following resources:
What is SAP Business Application Studio?
SAP Business Application Studio is a cloud-based IDE tailored for SAP application development. It provides built-in support for CAP, SAP Fiori, and SAP HANA, including the graphical calculation view editor used in Exercise 6.
For more information, visit the following resources:
- SAP Business Application Studio Overview
- Getting Started with SAP Business Application Studio
- SAP Business Application Studio Documentation
Contributing
If you wish to contribute code, offer fixes or improvements, please send a pull request. Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses the standard DCO text of the Linux Foundation.
License
Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Flavors
“SAP Cloud Application Programming Model — Node.js” — SAP-samples/cap-hana-exercises-codejam — README
History in the atlas
- First seen.
For your agent
- Ref
artifact:sap-samples-cap-hana-exercises-codejam- JSON
- /artifacts/sap-samples-cap-hana-exercises-codejam.json
- MCP
- Connecting an agent