cancel
Showing results for 
Search instead for 
Did you mean: 

expand all ALV hierarchy during runtime

0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Julia,

Whatever u did is correct you are just missing call to populate ALV again.So..

CASE r_param->id.

WHEN 'EXP_ALL'.

li_model->if_salv_wd_table_hierarchy~set_expanded( abap_true ).

call populateALV(). " a method which u defined to fetch data and populate ALV

WHEN 'COL_ALL'.

li_model->if_salv_wd_table_hierarchy~set_expanded( abap_false ).

call populateALV(). " a method which u defined to fetch data and populate ALV

ENDCASE.

Thanks,

Swanand.

0 Kudos

Hi Swanand,

Your solution works perfectly! Thank you very much!

BR, Julia

Former Member
0 Kudos

gr8.. mark this as an answered....

Swanand