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: 

Field Catalog Merge FM

shivangi_pant
Participant
0 Kudos
537

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
1 REPLY 1

RaymondGiuseppi
Active Contributor
0 Kudos
473

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.