Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 16, 2008 at 04:44 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 04:45 PM

    Hi

    U need to transfer the include name too:

    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
           i_program_name    = 'ZTEST_PRG'
           i_internal_tabname = 'T_MARC'
           i_inclname             = 'ZTEST_PRG'

    Max

    Add comment
    10|10000 characters needed characters exceeded