Skip to Content

How to reuse (merge) OData annotations?

Jul 18, 2017 at 11:54 AM


avatar image

Dear experts,

Does anyone know how to reuse some parts of OData annotations?

Let's say we have an example:

We have two OVP cards. Each of them requires separate filter, defined in UI.SelectionVariant annotation.

However this filter can have a common condition.

What we do now - we annotate these cards separately and maintain filters synchronously which is not nice.

I tried to use construction Annotation -> Reference -> includeAnnotation but it didn't work.

I guess it must be something very simple - but I didn't find any anwer in SDK.

Can edm:AnnotationPath be useful?

Thank you!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member
Jul 21, 2017 at 09:38 AM


If I understand you correctly, you want to use the same annotations for multiple cards.

Have you tried using qualifiers?

After specifying them in CDS, you can use the same in the cards as 'something.annotation#qualifierName'

Show 1 Share
10 |10000 characters needed characters left characters exceeded


Not exactly. Let's say I have condition A - it's set of different parameters. Same for B and C.

Now one card I need to annotate with A and B. Other one with A and C.

What I do now I create two annotations with two different qualifiers and copy A to both which leads to code duplication.

I didn't find the way how I can create annotation containing only A (UI.SelectionVariant for example) and reuse it in other annotations along with B and C conditions.