cancel
Showing results for 
Search instead for 
Did you mean: 

WD ALV TREE partially

Former Member
0 Kudos

Hello friends,

I have a task to create ALV view as below 

http://imageshack.us/a/img600/5813/3m9e.jpg

I have 2 ideas.

1st is to make a hierarchical ALV. But I haven't found the way how to make the first line not expandable.

The second is to make toggle button in the first column, but it has yellow background, I need white.

Does anybody know, how to achieve it?

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

amy_king
Active Contributor
0 Kudos

Hi Alexandr,

When you say you want to have the first row of the hierarchy "not expandable", I think what you mean is you want the first node to be expanded by default and not allow the user to collapse that node, is that right?

The idea of a hierarchy is to allow that expand/collapse ability for parent nodes, so while it is possible to expand by default, it isn't possible to remove the ability to collapse a node that has children.

Your options I think are...

  • A leaf is not expandable, so a node with no children will not have the option to expand/collapse. If the first row truly has no children, you can display it as a leaf.

  • In an ALV, it is possible to expand all hierarchy nodes by default, though you can't specify specific nodes to expand/collapse, it's all or nothing. See method SET_EXPANDED of interface class IF_SALV_WD_TABLE_HIERARCHY (implemented by class CL_SALV_WD_CONFIG_TABLE). Here is some documentation.

  • To be able to specify that specific nodes are expanded or collapsed, you might consider using a regular Table element with a TreeByKeyTableColumn for the hierarchy column. This element has properties expanded and isLeaf which give the developer more control over the state of the hierarchy than an ALV. The element also has an event onToggle, which you maybe could capture and force the node to stay expanded when the user tries to collapse it. In your system, take a look at demo component WDT_TREE_TABLE_BY_KEY.

Cheers,

Amy