Skip to Content
0
May 21, 2013 at 05:59 AM

Webdynpro ALV Tree Structure

196 Views

Hello Experts,

I got an requirement to develop ALV tree structure with multilevel (level do not know at design time). I have gone through SDN but didn't found any relevant answer.

Currently I am using the way as follows:

My Node structure is :

I am using Code with in WDDOINIT method of Componentcontroller is as below:

data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv_bucketlist( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.

data l_salv_wd_table type ref to iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv_bucketlist( ).
data l_table type ref to cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
data l_column type ref to cl_salv_wd_column.
data l_header type ref to cl_salv_wd_column_header.

l_table->if_salv_wd_table_settings~set_width( '100%' ).

l_table->IF_SALV_WD_TABLE_SETTINGS~SET_DISPLAY_TYPE(
IF_SALV_WD_C_TABLE_SETTINGS=>DISPLAY_TYPE_HIERARCHY ).


l_column = l_table->if_salv_wd_column_settings~get_column( 'PRNTB' ).
l_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).



l_column = l_table->if_salv_wd_column_settings~get_column( 'BUKID' ).
l_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).


l_table->if_salv_wd_table_hierarchy~set_last_hier_column_as_leaf( abap_true ).

But it display only the 2 level, i.e 1st it display the 'bukid' then 'parntb' .

My problem is I want to display records of each hierarchy level, like

Root

child

child

------

Please give some Ideas, how can I implement the same.

Attachments