Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Getting taxonomy tree structure using MDM Java API

Dear All,

I want to display the Texonomy tree structure as displayed in the Data Manager for a taxonomy table.I am using the following code to get the parent node and children :

WebTreeNode wtn = catalog.GetHierarchy("<taxonomy table name>",<node ID>); (node ID:0 for root)

WebTreeNodeArray wtna = wtn.GetChildren();

Then I want to loop through the array to get each child node and subsequently for other sub nodes till i reach the leaf nodes.

However the problem is that the tree structure does not follow a fixed pattern , meaning to say that each node may have 0 to n child nodes.I can't figure out a logic to put all the nodes under one parent inside a List and then probably put them into a Map with name of the parent as Key.If anybody can help to device the (recursion)logic , i'll be thankful.

Former Member
Not what you were looking for? View more on this topic or Ask a question