Service is not active OData Exposure from SAP CDS View
It is possible to expose a CDS View as an OData Service using annotation @OData.publish:true in CDS view definition. On SAP HANA Studio or ABAP Development Tools, if you get errors on OData exposure like "Service ... is not active", ABAP developers can solve the problem and activate the service using SAP Activate and Maintain Services transaction
First of all, ABAP programmers should use the ABAP Development Tools for creating the DDL source of the CDS view.
As a second step create the CDS view DDL source and add OData annotation @OData.publish:true in the CDS view definition as follows:
With the activation of the CDS view the SADL (Service Adaptation Description Language) framework creates the OData model definition and the service runtime automatically.
Recently, when I activated my sample CDS view which has the @OData.publish attribute, I got following warning messages.
Although the CDS view created and activated, the OData was not.
Here is the warning message related with OData publishing directly from CDS view using annotations
Service /../SOM_INF_INVOICE_CDS is not active [OData Exposure]
The solution for this error which prevents consuming of CDS view data by an OData service is as follows:
Using SAP transaction /IWFND/MAINT_SERVICE Activate and Maintain Services transaction, switch to "Add Selected Services" screen using the "Add Service" button
In the Backend Services list waiting to be published, you will find the CDS view OData service.
If you click on the technical service name and display details about the OData service, you will realize that some information is missing like the Package Assignment.
Besides package assignment, a second point that I would like to correct at this point is the technical service name and the technical model name missing namespace replaced with "Z" name.
After package assignment and other modifications are completed, click OK to add the Odata service to the Service Catalog
Now SAP users or ABAP developers can call and test OData service published from CDS View with @OData.publish:true annotation on SAP Gateway Client tool.