06-18-2008 3:51 PM
Hi,
I am creating a deep structure inside a dynamic internal table, but it is not working.
Following is the code
ls_fcat-fieldname = 'CELLTAB'.
ls_fcat-no_out = c_x.
append ls_fcat to pt_fieldcat.
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = pt_fieldcat
importing
ep_table = g_hts.
assign g_hts->* to <i_status>.
...
...
field-symbols: <fs9> type LVC_T_STYL.
loop at <i_status> assigning <wa_status>.
assign component 'CELLTAB' of structure <wa_status> to <fs9>.
" Here i am getting error 'Type conflict with ASSIGN in program'
...
...
endloop.
But it is working fine with the following Uwe's example
https://wiki.sdn.sap.com/wiki/display/Snippets/CreatingFlatandComplexInternalTablesDynamicallyusingRTTI
gs_comp-type ?= cl_abap_typedescr=>describe_by_data( celltab ).
gs_comp-name = 'CELLTAB'.
append gs_comp to gt_components.
go_sdescr = cl_abap_structdescr=>create( gt_components ).
go_tdescr = cl_abap_tabledescr=>create( go_sdescr ).
create data gdo_handle type handle go_tdescr.
assign gdo_handle->* to <gt_itab>.
...
loop at <gt_itab> assigning <gs_struc>.
assign component 'CELLTAB' of structure <gs_struc> to <lt_celltab>.
endloop.
a®
06-18-2008 3:56 PM
Pass the I_STYLE_TABLE flag to create a style table in dynamic table.
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = pt_fieldcat
I_STYLE_TABLE = 'X' "<< To create a style table type LVC_T_STYL
importing
ep_table = g_hts.
assign g_hts->* to <i_status>.
Regards,
Naimesh Patel
06-18-2008 4:09 PM
Thanks Naimesh,
I made a mistake while passing values while creating field catalog for style.
ls_fcat-fieldname = 'CELLTAB'.
ls_fcat-ref_field = 'STYL'.
ls_fcat-ref_table = 'WTY_PNV_DYNPRO_ALV'.
ls_fcat-no_out = c_x.
append ls_fcat to pt_fieldcat.
After giving this it is working fine.
Thanks All,
a®
06-18-2008 3:58 PM
apart from these two field
ls_fcat-fieldname = 'CELLTAB'.
ls_fcat-no_out = c_x.
what else is supplied to fieldcatelog for CELLTAB