ABAP CDS. A Brief Overview (3)
An overview of options for adding ABAP CDS to an existing or new OData service, as well as creating a new OData service based on ABAP CDS
In this note, I would like to briefly review the possibility of using ABAP CDS when working with OData services.
Adding ABAP CDS to an OData Service
In any OData service developed on the SAP system side, you can import an ABAP CDS view, which will populate a corresponding entitySet
without writing a single line of ABAP code (in the OData service itself).
To demonstrate this approach, I will use a previously created ABAP CDS view and try to assign it to a newly created OData service.
The same actions can also be applied to an existing/active OData service. This is demonstrated in the following video fragment.
I verify this on both involved OData services.
N.B. The presented sequence of actions poses no issues for a SAPUI5 application, which will access the entitySet
populated via the ABAP CDS view.
See the SAP Note SAP UI5. Про объявление модели, oData сервиса в manifest.json и XML View
Service Generation Using OData Annotations
Another way to generate an OData service based on ABAP CDS is by using OData annotations.
See: OData Annotations
Using such annotations is possible in Eclipse IDE.
After activating the changes made to the ABAP CDS view, an OData service is automatically created on the backend system side. However, additional actions are required in transaction /UI2/GW_MAINT_SRV
.
N.B. Please note that after activating changes in the ABAP CDS view, a corresponding warning may appear next to the added OData annotation.

The next video fragment presents the sequence of steps that results in the activation and subsequent launch of the newly created OData service.