cancel
Showing results for 
Search instead for 
Did you mean: 

troubles when trying to transfer a table with hierarchical column to a tree

Former Member
0 Kudos

In WD for ABAP, I encounter many troubles when trying to transfer a table with hierarchical column to an actual tree. In my UI, the tree is in the left pane and the detail for a node is in the right.

1. With hierarchical table, I can bind the dataSource of the table directly to the context node in View which is mapped to a context node in component controller which is a DDIC structure. But with a tree, is it possible to map the dataSource of the tree or node in tree to context node in component controller?

2. With hierarchical table, when lead selection changed, the detail info in the right pane will change automatically. But with a tree, it seems to have to be implemented via action by myself.

Can anyone give some suggestions to overcome these troubles?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Wei,

1. Yes, it is possible. Mapping is independed of UI elements used. Any structure could be mapped.

2. Create & assign empty handler for onAction of TreeNode(s) / TreeItem(s)

Valery Silaev

EPAM System

http://www.NetWeaverTeam.com

Answers (4)

Answers (4)

Former Member
0 Kudos

The conclusion is that the tree UI element is not suitable for this case. Although I fulfilled all functions more or less.

Former Member
0 Kudos

Hi Valery,

could you please suggest a link to the tutorial ?

Thank you very much.

regards, wei

Former Member
0 Kudos

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial%20on%20creating%20a%20tree%20structure%20in%20a%20table%20-%2027.htm">Creating a Tree Structure in a Table</a>

VS

Former Member
0 Kudos

Thank you for your help although this documentation is not so helpful to me. What I am interested is how to use a real tree UI element to implement an application. But it seems that most of info is about the table or tree table.

Former Member
0 Kudos

Hi,

did you have a look at this? http://help.sap.com/saphelp_nw04s/helpdata/en/21/ad884118aa1709e10000000a155106/frameset.htm

There are examples of trees in the system in component WDR_TEST_EVENTS in the views starting TREE_

Regards, Heidi

Former Member
0 Kudos

Hi Valery,

For example, there is a context node (named with ORG_UNIT)in component controller which is corresponding to the table of org unit. The org units make up a hierarchy by key and parent key. In the view, there is a context node called TREE_NODE, and it has a recursion node called NODE_CNT. Then where should I map the context node ORG_UNIT ?

Former Member
0 Kudos

Wei,

Given the structure you have just described, and your original question...

<i>In WD for ABAP, I encounter many troubles when trying to transfer <b>a table with hierarchical column</b> to an actual tree. In my UI, the tree is in the left pane and the detail for a node is in the right.</i>

...I'm just wondering how you apply such structure to tree table.

Is node ORG_UNIT in component controller recursive node?

VS

Former Member
0 Kudos

Hi vallery,

With tree table, the dataSource of the table is just bound to the context node ORG_UNIT. When you change the selection of org unit in the hierarchy, the other info of this org unit will appear in the right hand side.

In this case, can I just map ORG_UNIT to TREE_NODE ?

Former Member
0 Kudos

Wei,

<i>With tree table, the dataSource of the table is just bound to the context node ORG_UNIT</i>

Hmmm... You said, that this node resides in component controller, not in view controller. Or does it?

Any recursive node that can be displayed with tree table can be displayed with tree as well. Period.

1. Create tree and bind data source to the same node as table data source.

2. Create tree node type and bind it to the same node again.

3. Create one additional calculated attribute in forementioned node (type boolean) that inverts/negates attribute for table column "hasChildren" to tree node "isLeaf".

4. That's all.

VS

Former Member
0 Kudos

Hi Valery,

I followed the steps you mentioned above. I added a recursion node under the ORG_UNIT node, which is also set as the repeated node for the recursion node. But how to display the records as a hierarchy in a convenient way? (Every record has an Id and a parent Id)

Message was edited by: Wei Tang

Former Member
0 Kudos

Wei,

There is a plenty of blog posts / tutorials regarding this issue.

Small hints -- ORG_UNIT should be a recursive node itself, ORG_UNIT must have a supply function that populates current level based on ID from parent element if any or just supply "root" org units if parent element is context element.

VS

Former Member
0 Kudos

But I noticed that if the parent of a context node in View is not mapped, the context node can not be mapped either. As a tree requires a context node acting as the root node for the tree, the subnode may not be mapped to a context node in component controller as a result.

Former Member
0 Kudos

Wei,

<i>As a tree requires a context node acting as the root node for the tree</i> -- root (for IWDTree) and first level (for IWDTreeNode) may be the very same context node.

So there should be no problems. Thoughts?

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com