cancel
Showing results for 
Search instead for 
Did you mean: 

Annotations in HANA CDS View based OData Service

felix_guldner
Explorer
0 Kudos

Hi,

I'm using an XSODATA Service on top of several HANA CDS Views. Is it somehow possible to define annotations like "sap:text", "sap:aggregation-role", "sap:unit" in the View/XSODATA in order to consume this information on the UI?

In a previous discussion I found that "sap:label" is not yet supported, but is that also true for the other annotations? And if yes, are there any plans to support these annotations in the future? There are many controls/frameworks which rely on these annotations.

Unfortunately putting a modeled view on top is currently not an option (we're still on SPS 9) and in principle we want to reduce the usage of modeled views as much as possible.

Thanks and best regards

Felix

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can use the XSODATA syntax:

annotations {

   enable OData4SAP;

}

This will give you some of the sap specific annotations (unit, label, etc). However this feature only works if the source of your entity is a modeled view and you've maintained this semantic information in the model.

felix_guldner
Explorer
0 Kudos

Hi Thomas,

I already know how to activate the annotations via a modeled view. But since everything seems to move towards CDS Views, I just wanted to double-check that there is no possibility to define the annotations directly there and expose them in XSODATA.

I don't really understand this because annotations in ABAP CDS Views are already possible. Why do HANA CDS Views offer less functionality? Expecially these annotations are quite important nowadays...

Best regards

Felix

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>I don't really understand this because annotations in ABAP CDS Views are already possible. Why do HANA CDS Views offer less functionality?


ABAP CDS and HANA CDS have different priorities and therefore deliver different features at different rates. For instance the ABAP CDS can focus entirely on advanced views, where as the HANA CDS is also used for table creation and transactionality.  I think we certainly will eventually get to the point where we can support such semantics at the HANA CDS level. We recently had a discussion with development about how we might support column labels in the future, for instance.

sdebeaulieu
Participant
0 Kudos

This message was moderated.

WRoeckelein
Active Participant
0 Kudos

Is there any progress in this area a year later?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The additional annotation functionality is still in the HANA roadmap and planned currently for delivery in 2017.

Answers (0)