Showing results for 
Search instead for 
Did you mean: 

Recursive Hierarchy in CAP

0 Kudos

Hi CAP friends,

I have been struggeling with implementing a recursive hierarchy view in my CAP application.

I have a database table HierachyNode which represents an organisational hierarchy:

Customer Center 1->* Sales Organisation 1->* Country 1->* Customer.

Every node in the hierarcy can have 0...* functionalities, and when we read a node, we want to inhert all functionalities defined in the parnent nodes.

entity HierarchyNodes {<br>    key id                 : String;<br>        name               : String;<br>        parent             : Association to one HierarchyNodes;<br>        level              : Integer;<br>        lineage            : String;<br>        type               : String enum {<br>            CC;<br>            SALESORG;<br>            COUNTRY;<br>            CUSTOMER<br>        };<br>        virtual drillstate : String enum {<br>            expanded;<br>            Leaf;<br>        };<br>        functionalities    : Association to many NodeFunctionalities<br>                                 on functionalities.node = $self;<br>}<br>entity NodeFunctionalities {<br>    key node          : Association to one HierarchyNodes;<br>    key functionality :  String;<br>    key value         : String;<br>}

I found the following blog online about recursive CDS views in ABAP:

Is something similar possible in CAP? The annotations used in the blog are throwing errors. Are there examples available?

Happy holidays!


Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Answers (0)