Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

alv display for a deep structure

Former Member
0 Likes
1,298

Hi all ,

I have an internal table with a structure in it as a field along with other fields .

I want to create a dynamic alv display out of this internal table by assigning field symbols .

how to assign fields of a structure under the structure name and to display it in alv ? Other fields are assigned properly .

under the structer name it should move in a loop to assign each field of the structure .

any help !!

thanks in advance .

SA

Hi all ,

I have an internal table with a structure in it as a field along with other fields .

I want to create a dynamic alv display out of this internal table by assigning field symbols .

how to assign fields of a structure under the structure name and to display it in alv ? Other fields are assigned properly .

under the structer name it should move in a loop to assign each field of the structure .

any help !!

thanks in advance .

SA

1 REPLY 1
Read only

Former Member
0 Likes
421

1. Get an description object of your structure, i.e.

call

lo_struct = cl_abap_structdescr=>describe_by_data( ... ).

lt_comp = lo_struct->get_components( ).

loop at lt_comp assigning <wa_comp>.

try.

cl_abap_structdescr=>describe_by_data( <wa_comp> ).

if <wa_comp> is bound.

The game starts again...

endif.

catch cx_root.

endtry.

endloop.

In a natural way you get a tree of structures and parent structures. Display that tree as a cl_column_model_tree. Via double click on a final node of this tree the user gets displayed the struture data in an ALV. (As file explorer in windows).

Regards,

Thomas