Skip to Content
0
Apr 07, 2010 at 03:26 PM

expand all ALV hierarchy during runtime

41 Views

hi all,

I have created two customized function of ALV one is used to expand all hierarchy one is used to collapse all hierarchy.

in the event handler ON_FUNCTION i set the code like:

li_cmp_usage = wd_this->wd_cpuse_xml_result_alv( ).

IF li_cmp_usage->has_active_component( ) IS INITIAL.

li_cmp_usage->create_component( ).

ENDIF.

li_interfacecontroller = wd_this->wd_cpifc_xml_result_alv( ).

li_model = li_interfacecontroller->get_model( ).

CASE r_param->id.

WHEN 'EXP_ALL'.

li_model->if_salv_wd_table_hierarchy~set_expanded( abap_true ).

WHEN 'COL_ALL'.

li_model->if_salv_wd_table_hierarchy~set_expanded( abap_false ).

ENDCASE.

but the function expand all only can expand the first level of the hierarchy.

why the method set_expanded doesn't work? How can I deal with this problem?

Best regards

Julia