cancel
Showing results for 
Search instead for 
Did you mean: 

How to display the record with parent key <> null in a table with tree

Former Member
0 Kudos

In a table with tree by key, if there is a series of records in which the parent key of the top node is not equal to null, how to display this records?

PS: The parent key value should not be changed and the table should not display an additional row.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_szcs
Active Contributor
0 Kudos

Hi Wei,

As far as I know the parent key needs to be initial for the top row. A workaround would be to create an additional attribute and fill it with an artificial parent key. In case you are using a DDIC structure at the node in question, you could add a sub node of 1:1 cardinality and place the attribute there.

Best regards,

Thomas

P.S: I forwarded your question to a colleague of mine who happens to be the expert for the table. Perhaps he knows another solution.

Uwe_Klinger
Advisor
Advisor
0 Kudos

Hello Wei,

Actually the "TreeByKeyTableColumn" (ABAP) requires that all elements on the top level have an <b>initial</b> parentKey value. Its not possible to set a different key as top level parent key. "initial" means the initial value of the context attribute's data type.

For sake of performance I would rather create an extended DDIC structure which takes the key/parentKey if needed than using an sub node as Thomas suggests.

Best Regards,

Uwe

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi colleagues,

I wonder why the "TreeByKeyTableColumn" (ABAP) requires all elements on the top level have an <b>initial</b> parentKey value. Why not use other strategies to display the hierarchy? for example, if the parent key value of a record is not found in other records, this record will be taken as top node. Do you think this suggestion could be implemented?

Best regards, wei

Uwe_Klinger
Advisor
Advisor
0 Kudos

Hello Wei,

I rather prefer the currently shipped algorithm. I think your suggested behaviour will make the TreeByKeyTableColumn harder to understand and use. Further the implementation would require to check all parentKeys with the existing keys, which could harm the performance significantly.

Best Regards,

Uwe