cancel
Showing results for 
Search instead for 
Did you mean: 

How to make alv table hierarchy structure expand by default ?

Former Member
0 Kudos

Hi,

I have developed table hierarchy structure using alv table in abap webdynpro. How to make it expand by default ?

is that any properties that i have to set ?

Please advise ?

Thank You and Best Regards

Fernand

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

For ALV there is a class CL_SALV_WD_CONFIG_TABLE which has a method IF_SALV_WD_TABLE_HIERARCHY~SET_EXPANDED.

Use it to set expanded property of hierarchy column.

Data: lo_cmp_usage type ref to if_wd_component_usage.
  DATA: lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
  Data:     lo_alv_config             TYPE REF TO cl_salv_wd_config_table.

*create an instance of ALV component
  lo_cmp_usage =   wd_this->wd_cpuse_OVERVIEW_EARNED_ALV( ). " you alv name
* if not initialized, then initialize
  if lo_cmp_usage->has_active_component( ) is initial.
    lo_cmp_usage->create_component( ).
  endif.

* get ALV component
lr_salv_wd_table = wd_this->wd_cpifc_OVERVIEW_EARNED_ALV( ).

lo_alv_config ?= lr_salv_wd_table->get_model( ).

* set expanded
lo_alv_config->if_salv_wd_table_hierarchy~set_expanded( abap_true ).

Hope this helps.

Regards

Manas Dua

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you Manas, you solved my problem.

Best Regards

Fernand