JinJin48
JinJin48
SAP Consultant | BTP · S/4HANA · US Global Rollout
· 13 min read

Cover: CAP and Build Code — architecture and use

TL;DR
  • CAP is the open SAP Cloud Application Programming Model — a CDS-driven framework for Node.js and Java services with generic OData providers, declarative authorization, and SaaS-grade multitenancy. It runs anywhere CAP is supported (Cloud Foundry, Kyma) and has no AI dependencies of its own.
  • Build Code is a commercial bundle that wraps CAP with a Business Application Studio dev space and Joule for Developers, an AI copilot that scaffolds CDS entities, CAP services, and Fiori UI annotations from natural language — including a 2025 multi-agent mode for complex applications.
  • The consultant question is never “CAP or Build Code.” It is “do we need Joule-driven scaffolding and the unified Build subscription, or is plain CAP in BAS enough?” Picking Build Code without a clear scaffolding need wastes credits; picking plain CAP without budgeting for senior CDS skill is the more common failure.

Where This Article Sits

IDTitle
BTP-B01Application Development Overview and Capability Map
BTP-B02Business Application Studio: Architecture and Use
BTP-B03CAP and Build Code: Architecture and Use (this article)
BTP-B04ABAP Environment: Architecture and Use
BTP-B05Build Apps: Architecture and Use
BTP-B06Build Process Automation: Architecture and Use
BTP-B07Build Work Zone: Architecture and Use
BTP-B08Use Cases and Decision Patterns

References

ResourceURL
SAP Cloud Application Programming Model (capire)cap.cloud.sap →
CAP Java — Getting Startedcap.cloud.sap →
CAP Node.js Stackcap.cloud.sap →
CAP — Extensibility & Multitenancy Guidecap.cloud.sap →
SAP Joule for Developers product pagesap.com →

1) The CAP and Build Code Landscape

Four capabilities of pro-code BTP development: CAP, BAS, Joule, Build Code

CAP and Build Code are often discussed as if they were competing products. They are not. CAP is a framework; Build Code is a packaging of that framework with an IDE and an AI copilot.

CapabilityWhat it doesPrimary user
CAP (programming model)Models domain in CDS, generates OData services, manages persistence and securityPro developer (Node.js / Java)
SAP Business Application StudioBrowser-based dev space hosting the CAP toolchain and Fiori toolsPro developer
Joule for DevelopersAI copilot generating CDS entities, CAP services, and Fiori UI annotations from natural-language promptsPro developer
SAP Build CodeCommercial bundle: BAS dev space + CAP + Joule under one subscriptionTeam lead / project owner

They are not substitutes. CAP is the runtime regardless of which option you pick. BAS is the IDE. Joule is the AI feature. Build Code is the commercial wrapper.

2) How It Connects to S/4HANA

Side-by-side BTP CAP architecture with layers: authoring, programming model, runtime, persistence, integration to S/4HANA

CAP is a side-by-side extensibility option: services run on BTP and call into S/4HANA via released APIs, not from inside the S/4HANA stack. Build Code does not change this — it changes how you author the side-by-side service, not where it runs.

                 SAP BTP — Application Development (Pro Code)
   ┌──────────────────────────────────────────────────────────────────┐
   │  Authoring layer                                                 │
   │   ├─ SAP Build Code (BAS dev space + Joule for Developers)       │
   │   └─ Or: BAS standalone + CAP toolchain (no Joule)               │
   │                                                                  │
   │  Programming model                                               │
   │   └─ CAP (Node.js or Java) — CDS, generic providers, MTX         │
   │                                                                  │
   │  Runtime                                                         │
   │   ├─ Cloud Foundry (default for CAP)                             │
   │   └─ Kyma (Kubernetes-native)                                    │
   │                                                                  │
   │  Persistence                                                     │
   │   └─ SAP HANA Cloud (PostgreSQL / SQLite supported in dev)       │
   └──────────────────────────────┬───────────────────────────────────┘
                                  │ OData / REST via Destination service
                                  ▼
   ┌──────────────────────────────────────────────────────────────────┐
   │  S/4HANA Cloud (released APIs only)  ──or──  S/4HANA on-premise  │
   │                                                via Cloud Connector│
   └──────────────────────────────────────────────────────────────────┘

Key point: Whether you author in plain BAS or in Build Code, the deployed CAP service is the same artifact. Build Code is an authoring decision, not an architecture decision — “we picked Build Code” is not, by itself, an answer to any S/4HANA integration question.

