Skip to content

Migrating from SAP CAP ​

The SAP Cloud Application Programming Model® (SAP CAP) and Atscript are separate tools that both work model-first: one model defines and glues the database, the service and the UI. Atscript is MIT open source end to end and runs on PostgreSQL, MySQL, SQLite or MongoDB, on any Node.js host. This guide shows how to move an SAP CAP application there one step at a time, with a working application after every step.

Why teams look at it ​

The license ​

Since SAP CAP v9 (released May 2025), the SAP CAP components that are not published under an open-source license ship under the SAP Developer License 3.2 CAP. SAP's license page for SAP CAP states that productive use is allowed for applications "operated on BTP or any other platform licensed from SAP", and that in other setups "CAP shall only be used for testing purposes and/or non-productive use". The page adds that the change is not retroactive.

The page also notes what did not change: "Many CAP components and CAP plugins are already open source (mostly with Apache License 2.0)", and productive use on SAP platforms comes with official SAP support. If you run on BTP or another SAP-licensed platform, the license may suit you well. If you want to run on infrastructure of your own choice without an SAP platform license, it is a reason to plan a path.

Not legal advice

The quotes above are from SAP's page at the time of writing. Read the license for your own setup, and ask your legal team where it matters.

Other reasons ​

  • One language for the model and the code. An Atscript model compiles to TypeScript types, runtime metadata and validators. There is no second type system to keep in step with your code.
  • Any database Atscript DB supports: PostgreSQL, MySQL, SQLite or MongoDB, with schema sync from the model.
  • A Vue UI from the model, with forms, smart tables and value helps, which you can restyle and extend like any Vue component.

Fair to say what SAP CAP and SAP Fiori® elements do well: SAP CAP is a mature framework with deep integration into SAP platforms, services and tooling, and Fiori elements renders complete, consistent SAP-style applications (list reports, object pages, draft handling) from annotations, with SAP's design system and accessibility work behind it. Atscript UI is a component library: it gives you forms, tables and value helps from the model, and you compose the screens. Choose by what you need.

One model, every layer ​

In both, the data is described once, with annotations, and every layer reads that description. Each tool does it in its own language, with its own building blocks:

LayerSAP CAPAtscript
Model.cds entities, types, aspects, annotations.as interfaces, types, annotations (Atscript)
Databasecds deploy, CQL (SELECT.from(…))asc db sync, the table API of Atscript DB
Serviceservice … { entity … }, ODataMoost controllers per table, Atscript DB's REST protocol (Moost DB)
Logicsrv.before / on / after handlerscontroller hooks: onWrite, transformFilter, guardWrite, …
Authorization@requires, @restrictAooth: roles, @ArbacResource, @ArbacAction
UIFiori elements from @UI annotationsAtscript UI from @ui and @meta annotations

The concept map pairs the details, annotation by annotation.

The path ​

Each step leaves a working application, and each can be the last one.

  1. The UI first. Keep the SAP CAP service as it is. Generate Atscript models from its $metadata with Atscript OData, and build the new screens with Atscript UI, in the browser or behind a Moost server.
  2. Move the services. Model the entities in .as files with Atscript DB, and serve them with Moost controllers on PostgreSQL, MySQL, SQLite or MongoDB, one service at a time. The screens keep their components: they read an Atscript DB endpoint the way they read OData.
  3. Drop the SAP CAP runtime. When the last service has moved, remove the SAP CAP dependencies. The stack is MIT open source and runs on any Node.js host with the database you choose. The checklist is at the end of Move the services.

The worked example takes a small bookshop through all three.

What each page covers ​

SAP, SAP S/4HANA, SAP Fiori, SAPUI5, SAP BTP and other SAP products and services mentioned herein, as well as their respective logos, are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. Atscript OData is an independent open-source project and is not affiliated with, sponsored or endorsed by SAP SE.
Released under the MIT License.