2023 Jul 20 8:11 PM
Hi all,
I need to create a dynamic internal table with all the fields of a structure/table and one field of type LVC_T_STYL.
Imagine the following simple program:
PARAMETERS: p_tab TYPE dd02l-tabname DEFAULT 'SYST'.
DATA: lo_table TYPE REF TO data,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_fieldcat1 TYPE lvc_t_fcat.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = p_tab
CHANGING
ct_fieldcat = lt_fieldcat
EXCEPTIONS
OTHERS = 99.
MOVE-CORRESPONDING: lt_fieldcat TO lt_fieldcat1.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt_fieldcat1
IMPORTING
ep_table = lo_table
EXCEPTIONS
OTHERS = 99.
ASSIGN lo_table->* TO FIELD-SYMBOL(<wa_tab>).
Now how can I add another column of type LVC_T_STYL ?
Since it's a table I cannot add it to lt_fieldcat, I guess.
Many thanks
2023 Jul 21 9:21 AM
Please don't use CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE as explained here: Alternative to CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE | SAP Blogs
2023 Jul 21 9:37 AM
2023 Jul 21 9:59 AM