OData

Exposing data and operations through OData, including the service model, metadata and protocol versions clients require. Version differences affect which clients can consume a service and which query features they can use.

Overview

InCAPassessed

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.

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
InABAPassessed

In ABAP the OData service is built inside the system that holds the data: modelled in the SAP Gateway Service Builder, implemented as ABAP classes, and registered on the Gateway before a client can call it.

SAP SHIPS

SAP Gateway Service Builder (transaction SEGW) is the design-time transaction for OData services, from modelling through the service development life cycle; a generated service is then registered and activated before a client can reach it.

Not covered: At the generated project. A model change goes back through the Service Builder, and each entity carries the generated CRUD methods whether it uses them or not, which is the ground a lighter framework takes.

The community answers beside the Service Builder in several ways: odata-fw replaces its generated classes, cap-segw generates the Gateway classes from a CDS service, and Open Steamgate and open-abap-odata run SEGW services outside an SAP system. Smaller pieces ship a single service. How these relate to the Service Builder has not been assessed.

Artifacts12

Group by12 of 12 artifacts
ArtifactSignals
Apps1
open-steamgateLocal ABAP server serving /IWBEP/ OData v2 without an SAP system
Signals
Functional boundary
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
Packages6
@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
launchpad-kpiPuts a number from an abap2UI5 app on a Fiori launchpad tile
Signals
Functional boundary
odata-fwABAP framework for OData services with one class per entity
Signals
none
open-abap-odataOData and Gateway shims serving SEGW-style services on Node.js
Signals
none
Web tools1
OData Batch CreatorBuilds OData batch request payloads from an uploaded $metadata file
Signals
Functional boundary

Content45

Group by45 of 45 pieces
Piece, what it offers
What's new with draft handling in RAP?
YouTube — SAP Developers playlists, Andre Fischer, Talk
A Guide to CDS Metadata Extensions, Fiori App Generation and SAP UI5 Controller Extensions
SAP Community, ankitapaul229, Blog
The Fourth Way to Go Offline in UI5 (And Why the Service Worker Stays Dumb)
SAP Community, Noel_Hendrikx, Blog
Show 42 more
From SEGW to @OData.publish: Expose Your CDS View as OData in S/4HANA
SAP Community, rupalipunekar1234, Blog
How to rename an OData V4 service?
SAP Community, Andre Fischer, Blog
Adding Immutable Blockchain Proofs to SAP With CAP - Cardano and OData V4
SAP Community, maxalexweber, BlogThe reasoningRunnable code
OData $batch Deleting Records Across Multiple Tables in Single Transaction
SAP Community, Abhi_0118, Blog
Extending Standard S/4 HANA OData API's
SAP Community, JuanDK78, Blog
Moving from Hub Gateway to Direct S/4HANA OData V4: A Customized Reusable RAP Processing Framework
SAP Community, AnslemArnolda, Blog
UI for the BTP Application Vulnerability Report
SAP Community, Wouter Lemaire, Blog
S/4HANA公有云版的内部ABAP拓展
SAP Community, ArthurYang, Blog
OData Deep Insert: Implementation and Real-Life Examples
SAP Community, SRSATAPATHY, Blog
Create CDS Views and expose through OData service in CAPM
SAP Community, VenkateshMundru, Blog
Step-by-Step Guide to Display System Details on SAP Fiori Launchpad Shell
SAP Community, RahulManchala, Blog
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
Generating Adobe Form Using RAP framework OData Services
SAP Community, Megastar, Blog
Calling bound / unbound CAP actions from Fiori elements application.
SAP Community, vidhyasagarmule, BlogThe reasoning
Graph intro series, part 8: Use Graph With OData v4
SAP Community, florian_moritz, Blog
SAP CAP(Cloud Application Programming)开发框架概述
SAP Community, ArthurYang, Blog
Exposing Calculation View with Dynamic Client via OData API
SAP Community, Willem Pardaens, BlogThe reasoningA recipeRunnable code
Use Aspects, Association and Convert OData V4 to V2 using Proxy
SAP Community, rahul_rajagopal, BlogThe reasoning
#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
Dynamic OData from "any" API through SAP BTP Kyma
SAP Community, Gunter, BlogThe reasoningA recipeRunnable code
Create a Business Service using CDS, Node.js, SQLite and a OData service
SAP Community, raybanton, BlogThe reasoningA recipeRunnable code
Core changed
SAP Tech Bytes: Adding Service Implementation to an SAP HANA Project
SAP Community, Thomas Jung, Blog
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
Is it time to switch to OData v4?
SAP Community, MikeDoyle, BlogThe reasoning
SAP HANA XSA pt. 2 – Smart variants, OData v4 -> v2
SAP Community, Gunter, BlogThe reasoningA recipe
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
OData entity as a governed query surface for agents, not a tool
SAP TechEd — session catalogue, TalkThe reasoning
AI-assisted full stack development using model context protocol servers
SAP TechEd — session catalogue, TalkThe reasoning
SAP Fiori elements and the age of AI: Build apps that are future ready
SAP TechEd — session catalogue, TalkThe reasoning

Seen working6

ArtifactSignals
Samples6
bookshop-demoSimple CDS bookshop model used across CAP explanations
No license
building_gateway_servicesABAP code and slides from a talk on building SAP Gateway services
none
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
state in ABAPcore and community, 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