3) Maturity Map

Maturity checklist of CAP and Build Code components in 2026

CapabilityMaturityNotes
CAP Node.js✅ Production-readyLong-running default; broadest community. Requires Node.js LTS.
CAP Java✅ Production-readySpring Boot integration; Java 17 minimum, Java 21 recommended; Maven 3.6.3+.
CAP on Cloud Foundry✅ Production-readyThe default deployment target; richest service catalogue.
CAP on Kyma✅ Production-readyRequires real Kubernetes operations capability — not a drop-in for CF teams.
CAP MTX (multitenancy)✅ Production-readyUsed by all SAP-built SaaS extensions; CDS Aspects are the supported extension model.
SAP Business Application Studio✅ Production-readySubscription-based; the canonical CAP dev space.
Joule for Developers (single-agent)⚠️ Production-ready in core CAP scaffoldingGenerates CDS entities, CAP services, Fiori UI annotations.
Joule for Developers (multi-agent)🔶 Generally available, expanding2025 evolution for complex CAP applications; output quality improves with prompt discipline.
SAP Build Code (bundle)✅ Production-readyNow part of unified SAP Build packaging (Build Code + Apps + Process Automation + Work Zone under one license).

4) Requirements Checklist

Four prerequisite blocks: programming model, Build Code/Joule, deployment/identity, operations

Each block below is a separate gating set. If any item is unanswered when requirements close, the project is not ready for design.

Programming model and team prerequisites

Checklist itemWhy it matters
At least one engineer with production CDS experience on the teamCAP’s productivity comes from CDS; teams learning CDS on the project ship slower than teams using Spring Boot or Express directly.
Decision made between Node.js and Java stack — and not mixed in one serviceBoth are GA, but running both in parallel doubles operational surface for no productivity gain.
Node.js LTS or Java 17+ (Java 21 recommended) confirmed for build and runtimeOlder Node.js or Java 11 is unsupported and will fail security review.
OData V4 acceptable for all consumersCAP’s generic providers expose OData V4 by default. Pure REST or GraphQL needs a custom adapter.
Service-level SLOs documented before scaffolding startsGeneric providers hide query cost; SLOs prevent post-go-live surprises.

Build Code and Joule prerequisites

Joule for Developers: single-agent vs multi-agent generation

Checklist itemWhy it matters
Concrete scaffolding use cases documented (e.g., “generate CDS for 12 entities from this spec”)Build Code’s value over plain CAP is Joule. Without scaffolding need, the bundle is overhead.
BTP entitlement for SAP Build subscription or BTPEA credits for Joule consumptionJoule runs through the generative AI hub; entitlement must exist before development starts.
Prompt-engineering review process agreedJoule output is reviewed code, not artifacts to merge blindly — review discipline must be defined.
Choice between single-agent and multi-agent generation per applicationMulti-agent suits complex apps; single-agent is faster for simple scaffolding. Mixing defaults across the team causes inconsistent output.
Source-control workflow accommodates AI-generated commitsGenerated CDS and service stubs land as commits — clear ownership and review rules avoid drift.

Deployment, persistence, and identity

Checklist itemWhy it matters
Target runtime decided: Cloud Foundry or KymaPicked at project start, not mid-project. CF is the default; Kyma needs Kubernetes operations skills.
SAP HANA Cloud sized and budgeted for non-prod and prodSQLite suits unit tests, not shared dev. HANA Cloud cost surprises are the most common BTP overrun.
XSUAA or IAS chosen for authentication, with role collections mappedCAP’s @requires and @restrict rely on roles; deferring this blocks integration testing.
Destination service entries planned for every external callCAP’s RemoteService still needs a destination behind it.
Multitenancy (single-tenant vs MTX) decided before first sprintRetrofitting MTX is expensive; CAP supports it well only if planned in.

Operations and lifecycle

Checklist itemWhy it matters
CI/CD pipeline targets cds build artifacts (mta or k8s)The CAP build is reproducible only through the supported tooling.
Logging and tracing wired to SAP Cloud Logging from day oneDefault cf logs are not enough for production debugging across services.
Backup and DR strategy for HANA Cloud confirmedHANA Cloud has its own backup and PITR mechanics — “BTP backs it up” has burned teams.
Joule prompts and outputs archived per project for auditSome regulated industries require traceability for AI-assisted code generation.
Rollback plan independent of JouleIf a regression appears, the team must fix and redeploy without re-running the prompt.

