Show TOC

OData AnnotationsLocate this document in the navigation structure

Capture OData-related aspects to expose data gained from a CDS entity in an OData service.

Scope and Definition
Annotation OData
   publish : Boolean default true;
Annotation Meaning

OData.publish is intended for generating an OData service.


Evaluation Runtime (Engine): SADL - Generates the OData service


Value Description

Has to be set to generate an OData service


Defines that this CDS entity cannot be exposed for an OData service


When the CDS entity is activated, the OData service is generated automatically. Before you can open and use the OData service, it also needs to be activated using transaction /IWFND/MAINT_SERVICE manually. For further information, see the Related Information below.

You can then start the generated OData service through your Eclipse-based IDE. To do this, choose F2 from the name of the CDS entity that is used in the define view statement. The ABAP Element Information popup is then opened. In the Generated Objects section, the OData Service link is provided. After clicking the link, the default Internet browser is opened and displays its XML code.


This example demonstrates how you can define the SEPM_I_SalesOrder CDS entity that exposes data to an OData service.

Here, an OData service is generated for the CDS entity. The data is provided from the database table snwd_so.

Sample Code
define view SEPM_I_SalesOrder as select from snwd_so {