cancel
Showing results for 
Search instead for 
Did you mean: 

'Expand All' icon in a tree structure?

Former Member
0 Kudos

Hi experts,

If we create a tree UI element in ABAP WD, we automatically get a 'Collapse All' icon.Is it possible to have a 'Expand All' icon as well?

thanks in advance,

Pras

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

On the tree root (TREE UiElement), there's a property for "onExpandAll" Event.

Just put the name of an action, and then implement your "expand all" method; yes you do have to code yourself, like others said. The only difference between a custom button is that the newly coded functionality is shown beside the default collapse button.

former_member182190
Active Participant
0 Kudos

Hello Pras,

You will not get any Collapse All icon when you create a tree UI Element .

You can expand or collapse the tree by clicking on the Parent Elements in the tree.

If you want to explicitly handle the Expand All and Collapse All functionality you need to put a button in the toolbar with name Expand ALL and handle it explicitly by setting attribute EXPANDED to abap_true for each and every element in the tree for Expand All action and vice versa for Collapse All.

Hope this is of some help.

Regards,

Ismail.

Former Member
0 Kudos

Hi Ismail,

Thanks for your reply.

I am afraid we get a 'Collapse All' icon at the right hand side by default.Please refer to the example program WDT_TREE.

Maybe I am missing something here?

thanks,

Pras

toni_fabijancic
Explorer
0 Kudos

Hi Pras,

you are right, there is a 'Collapse All' icon by default.

What I wanted to know from you is, if you got a solution for your problem with the 'Expand All' functionality?

I need the same functionality for a recursive tree.

Regards,

Toni

Former Member
0 Kudos

Hi Toni,

you have to put a button for Expand all. Then on the action of that button read the whole node to an itab, then loop the itab.. then fro each record,

attach to a new element

make the property expanded for the element

add the element to the node..

After looping bing the itab back to node,

Regards

Sarath