Page 1 of 1

Advice for a Tree-like Data Structure please!

PostPosted: Wed Mar 01, 2017 7:26 am
by sapmanie
I need to update and search data which is organized in a tree like structure, i.e. the data is organized as a parent-child, with a parent able to have 0...M children, and those children able to have 0...M children themselves, up to a depth of probably 10 or so.

1) Could the SAP ALV classes (CL_SIMPLE_TREE_MODEL/CL_LIST_TREE_MODEL/CL_COLUMN_TREE_MODEL) be used for this kind of processing, considering that the tree will not be used to display data - it's just the most logical format for the data.
The benefit of using these classes is of course the logic for adding/updating and searching is already there. I just don't know if they are built for this kind of processing. The child could also have multiple parents. Access will be almost like random access: any child could be selected in the tree, and I would need to return the full tree, from (all) the parent(s) to the child, and anything below the child if applicable.

2) on the subject of data storage, What would be the 'best' data storage format for fastest data retrieval - tables, cubes? There will be one major initializing update at the start, to populate the parent-child relationships, after which updating relatively small number nodes will happen occasionally but never as frequently as searching.

Any thoughts are welcome, thanks!

Re: Advice for a Tree-like Data Structure please!

PostPosted: Mon Mar 06, 2017 4:49 am
by Gothmog
I think the blocking point for using these classes would be :
The child could also have multiple parents
The built-in assumption is a single parent for a node.