1
votes

is there an example for using TableTree control in SAP Fiori app. I have an OData service already defined with the association. How do I use it in my view?

Below is the view snippet:

                     <table:TreeTable rows="{/Zbpo_Cds_Fkkvp}"
                            selectionMode="None"
                            visibleRowCount="11"
                            showColumnVisibilityMenu="true"
                            enableCellFilter="true"
                            enableColumnReordering="false"
                            class="sapUiSizeCompact"
                            expandFirstLevel="true"
                                >
                            <table:columns>
                           <table:Column>
                            <Text label = "Contract Partner" text ="{gpart}"></Text>
                             </table:Column>
                             <!--<table:Column>
                             <Text text ="{vkont}"> </Text>
                             </table:Column>-->

                            </table:columns>
                        </table:TreeTable>

I have following error: Neither navigation paths parameters, nor (complete/valid) tree hierarchy annotations where provided to the TreeBinding.

Do i need to annotate my CDS view?

Thank you in advance!

2

2 Answers

0
votes

Try to create a view using HIERARCHY statement in hdbview, not in CDS, etc. like this:

VIEW "myview" 
AS SELECT
    "HIERARCHY_RANK" ,
    "HIERARCHY_PARENT_RANK" ,
    HIERARCHY_LEVEL - 1 AS "HIERARCHY_LEVEL" ,
    *
FROM
    HIERARCHY ( SOURCE (
    SELECT
        ID AS node_id,
        PARENT_ID AS parent_id,
        *
    FROM
        "mytable" ) )

then reference this view in your xsoadata definition.