2023 Apr 04 1:23 PM
Hi, I am working on a report and i have created a field catalog manually because each column has different heading. Now i have been asked to use field catalog merge function module. My question is when i will create merge then also i will have to loop catalog and set the name manually so is there any other approach or this is the only way out? It would be helpful if you could explain with example. From what i understand it will be something like this.
loop at i_fcat into wa_fcat.
* WA_FCAT-NO_OUT = 'X'.
if wa_fcat-fieldname = 'ActionType'.
wa_fcat-seltext_m = 'ActionType'.
modify i_fcat from wa_fcat index SY-TABIX.
endloop.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = 'SY-REPID'
I_INTERNAL_TABNAME = 'ifinal'
CHANGING
CT_FIELDCAT = I_FCA
and then use grid display
2023 Apr 05 8:52 AM
Basically use the FM to create a first version of field catalog and then loop at it to adapt. Read FM documentation for constraints on the way to define the internal table.
NB: LVC_FIELDCATALOG_MERGE is the function module associated with a class like CL_GUI_ALV_GRID while REUSE_ALV_FIELDCATALOG_MERGE remains at the level of a deprecated function module like REUSE_ALV_GRID_DISPLAY.