5) Decision Criteria

The three questions to ask first

Three questions to ask before choosing CAP or Build Code

Q1. What concrete development pain are we removing — scaffolding speed, runtime capability, or both?

If the answer is only “scaffolding speed,” Build Code is in scope and plain CAP is not. If the answer involves “we need MTX” or “we need event-driven cross-service calls,” CAP is required regardless of whether Build Code is added.

Q2. Where does the data live and which APIs reach it?

CAP’s value depends on having clean OData or REST APIs to model. If the integration target is on-premise S/4HANA without released APIs, CAP can still call it via Cloud Connector and Destination, but the requirements discussion must include who owns the API release plan on the S/4HANA side.

Q3. Who funds the team and how are they billed for AI consumption?

Build Code now sits inside the unified SAP Build subscription. With BTPEA credits but no Build subscription, Joule is consumed under the BTPEA pool. With neither, procurement is the gating constraint, not technology.

Domain selection by project context

Spectrum: from plain CAP to Build Code based on project context

Project contextRecommended starting capability
New SaaS extension on S/4HANA Cloud, multi-tenant from day oneCAP (Node.js or Java) with MTX on Cloud Foundry. Add Build Code if Joule scaffolding is wanted.
Internal data product exposing OData to a Fiori appCAP (Node.js) on Cloud Foundry. Build Code optional.
Customer wants “AI to build the app” with concrete scaffolding use casesBuild Code with Joule single- or multi-agent.
Existing CAP team adding one more servicePlain CAP — Build Code adds no new capability for one service.
Kubernetes-mandated landscape with in-house platform teamCAP on Kyma. Build Code optional.
No clear pain point identified yetStop. Go back to Q1.

Licensing and cost

Licensing breakdown: CAP free, BAS subscription, Joule consumption, Build Code unified or BTPEA

CapabilityLicensing modelKey question to ask
CAP frameworkOpen source, no license costIs there a budgeted SAP HANA Cloud instance? CAP is free; the persistence is not.
SAP Business Application StudioSubscription per dev spaceHow many concurrent dev spaces are entitled in the BTP subaccount?
Joule for DevelopersConsumption via generative AI hub, bundled in Build CodeHow many prompts per developer per day are budgeted, and what is the fallback when credits run low?
SAP Build CodeSubscription under unified SAP Build packaging; also available via BTPEA / PayGIs the customer on the unified SAP Build SKU, or buying Build Code separately via BTPEA?
SAP HANA CloudSubscription / capacityHas non-prod been sized separately from prod? Sharing one instance across dev and prod is a recurring overrun.

6) Common Failures

Seven common failures when choosing CAP or Build Code

Failure 1: Picking Build Code with no scaffolding use case

The team buys Build Code because the customer wants “AI development,” then uses Joule for a few entity prompts and writes the rest by hand. The bundle pays for capability the team does not exercise. If the scaffolding use cases are thin, stay on plain CAP in BAS.

Failure 2: Treating Joule output as merged code

Joule generates CDS and service stubs that compile, which fools teams into shallow review. Generated authorization annotations, association cardinalities, and Fiori UI hints are the most common defect class — they pass tests but encode the wrong business rule. Treat Joule output as a junior engineer’s pull request.

Failure 3: Skipping CDS authorization, relying on XSUAA scopes alone

Teams bolt scope checks into custom handlers and leave @restrict and @requires off the CDS model. This works until the next developer writes a generic provider call that bypasses the handler entirely. Authorization belongs in the model.

Failure 4: Mixing Node.js and Java stacks in one team

A team that maintains both Node.js and Java CAP services ships about half as much per sprint as one that picks a stack. CAP is consistent across both, but the operational toolchain is not — debugging, profiling, dependency management, and IDE setup all double.

Failure 5: Underestimating SAP HANA Cloud cost in early prototyping

CAP development with SQLite is cheap. The first move to shared HANA Cloud is where budget surprises start, especially when a single-user prototype is provisioned with a production-shaped instance. Size HANA Cloud to actual non-prod load, not “what production might be.”

Failure 6: Forgetting MTX is a day-zero decision

CAP supports multitenancy well — but only when modeled in from the start. Retrofitting MTX after a single-tenant release means rewriting persistence, authentication, and CI flow. If the customer might ever resell the application or share it across legal entities, MTX belongs in the first sprint.

Failure 7: Treating Build Code as a replacement for CDS skill

Build Code does not abstract CDS away — it generates CDS faster. A team without anyone fluent in CDS will produce more code per sprint and ship more bugs per sprint. Plan at least one senior CAP engineer per project, with or without Joule.

FAQ

Q: Can CAP run against an on-premise SAP system, or is it cloud only?

CAP’s supported deployment targets are SAP BTP Cloud Foundry and Kyma. To reach an on-premise S/4HANA, the CAP service uses the Destination service plus SAP Cloud Connector, calling released APIs (OData, REST, or remote-enabled function modules where still permitted). The CAP service itself does not run on-premise.

Q: Is Build Code mandatory if we want Joule for Developers?

Joule for Developers is the AI copilot delivered inside Build Code. Some Joule capabilities are reachable from VS Code (Joule Studio code editor) and from ABAP development tools, but the CAP-scaffolding experience that most consultants mean by “Joule” is the Build Code experience. Plan procurement for Build Code (or unified SAP Build) if Joule is in the requirements.

Q: When should we descope Build Code from a project even if the customer asks for it?

Descope when the team has fewer than two scaffolding use cases per quarter, or when the team is small enough that one senior CDS engineer can scaffold by hand faster than reviewing Joule output. Build Code’s value is amortized over many scaffolding events; one-off projects rarely earn it back.

Q: How do we license Build Code in a customer that already has BTPEA?

Build Code is part of the unified SAP Build packaging and is also available for consumption under BTPEA and PayG. A customer with an existing BTPEA agreement can consume Build Code against that pool — confirm exact unit pricing with the SAP account executive, since the unified Build SKU and the BTPEA-line consumption are priced differently.

Q: How do we document a CAP requirement so the design team can act on it?

Capture, at minimum: (1) entities mapped to released APIs vs net-new persistence, (2) Node.js or Java decision, (3) deployment runtime (CF or Kyma), (4) authentication provider (XSUAA or IAS) with role collection mapping, (5) multitenancy posture, (6) destination list, (7) whether Joule is in the toolchain and which flows it owns. Without these seven items, the design team will fill in defaults that may not match the contract.

Q: Does Build Code lock us into SAP for the long term?

The CAP code is portable — Node.js or Java services with CDS sources can be rebuilt outside Build Code, and the CDS toolchain is open. Build Code is a productivity wrapper, not runtime lock-in. The harder coupling comes from BTP services the application uses (XSUAA, Destination, HANA Cloud); those, not Build Code, are the real lock-in conversation.

Q: Can a low-code team using Build Apps consume a CAP service built in Build Code?

Yes. CAP exposes OData, and Build Apps can consume OData via the Destination service. This is the canonical “pro-code service, low-code UI” pattern on BTP.

Summary

Decision summary: start CAP, add Build Code when scaffolding use cases are concrete and recurring

CAP is the programming model: open, mature, supported on Node.js and Java, and the right default for non-trivial side-by-side extensions of SAP S/4HANA. SAP Build Code is the commercial bundle wrapping CAP with a Business Application Studio dev space and Joule for Developers, an AI copilot that scaffolds CDS, services, and Fiori annotations — including a 2025 multi-agent mode. The decision is not which one to use, but whether the project has enough scaffolding work to amortize Build Code’s commercial overhead. When in doubt, start on plain CAP in BAS and add Build Code when scaffolding use cases are concrete and recurring.

IDTitle
BTP-B01: Application Development Overview and Capability MapMap the four BTP development families before zooming into Pro Code
BTP-B02: Business Application Studio: Architecture and UseThe IDE that hosts CAP development, with or without Build Code
BTP-B03CAP and Build Code: Architecture and Use (this article)
BTP-B04: ABAP Environment: Architecture and UseThe ABAP-side alternative when extensions must stay close to the S/4HANA core
BTP-B05: Build Apps: Architecture and UseLow-code companion that often consumes CAP-built OData services
BTP-B06: Build Process Automation: Architecture and UseWorkflow and RPA layer that triggers CAP services
BTP-B07: Build Work Zone: Architecture and UsePortal layer that surfaces CAP-backed Fiori apps
BTP-B08: Use Cases and Decision PatternsEnd-to-end scenarios pulling all four families together