Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Include structure.. not filling in field catalog

Hello Guru's,

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.

WRITE 'START'.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = 'ZTEST_PRG'

i_internal_tabname = 'T_MARC'

  • i_inclname = sy-cprog

CHANGING

ct_fieldcat = xfield

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

Tags:
Former Member
Former Member replied

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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question