cancel
Showing results for 
Search instead for 
Did you mean: 

Trees in ALV Table

Former Member
0 Kudos

Hi All..

I want to know whether it is possible to have a tree in the ALV output..

as in.. In the standard table using TreeByKeyTableColumn it is possible ..

But is any option available for doing the same in ALV output..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jagruti,

Of course you can have tree in the ALV output.

You need to set the column as a hierarchie key

Something like...

ls_column-r_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).

Your system should have an example.

See WDC SALV_WD_DEMO_TABLE_TREE

See method ON_UPLOAD_COMPLETE

The code is useful even if you cant get the tool to upload data

good luck.

Hope this will help you.

Cheers,

Darshna.

Former Member
0 Kudos

hi darshana..

thanx for helping..

I tried using

ls_column-r_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).

but im not getting the tree structure...

can u plz expalin in detail..

sm simple code will be preferred...

jagruti..

Former Member
0 Kudos

Hi Jagruti,

You also need to set the ALV to display-type to hierarchy!

Something like :

----


  • Set display type for the ALV to hierarchy.

----


ic_model->if_salv_wd_table_settings~set_display_type(

if_salv_wd_c_table_settings=>display_type_hierarchy ).

Hope this helps...

Wouter Heuvelmans

Former Member
0 Kudos

Hi Wouter ..

thanx ..it works now..

But how do i set the text of the child nodes..

for eg...In name i hv 2 options first name and last name so Name is visible but child nodes are not ..only a dot bullet is der without text...

It sholud look like this..

Name

->First Name

->last Name

Can u help...

jagruti..

Former Member
0 Kudos

Jagruti,

I do not quite understand what you mean.

Of course I do not have an overview of your definitions and coding.

Could you tell me what the definition of the DDIC-structure is and the coding of the ALV modification.

Regards

Wouter

Former Member
0 Kudos

Hi again...

i hv 4 columns in my table

model, spec, parent spec and value...

for eg...Model 1 has spec C1 and parspec p1 and sm value

and also has C2 and P1

so while displaying..

it shud comelike

P1

->c1

->c2

but instead i get

p1

.

.

only bullets after parent node but no text..

hope u got wht im trying to say

Reply..

Former Member
0 Kudos

So you define model and parspec as the hierarchy nodes?

Former Member
0 Kudos

hi..

No i dont want models in the hierarchy..

I want specs and parspecs only..

Parspecs as parents and spec with the respective parent as its child..

eg:- M1 has s1 , s2, s3 .

s1 has P1 as parent and s2 and s3 has p2 as parent..

then output should be like..

column1 column2 column3

( M1 ) (M2)

P1

->s1 value

p2

->s2 value

->s3.. value

This is the actual requirements ...

so i want p1 , s1 ,p2 s2 s3 to cm in this format....forget abt the model..

Former Member
0 Kudos

Hi ,

Is there any sample application available for tree in ALV ? . Im not able to see SALV_WD_DEMO_TABLE_TREE in my system . Other than this anything else is available ?

Regards,

Kalpana .

Answers (0)