Tree with multiple-level hierarchy in WD?

944 views Asked by At

This tutorial for "creating an ALV tree" describes a 2-level hierarchy which is more like grouping than a tree. Is there a way to create a tree control with a variable depth and width?

1

There are 1 answers

0
Suncatcher On

You can specify the number of levels by creating correspondent number of columns as you want, like it given in those manual:

DATA: lr_column TYPE REF TO CL_SALV_WD_COLUMN.

lr_column = lr_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'CARRID' ).
lr_column->IF_SALV_WD_COLUMN_HIERARCHY~SET_HIERARCHY_COLUMN( abap_true ).
...
lr_columnN =  
lr_columnN->IF_SALV_WD_COLUMN_HIERARCHY~SET_HIERARCHY_COLUMN( abap_true ).

All they should have hierarchy property (SET_HIERARCHY_COLUMN( )) and the last one could be set as final (a leaf) by setting such property

lr_columnN->IF_SALV_WD_COLUMN_HIERARCHY~SET_LAST_HIER_COLUMN_AS_LEAF( abap_true ).

So you specify levels of your ALV hieararchy table yourself by applying correspondent property to target columns. ALV engine will render the hierarchy himself.