OData

Serving a model as OData — V4, which CAP generates by default from CDS, and V2 for the clients that cannot move: older Fiori applications, SAPUI5 smart controls and integrations built against V2.

Overview

SAP SHIPSby design
Node.js →

@sap/cds Serves every exposed service as OData V4 from the model with no adapter in between, and OData V2 through its proxy.

Java →

com.sap.cds:cds-adapter-odata-v2 The OData V2 protocol adapter for CAP Java, which the runtime serves natively once this beta module is on the classpath, so a V2 frontend keeps working without a change to the CDS model.

com.sap.cds:cds-adapter-odata-v4 The OData V4 protocol adapter for CAP Java, auto-exposing every Application Service in the model at /odata/v4/<Service> without protocol code of its own, active by default in the CDS Maven Archetype.

Not covered: It stops at the V2 runtime. capire marks OData V2 deprecated and recommends it only for existing UIs or for controls that V4 does not support yet. The translation between the two protocols is community code.

Built into @sap/cds

Artifacts7

7 of 7 artifacts
ArtifactSignals
Build tools1
@root3287/cap-segwCompiler from a CDS service to SEGW model and data provider classes
Signals
Functional boundary
CDS plugins3
@cap-js-community/odata-v2-adapterExposes a CAP service as OData V2
Signals
none
@odatano/coreCAP plugin serving the Cardano blockchain as OData V4
Signals
none
@odatano/nightgateCAP plugin indexing the Midnight blockchain, exposed as OData V4
Signals
none
Packages3
@sap/cdsCAP Node.js runtime
Signals
none
com.sap.cds:cds-adapter-odata-v2OData V2 protocol adapter built into the CAP Java runtime
Signals
none
com.sap.cds:cds-adapter-odata-v4OData V4 protocol adapter for CAP Java Application Services
Signals
none

Content24

Group by24 of 24 pieces
Piece, what it offers
Adding Immutable Blockchain Proofs to SAP With CAP - Cardano and OData V4
SAP Community, maxalexweber, BlogThe reasoningRunnable code
UI for the BTP Application Vulnerability Report
SAP Community, Wouter Lemaire, Blog
Create CDS Views and expose through OData service in CAPM
SAP Community, VenkateshMundru, Blog
Show 21 more
The Complete Guide to Calling Actions in UI5 with Custom Code
SAP Community, Marian Zeis, BlogThe reasoningRunnable code
How to Perform Initial Loads from S/4HANA to Advanced Event Mesh with Odata Poll
SAP Community, AlexPfeil, Blog
Calling bound / unbound CAP actions from Fiori elements application.
SAP Community, vidhyasagarmule, BlogThe reasoning
SAP CAP(Cloud Application Programming)开发框架概述
SAP Community, ArthurYang, Blog
#BTP #SAPCAP: Quirky Nuggets (N03-N04)
SAP Community, Ajit_K_Panda, BlogThe reasoningA recipeRunnable code
Core changed
SAP CAP function and action with Unstructured/Dynamic Type Input/Output
SAP Community, Ajit Kumar Panda, Blog
Messaging System for Transferring Error, Warning, and Information Messages from OData V4 Services to HTTP Client Applications
SAP Community, arley-triana-morin, BlogThe reasoningA recipeRunnable code
Core changed
Extend SAP SuccessFactors on SAP BTP with CAP - Create the CAP Service
SAP Community, Alessandro Biagi, Blog
SAP CAP Adapter to expose OData as custom REST Service
SAP Community, Former Member, Blog
Create a Business Service using CDS, Node.js, SQLite and a OData service
SAP Community, raybanton, BlogThe reasoningA recipeRunnable code
Core changed
The End2End Journey: Advocates Service – CAP Service, OData V2/4 & REST in One single Project
SAP Community, KRiedelsheimer, BlogThe reasoningA recipeRunnable code
Core changed
Custom Functions in OData V4 – SAP Cloud Application Programming Model
SAP Community, Roopa_N, BlogThe reasoningA recipe
Core changed
SAP BTP SDK for iOS & CAP with OData V4 support
SAP Community, KRiedelsheimer, BlogThe reasoning
Resolving date serialization issues when using an external OData v2 service with CAP
SAP Community, pieterjanssens, BlogThe reasoning
How to add OData v2 adapter proxy to your CAP project
SAP Community, Wouter Lemaire, BlogThe reasoningRunnable code
Core changed
SAP Cloud Application Programming Model: Deep Insert (5) Consume Remote Service with SAP Cloud SDK
SAP Community, CarlosRoggan, BlogThe reasoningRunnable code
Core changed
SAP Cloud Application Programming Model: Deep Insert (4) Consume Remote Service
SAP Community, CarlosRoggan, BlogThe reasoningA recipeRunnable code
Core changed
SAP Cloud Platform Backend service: Tutorial [11]: CDS : magic: key: generation
SAP Community, CarlosRoggan, Blog
Consume Remote Services in a Full-Stack CAP Application
SAP Developer Center, SAP, WorkshopThe reasoningA recipe
Extend SAP SuccessFactors on SAP BTP with the SAP Cloud Application Programming Model
SAP Developer Center, SAP, WorkshopThe reasoningA recipe
AI-assisted full stack development using model context protocol servers
SAP TechEd — session catalogue, TalkThe reasoning

Seen working5

ArtifactSignals
Samples5
bookshop-demoSimple CDS bookshop model used across CAP explanations
No license
fiori-invoke-functionCalling an unbound CAP Java function from freestyle UI5
No license
fiori-table-maintenanceCAP and UI5 app for in-place table maintenance with SmartTable
No license
SAP-samples/odata-dd-serverCAP Node.js server behind the OData Deep Dive tutorials
none
ui5-call-actionUI5 apps calling CAP OData actions and functions from custom code
No license

Details

What changed — and what it makes stale1
@cap-js-community/odata-v2-adapter 1.10.0, CAP

The OData V2 adapter left SAP and became a community package. SAP's @sap/cds-odata-v2-adapter-proxy stopped at 1.9.21 on 2023-03-24 and now carries a deprecation notice naming its replacement; @cap-js-community/odata-v2-adapter picked the version series up at 1.10.0 twelve days later, which is what makes this a handover rather than a fork. What the adapter does did not change. Who publishes it did.

Makes stale:

Any instruction to install @sap/cds-odata-v2-adapter-proxy. That package has not been published since March 2023 and is deprecated, so guidance written before then names a dependency you should no longer add — including a good deal of the V2 writing from 2019 to 2022.

Coverage
statecore and community, CAP
assessed
relationshipnarrow by design
also inABAP
Comparison properties1

These are the questions used to compare what the artifacts do. Values come from their documentation and may apply to a particular ecosystem or runtime. Each recorded value in the comparison opens its statement and sources.

Protocols
For your agent