SAP's Cloud Application Programming Model (CAP) continues to evolve, with the latest leap being the introduction of the CDS9 Parser—a major upgrade to the Core Data Services (CDS) framework. Designed to enhance performance, developer experience, and processing capabilities, this parser lays the groundwork for next-generation SAP BTP applications.
Whether you're a seasoned SAP developer or just getting started, this guide breaks down everything you need to know about CDS9—from benefits and configuration to migration best practices and future steps.
The rollout of the CDS9 parser is designed to be gradual, offering developers ample time to test and adapt:
This phased approach helps teams prepare for the switch while ensuring backward compatibility during the transition period.
-----------------------------------------------------------------------------------------------------------------------------------------------
Make sure your project is using the latest versions of required packages:
npm install -g @sap/cds-dk cds version
Activate the new parser in your project configuration by modifying the .cdsrc.json:
{ "cdsc": { "newparser": true } }
{ "cdsc": { "newparser": true, "flavor": "parsed", "min": true, "docs": true, "locations": true } }
Test your project using hybrid configurations to check for compatibility:
CDS_FEATURES=new_parser cds test cds compile.to.hana --flavor parsed
You can use the cds repl command for debugging and validating your models:
cds repl > let csn = cds.parse.cdl(`entity Foo { bar : String }`)
If transitioning from an older parser, you can enable fallback mechanisms:
{ "cdsc": { "newparser": true, "legacyFallback": true } }
Once testing is complete, remove fallback settings and deploy with full adoption of the new parser:
cds deploy --to hana --parser new
-----------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------
type Status : String enum { open = 'O'; closed = 'C'; inProgress = 'P' }; entity Orders { key id : Integer; status : Status default #open; }
entity Products { key id : Integer; quantity : Integer @assert.range: [(0), 100]; price : Decimal @assert.range: [0, _]; // _ = infinity }
type Address { street : String; city : String; zipCode : String; country : String; } type ShortAddress : projection on Address { street, city };
-----------------------------------------------------------------------------------------------------------------------------------------------
Upgrade @SAP/cds to v9+ and install the test package:
npm add -D @cap-js/cds-test
Update ESLint to v9.
Use hybrid configurations for testing both old and new parsers:
cds migrate "*" --dry --profile hybrid,production --resolve-bindings
Validate with parsed flavor:
cds compile.to.hana --flavor parsed
-----------------------------------------------------------------------------------------------------------------------------------------------
Remove old settings:
Delete "cdsc.newParser": true from your .cdsrc.json file. It's no longer needed.
Update your tools:
Upgrade all relevant dependencies like @SAP/cds, ESLint, and @cap-js/cds-test.
Use the new features:
Start using enums, projections, and improved validation rules for cleaner, more efficient code.
Test everything:
Run full tests to make sure all models and annotations work correctly with the new parser.
Update CI/CD pipelines:
Add the new parser to your CI/CD setup for automated testing and deployment.
Fix OData V2 compatibility:
If you're using OData V2, install the compatibility adapter with:
npm add @cap-js-community/odata-v2-adapter
-----------------------------------------------------------------------------------------------------------------------------------------------
CDS9 marks a significant leap in SAP CAP development with its enhanced performance, new features, and improved developer experience. By following the outlined steps and best practices, developers can smoothly transition to this new parser and take full advantage of its capabilities.
-----------------------------------------------------------------------------------------------------------------------------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 |