cancel
Showing results for 
Search instead for 
Did you mean: 

ALV (or not) table as a tree

Former Member
0 Kudos

Hello,

I am trying to display an ALV table with the first column behaving like a tree. Basically all rows will be empty (except first column) except the leaf elements.

I have explored the following solutions, and each solution brought questions:

1. Using the standard table UI element:

This works fine, and it is very clear how to build the hierarchy of nodes either by using a recursion node, or by using the path/parent_path attributes. However I cannot find any way to have the view selection (with Filter and Settings buttons) at the top of the table, which bothers me a lot.

Is it possible to have this toolbar with the table UI element ?

2. Using the reusable ALV table component SALV_WD_TABLE:

Here I have the view selection toolbar. I have also managed to have a very simple tree with the first column as a hierarchy column (using the if_salv_wd_column_hierarchy and if_salv_wd_table_hierarchy methods on columns and table config).

My problem here is that I don't understand how to manage multiple hierarchy levels. The entries are grouped and collapsed if they have the same value in the hierarchy column, but I don't see how to make something like "level1 -> level2 -> entry1", I have only a 1 level tree like "level1 -> entry1,entry2,...". Is it possible to have the same flexibility on building the hierarchy levels as with the table UI element ?

Thanks in advance.

Thomas

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos
Former Member
0 Kudos

Sorry but since I posted in the Webdynpro ABAP section, I thought it obvious that I was working in Webdynpro ABAP. Your link is about ALV tree in classic dynpro programs.

Former Member
0 Kudos

In WD ALV, you can still make one more column as hierarchy column, You can get 2 levels right.

Former Member
0 Kudos

I understand but that's my problem: I cannot add columns as hierarchy columns, because the whole hierarchy is based on one column, and the number of levels is not known until runtime.

former_member187651
Active Participant
0 Kudos

This message was moderated.