Capture OData-related aspects to expose data gained from a CDS entity in an OData service.
@Scope:[#VIEW, #TABLE_FUNCTION] Annotation OData { publish : Boolean default true; };
Annotation | Meaning | |
---|---|---|
OData.publish |
OData.publish is intended for generating an OData service. Scope: [VIEW, TABLE_FUNCTION] Evaluation Runtime (Engine): SADL Values: |
|
Value | Description | |
true |
Has to be set to generate an OData service |
|
false |
Defines that this CDS entity cannot be exposed for an OData service |
When the CDS entity is activated, the OData service is generated automatically. After activation, it can be opened from the ABAP Element Information popup of the corresponding database table.
Subsequently, the OData service also needs to be activated in the transaction /IWFND/MAINT_SERVICE manually.
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.
@OData.publish:true define view SEPM_I_SalesOrder as select from snwd_so { ... }