Include structure.. not filling in field catalog
I have a structure of 105 fields, which need to be displayed in ALV and there are some more fields out of structure which also need to be included in the same output.
Below is the code, where i am trying to append and it is returning zero rows in field catalog.
Suggestions will be really helpful.
DATA: BEGIN OF T_MARC OCCURS 0.
INCLUDE STRUCTURE rqmqmel1.
DATA: VKORG1 TYPE MVKE-VKORG,
LTEXT(20) TYPE C,
END OF T_MARC.
data: xfield type slis_t_fieldcat_alv.
WRITE : SY-SUBRC.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
i_program_name = 'ZTEST_PRG'
i_internal_tabname = 'T_MARC'
i_inclname = sy-cprog
ct_fieldcat = xfield
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
Try change your code it will work.
DATA: BEGIN OF T_MARC OCCURS 0. INCLUDE STRUCTURE rqmqmel1. DATA: VKORG1 LIKE MVKE-VKORG, "use LIKE LTEXT(20) TYPE C, END OF T_MARC. CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING I_PROGRAM_NAME = SY-EPID "must I_INTERNAL_TABNAME = 'T_MARC' I_INCLNAME = SY-REPID "must CHANGING CT_FIELDCAT = IT_FCAT EXCEPTIONS INCONSISTENT_INTERFACE = 1 PROGRAM_ERROR = 2 OTHERS = 3. IF SY-SUBRC NE 0. ENDIF.
it will work now.