CAP Foundry: Engineering SAP CAP Applications from Business Intent with Guardrailed AI
Share

CAP Foundry is a prototype for engineering SAP Cloud Application Programming Model (CAP) applications from business intent. The user describes the business outcome, selects or supplies the relevant source, and keeps the architecture choices that materially change the application explicit. The Foundry then discovers the source, resolves an application contract, generates a standard CAP Node.js project with SAP Fiori elements, verifies it through executable checks, and delivers it locally or to the SAP BTP, Cloud Foundry environment.

 
Core engineering split: AI helps interpret business intent and business semantics. Verified source evidence constrains the result. Governed generators own repeatable CAP/Fiori construction. Executable checks decide whether the generated application is accepted.
 
Demo video: 

1. Application Requirements as Input

The primary entry mode in the control room is Build from a business requirement. The user does not need to describe files such as schema.cds, service projections, SAP Fiori elements annotations or an MTA descriptor.

A requirement can instead say:

Build a purchase-order application where buyers create and maintain an order with items, validate quantity and price, calculate item amounts, submit and approve the document, publish an approval event, and protect the application with role-based access.

TThe UI still preserves choices that should not be guessed. The user can select or allow discovery to infer the application structure and operation model, choose the business-data source, and choose local CAP runtime or deployment to the SAP BTP, Cloud Foundry environment. The current structures include single entities, associations, parent-child compositions, deeper owned compositions and recursive hierarchies. Operations include read-only, draft-enabled CRUD and analytical read-only.

01-business-requirement-source-delivery.jpg
Business requirement, source and delivery.
 The application starts from the requested business outcome, a selected business-data source and explicit delivery choices.

2. Discovery Starts With the Source

Business intent is only one input. The second is source evidence. When a real source exists, CAP Foundry inspects that source rather than inventing a model that merely sounds plausible.

Supported source routes include SQLite, an explicitly configured SAP HANA HDI-container source, an existing trusted CAP workspace, offline EDMX, live OData through the SAP BTP Destination service, approved SAP BTP ABAP repository objects, and a bounded two-source application path. For online OData, the control room can inspect metadata and let the user select verified entity sets while keeping destination credentials on the server side.

The ABAP route reads approved repository objects such as tables, CDS definitions and supported read-only program sources through the development tooling boundary. The route has been exercised against an approved SAP BTP ABAP source; as with every live source, a new run still requires valid access to the selected system.

Discovery establishes the facts needed to build the application: relevant objects, fields, keys, relationships, operations, source provenance and enough bounded representative data to understand the selected business shape. It does not treat source discovery as bulk data replication.

Authority rule: source facts and business intent are reconciled before generation. The Foundry does not silently change observed keys, relationships or source capabilities just to make the requirement fit.

3. The Seven-Step Foundry Workflow

The user-facing workflow is deliberately simple:

Intake → Discovery → Build → Verify → Approve → Deliver → Acceptance

Step What the reader should understand

Intake The business requirement and explicit choices become a structured application request.
Discovery The selected source is inspected and the supported application shape and capabilities are resolved.
Build A normal CAP/Fiori project is generated from the validated application contract.
Verify The generated project is compiled, built, tested and started; required evidence must pass.
Approve Approval is bound to the exact reviewed application and evidence.
Deliver The approved application is run locally or deployed to the selected SAP BTP, Cloud Foundry environment.
Acceptance The delivered service and application URL are confirmed.


02-seven-step-completed-run.jpg
One completed Foundry run.
 All seven user-facing stages completed: Intake, Discovery, Build, Verify, Approve, Deliver and Acceptance.

4. What “Guardrailed AI” Means Here

Guardrailed AI is not a claim that the model is somehow prevented from making mistakes. It means the model is placed inside an engineering boundary where its output cannot by itself become accepted application source or bypass the rest of the pipeline.

AI is useful for

  • understanding written business intent;
  • mapping business terminology onto verified source evidence;
  • resolving business semantics that are difficult to express as fixed parsing rules.

Engineering controls own

  • source inspection and provenance;
  • supported structure/capability compatibility;
  • repeatable CAP and Fiori generation;
  • verification, approval and delivery decisions.

The practical consequence is straightforward: an AI response is not a pass condition. If the source cannot support the request, the capability combination is not supported, or the generated application fails verification, the run does not become valid because a model says it looks correct.

Generated projects are also not treated as disposable AI scratchpads. When a reusable generation defect is found, the correction belongs in the Foundry and the application is regenerated.

5. How the Foundry Models Applications

A CAP application is resolved from a small set of architectural dimensions: the business-data shape, the operation model, the source boundary, the capabilities required by the business requirement, and the delivery target.

The current qualification scope covers 19 representative application scenarios across these dimensions. The scenarios are a way to exercise the supported CAP application space consistently; the application itself is still composed from the requirement and verified source evidence.

The application model is compositional:

Dimension Current public-facing choices

Application structure Single entity, association model, parent-child composition, deep composition, recursive hierarchy
Operation model Read-only, draft-enabled CRUD, analytical read-only
Source boundary SQLite, configured HANA HDI, trusted existing CAP, offline EDMX, BTP Destination OData, BTP ABAP objects, bounded two-source applications
Consumer Fiori elements by default, with CAP OData service endpoint exposure
Delivery Local CAP runtime or SAP BTP, Cloud Foundry environment

Feature richness is applied on top of the compatible structure and operation. Validation, ETags, attachments, events and workflow actions are capabilities of an application rather than separate application types. The 19 qualification scenarios exercise this application space without multiplying every compatible overlay into another scenario.

6. CAP Capabilities the Foundry Can Compose

The capability surface is broader than the handful of applications used in the demo. The table below groups the main capabilities without turning every feature into a separate proof table.

Area Capabilities

Core CAP service Projection, filtering, sorting, paging, expand/navigation, read-only OData V4 services and API exposure.
Transactional applications Fiori draft lifecycle, deep CRUD through owned compositions, declarative validation, rollback, cascade ownership rules and optimistic concurrency with ETags.
Business behaviour Calculated fields, stored determinations, persistent semantic numbering, workflow actions, status transitions and Fiori side effects.
Fiori experience Annotation-driven list/object applications, search, localized business text, owned navigation and recursive hierarchy presentation.
Analytics OData V4 dimensions/measures, grouping, aggregation, filters, analytical tables and multiple chart presentations when the requirement asks for them.
Integration Offline EDMX, live Destination-backed OData, approved ABAP source discovery, external-service delegation and bounded two-source application models.
Event-driven processing Transactional business events, outbox/retry behaviour and configurable broker or queued-service delivery.
Documents Attachment upload/download/delete, storage integration and malware scanning integration.
Security & platform Service/row authorization contracts, production authentication resources when required, HANA delivery, SAP BTP Destination service connectivity and deployment packaging for the SAP BTP, Cloud Foundry environment.
Temporal data Validity intervals for compatible writable business objects.

7. Eventing and Attachments Are First-Class Capabilities

Transactional eventing and outbox

A business requirement can ask for an event after a successful business transition. For example, publish an approval event only after an order is actually approved. CAP Foundry can model that event as part of the application contract and generate the CAP-side delivery behaviour with CAP outbox/queued messaging semantics.

The important boundary is transactional: a rolled-back business change must not become a successful external event. Temporary delivery failure can be retried without changing the owning business operation into a second business transaction.

Event delivery is configured at the messaging and deployment boundary rather than embedded as a broker-specific endpoint in the business application. A generated application can use broker-backed messaging or a queued external service, so the eventing route can be selected for the target landscape.

For this implementation, broker-backed delivery was exercised with Solace through CAP messaging. The application still talks to the CAP messaging abstraction; the broker connection and service binding remain environment configuration. That keeps the business event contract independent from the event broker used by a particular deployment.

04-solace-eventing.jpg
Solace-backed event delivery.
 A generated business event is received through the configured messaging landscape while the application remains coupled to the CAP messaging abstraction rather than broker credentials.

Attachments and malware scanning

Attachments are not treated as a decorative upload field. Compatible SAP Fiori elements draft-enabled applications can include upload, download and delete behaviour, storage integration and scan status. For deployment to the SAP BTP, Cloud Foundry environment, the generated deployment can bind object store and malware scanning service bindings so unsafe content can be rejected outside the business-data model.

The demo video shows the user-facing upload and scan-status flow, including a clean scan result.

8. What the Generated Application Looks Like

The result is a conventional CAP project. Depending on the contract, the generated application contains CAP models and services, Node.js handlers where runtime behaviour is needed, SAP Fiori elements annotations and application metadata, generated tests, operational handoff material and deployment artifacts for the SAP BTP, Cloud Foundry environment when cloud delivery is selected.

generated CAP application/
├── db/ CDS domain model and persistence artifacts
├── srv/ CDS service definitions, projections and Node.js handlers
├── app/ SAP Fiori elements applications and annotations
├── test/ Generated behaviour and acceptance tests
├── docs/ Architecture, operations and handover documentation
└── delivery/ SAP BTP, Cloud Foundry deployment artifacts when selected

Repeatable CAP syntax is produced by governed application-generation code and remains tied to the application contract and run evidence.

9. Generation Is Not the Completion Condition

A generated folder is only an intermediate result. Verify independently checks the application using executable CAP and Node.js tooling. The mandatory path covers the areas that matter for a deployable project: model compilation, CAP production build, dependency integrity, clean installation, generated behaviour tests and runtime health. Additional checks are applied when the application uses Fiori, remote sources, security, messaging, attachments or cloud delivery.

The key design rule is that the generator does not mark itself correct and the AI does not mark itself correct.

03-verification-gates.jpg

Executable verification. The run records independent checks for the CAP production build, dependency state, runtime health, artifact integrity, CDS model compilation, supply-chain evidence and generated behaviour tests.

10. Verified Applications

The Foundry was exercised across materially different SAP CAP application patterns. The screenshots below are representative browser-acceptance evidence from generated applications, while the demo video shows the end-to-end flow.

06-supplier-draft-attachments.jpg

Supplier draft maintenance. SAP Fiori elements draft-enabled maintenance with validation, optimistic locking using ETags, and attachments with upload, download, delete and malware scan status.

07-deep-sales-order-navigation.jpg

Deep sales-order application. Sales Order → Item → Delivery Schedule navigation demonstrates a three-level owned composition exposed through SAP Fiori elements.

08-workflow-eventing-fiori.jpg

Business actions and eventing. The generated application combines draft handling, business actions, side effects and attachment handling. Event publication for the same application flow is exercised through CAP messaging and Solace-backed delivery.

09-german-localization.jpg

Localization. Generated SAP Fiori elements labels and application texts are rendered in German while the underlying CAP service contract remains unchanged.

05-hana-analytics-multiple-charts.jpg

SAP HANA-backed delivery analytics. The generated analytical application exposes multiple OData V4 chart views over verified SAP HANA-backed data, together with analytical table and filter support.

11-organisation-hierarchy.jpg

Organisation hierarchy. A recursive parent relationship is rendered as an expandable hierarchy while preserving the parent references in the underlying CAP model.

12-destination-backed-odata.jpg

Destination-backed remote application. Remote OData metadata and business data are consumed through the SAP BTP Destination service, with destination credentials kept server-side.

13-multi-database-draft.jpg

Multi-database maintenance. One draft-enabled CAP application presents data from two explicitly configured database boundaries while preserving the non-atomic failure boundary.

Broker-side event evidence is shown separately in the eventing section because it demonstrates the messaging boundary rather than another SAP Fiori elements presentation type.

11. Local CAP runtime and SAP BTP, Cloud Foundry Environment

Delivery has two current targets: local CAP runtime and SAP BTP, Cloud Foundry environment. SAP Fiori elements applications, OData service endpoints and APIs are outputs of the generated application; they are not separate deployment targets.

Local CAP runtime delivery launches the generated application in a controlled workspace and returns a validated loopback application URL. Deployment to the SAP BTP, Cloud Foundry environment verifies the selected Cloud Foundry org and space, required service bindings, deploys the approved artifact, and then performs acceptance checks against the running application.

Depending on the selected capabilities, the application deployed to the SAP BTP, Cloud Foundry environment can bind the required platform services, including SAP HANA Cloud, authentication and authorization services, SAP BTP Destination service, messaging services, object storage, and malware-scanning services. These are deployment-time service bindings; credentials and secrets remain server-side.

12. What CAP Foundry Does Not Claim

  • It is not a universal CAP generator for every possible CAP/SAP architecture.
  • It does not invent missing source rows, keys, relationships, credentials, roles or business operations.
  • It does not claim one native atomic transaction across independent databases or remote services.
  • The current multi-source read path is intentionally bounded; it is not a general federation/query engine.
  • Remote-service application generation is currently read-oriented.
  • Kyma, SaaS multitenancy and multi-space promotion are outside the current delivery scope.
  • Persistent semantic numbering is not presented as regulated gap-free numbering.
  • Generated application support, automated verification and what is visually shown in the demo are different things; the article does not pretend they are the same evidence layer.

13. Key Takeaways

  • Business intent is the entry point, not CAP syntax.
  • Source evidence remains authoritative. Discovery reads the selected business-data boundary before generation.
  • Guardrailed AI means bounded responsibility. AI helps with meaning; it cannot replace application generation, verification or delivery controls.
  • The product is compositional. Structure, operation, source and capabilities combine into an application contract; 19 qualification scenarios exercise the supported application space.
  • Capabilities go beyond CRUD. Analytics, hierarchy, actions, determinations, ETags, temporal data, eventing/outbox, attachments/scanning, authorization and integration can be composed where compatible.
  • Generation is not success. The application still has to compile, build, test, run and pass the relevant acceptance gates.

Conclusion

CAP Foundry is an engineering prototype for turning business intent and verified data into predictable SAP CAP applications while keeping AI inside a controlled boundary. It can produce materially different applications, transactional SAP Fiori elements maintenance, deep compositions, analytics, hierarchies, remote integrations, event-driven behaviour and bounded multi-source applications without treating every feature as a separate application type.

The useful result is the traceable chain from requirement and source evidence to the generated CAP application, verification and delivered outcome.

This is a prototype and technical demonstration. The supported behavior described here reflects the tested implementation and its current boundaries.

 

  Read More Technology Blog Posts by Members articles 

#abap

By ali