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

Hierarchy display childs from a specific node

JaimeRodriguez
Participant
0 Likes
255

Hi everyone,

We've built a hierarchy CDS to manage some configuration and the tree view is displayed correctly from the list report table:

JaimeRodriguez_0-1763469246007.png

We'd like to display the hierarchy from a specific node in the object page, displaying all the subnodes recursively, so we added the _Child association to the annotations to display the table:

@odata.hierarchy.recursiveHierarchy: [ { entity.name: '/RHP/I_ConditionCodeHN' } ]

@ObjectModel.semanticKey: [ 'Code' ]

@UI.presentationVariant: [ { sortOrder:                   [ { by: 'ParentOrder', direction: #ASC },
                                                            { by: 'Code',        direction: #ASC } ],
                             recursiveHierarchyQualifier: '/RHP/I_ConditionCodeHN',
                             initialExpansionLevel:       3 } ]

define root view entity /RHP/C_ConditionCodeDetail
  provider contract transactional_query
  as projection on /RHP/I_ConditionCode
{

     @ui.facet: [ ...
                  { type:          #LINEITEM_REFERENCE,
                    label:         'Relations',
                    position:      200,
                    targetElement: '_Child' } ]

      ...

      /* Associations */
      _Parent : redirected to /RHP/C_ConditionCodeDetail,
      _Child  : redirected to /RHP/C_ConditionCodeDetail

}

 But the displayed table doesn't display the hierarchy:

JaimeRodriguez_1-1763469785293.png

I also tried creating a Fiori Elements application and setting tree table type and the hierarchy qualifier, but an error is raised:

JaimeRodriguez_2-1763469929168.png

Anyone know if it's possible to do that and how?

Thank you!

0 REPLIES 0