Advice for a Tree-like Data Structure please!

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Posts: 488
Joined: Fri Jan 23, 2004 10:39 am

Advice for a Tree-like Data Structure please!

Post by sapmanie » Wed Mar 01, 2017 7:26 am

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!

Posts: 1955
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

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

Post by Gothmog » Mon Mar 06, 2017 4:49 am

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.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67

Post Reply