cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Custom Hierarchy in ABAP CDS

THENNARASU
Explorer
1,194

Hi All,

I'm working on creation of Query CDS which is used in SAC/AFO for building dashboards. In this we want to Implement a Hierarchy in a particular field I have created a custom table where I have maintained the hierarch nodes accordingly.

THENNARASU_0-1749703864311.png

I  want consume this hierarchy through the CDS to AFO/SAC.
I have tried using annotations in base cube like this ,

THENNARASU_1-1749704030149.png
I defined the hierarchy in a cds with self association. and through annotations I imported the hierarchy on field called ZdimGrpaccnt.

THENNARASU_2-1749704064890.png

Then I consumed this CDS in a Query CDS.

THENNARASU_3-1749704292215.png



While consuming it in AFO the hierarchy is not enabled on the column.


Also I tried through define hierarchy Approach. It is also not working

THENNARASU_4-1749704363207.png

 

While testing the hierarchy through the Class and table function, I'm getting the hierarchy as needed.THENNARASU_5-1749704687162.png

THENNARASU_6-1749704730991.png

 

 


Can Somebody please suggest how to achieve hierachy in AFO/SAC in this scenerio.
please provide some detailed steps of what needs to be done.


Many Thanks in Advance,
Regards,
Arasu

Accepted Solutions (0)

Answers (2)

Answers (2)

MKreitlein
Active Contributor

Hello @THENNARASU @gowripujithakapu 

I'm not sure, but it seems, you have not found this support page?

https://wiki.scn.sap.com/wiki/display/BI/Using+Hierarchy+in+CDS 

It seems in your Query cds view, you are missing the annotation:  @Consumption.filter.selectiontype: #HIERARCHY_NODE

Hopefully, you find some more helpful information there?!

BR, Martin

gowripujithakapu
Explorer
0 Likes
I have developed using the link but still custom hierarchy cds is not working
gowripujithakapu
Explorer
0 Likes

In mycase, it worked by using standard hierarchy cds node instead of custom one.