on 2021 Dec 24 3:24 PM
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: https://blogs.sap.com/2020/01/13/abap-cds-recursive-association-using-hierarchy/
Is something similar possible in CAP? The annotations used in the blog are throwing errors. Are there examples available?
Happy holidays!
Thomas
Request clarification before answering.
Please find an example here:
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
9 | |
8 | |
7 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.