2006 Nov 04 7:31 PM
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
2006 Nov 04 8:20 PM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |