cancel
Showing results for 
Search instead for 
Did you mean: 

Event for expand and collapse in TreeByKeyTableColumn

Former Member
0 Kudos

hi,

what is the Event for expand and collapse in TreeByKeyTableColumn?

Can anyone help on this.

Best regards,

Rohit

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Events are always documented in the online help:

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/59/a98b411fb4b05fe10000000a1550b0/frameset.htm

There is no such event for the TreeByKeyTableColumn. Only an onLoadChildren event.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

There is no event to expand or collapse.

create an attribute 'EXPANDED' of type wdy_boolean in the context and bind it to the property ' Expanded' of TreeByKeyTableColumn.

and write the code accordingly to expand or collapse in wdmodifyview method. for example

CALL METHOD lo_nd_tree_node->get_selected_elements

RECEIVING

set = lt_temp.

LOOP AT lt_temp INTO wa_temp.

lo_el_tree_node->set_attribute( name = `EXPANDED` value = 'X' ).

ENDLOOP.

Regards,

Lakshmi.

Edited by: Lakshmi Atukury on Jan 6, 2009 11:52 AM

Edited by: Lakshmi Atukury on Jan 6, 2009 11:52 AM

Former Member
0 Kudos

Hi Rohit,

event EXPAND_NC in class CL_GUI_ALV_TREE

Following code will be executed when COLLAPSE ALL button is clicked.

DATA: lo_nd_tree TYPE REF TO if_wd_context_node,

lt_elements TYPE wdr_context_element_set.

FIELD-SYMBOLS:

<lo_element> TYPE REF TO if_wd_context_element.

lo_nd_tree = wd_context->get_child_node( name = wd_this->wdctx_tree).

lt_elements = lo_nd_tree ->get_elements( ).

LOOP AT lt_elements ASSIGNING <lo_element>.

<lo_element>->set_attribute(

EXPORTING value = abap_false

name = u2018EXAPNDEDu2019 ).

ENDLOOP.

Following code will be executed when EXPAND ALL button is clicked.

DATA: lo_nd_tree TYPE REF TO if_wd_context_node,

lt_elements TYPE wdr_context_element_set.

FIELD-SYMBOLS:

<lo_element> TYPE REF TO if_wd_context_element.

lo_nd_tree = wd_context->get_child_node( name = wd_this->wdctx_tree).

lt_elements = lo_nd_tree ->get_elements( ).

LOOP AT lt_elements ASSIGNING <lo_element>.

<lo_element>->set_attribute(

EXPORTING value = abap_true

name = u2018EXAPNDEDu2019 ).

ENDLOOP.

and also you can check in the standard program BCALV_GRID_EDIT

Thanks!!