cancel
Showing results for 
Search instead for 
Did you mean: 

Tree expanded by default

Former Member
0 Kudos

Hi All,

I just wondering if i can expand tree in wda by default so all subordinats are shown w/o clicking nodes one by one .

What method should i use?

Thanks a lot for your sharing and consideration.

BR,Drikavide

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ardhik Drikavide ,

For expanding all the nodes in the tree you have to loop the whole data in the tree, inside each loop , based on index you have to set the expand property.

ie Set each node as expanded and then bind the itab to tree.. thats all.

Regards

Sarath

Former Member
0 Kudos

Hi Sarath,

can u more specific about set each node as expanded? i mean what method should i call a for that, or i just click expanded property at layout studio for the node?

Thanks for make solution getting closer.

BR, ADrikavide

Former Member
0 Kudos

Hi Ardhik Drikavide ,

Really sorry , i cant login to system right now, or else i can paste the code directly. how i solved this problem is like.. i loop the itab , then on each loop , set the property of the element to expanded then i bind the element to the node... Once this node is binded to the tree UI then it will Display all expanded.

Regards

Sarath

Former Member
0 Kudos

Ok thanks Sarath.

I'm looking forward for your codes.

Bye. ADrika.

Former Member
0 Kudos

Hi Ardhik Drikavide

,

For the node that’s binded to the table, create an attribute say is_epanded and bind this attribute to the is expanded property of the tree.

Now for expanding all the nodes read the node to an itab

Loop the itab

Set the value of field is expanded as true..

Endloop

Bind back the itab

Like

CALL METHOD node_name->get_static_attributes_table

  • EXPORTING

  • from = 1

  • to = 2147483647

IMPORTING

table = lt_tab

.

****Expand all Nodes and Bind

LOOP lt_tab INTO wa_tab.

IF condition.

wa_tab-expanded = abap_false.

ELSE.

wa_tab-expanded = abap_true.

ENDIF.

APPEND wa_tab TO itab2.

ENDLOOP.

node_name->bind_table(itab2 ).

Regards,

Sarath Satheesan