Application Development 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: 

I have error with REUSE_ALV_FIELDCATALOG_MERGE with wrong with my program

0 Kudos
TYPE-POOLS slis.

DATA: fld_catalog TYPE slis_t_fieldcat_alv, "Lvc_t_fcat

      wa_fld_catalog LIKE LINE OF fld_catalog.



DATA g_repid LIKE sy-repid.

DATA: gs_layout TYPE slis_layout_alv.

DATA: w_variant TYPE disvariant.





DATA: BEGIN OF TY_DISPLAY OCCURS 0,

   matnr LIKE marc-matnr,

   werks LIKE marc-werks,

END OF TY_DISPLAY.





DATA: it_display LIKE STANDARD TABLE OF ty_display  WITH HEADER LINE.





SELECTION-SCREEN: BEGIN OF BLOCK a1 WITH FRAME TITLE text-i01.

SELECT-OPTIONS: s_matnr FOR marc-matnr, " Material number

                s_werks FOR marc-werks. " Material group

SELECTION-SCREEN END OF BLOCK a1.



AT SELECTION-SCREEN.

  SELECT *

    INTO CORRESPONDING FIELDS OF TABLE it_display

    FROM marc

    WHERE werks IN s_werks

    AND matnr IN s_matnr.







INITIALIZATION.



START-OF-SELECTION.

g_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

    EXPORTING

      i_program_name         = g_repid

      i_internal_tabname     = 'IT_DISPLAY'

    CHANGING

      ct_fieldcat            = fld_catalog[]

    EXCEPTIONS

      inconsistent_interface = 1

      program_error          = 2.



END-OF-SELECTION.

  gs_layout-colwidth_optimize = 'X'.

  gs_layout-zebra             = 'X'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

      i_callback_program = g_repid

      is_layout          = gs_layout

      it_fieldcat        = fld_catalog

      i_save             = 'A'

    TABLES

      t_outtab           = it_display

    EXCEPTIONS

      program_error      = 1

      OTHERS             = 2.
1 ACCEPTED SOLUTION

former_member194965
Active Participant
,

Hi,

I_INTERNAL_TABNAME = 'IT_DISPLAY'

I_STRUCTURE_NAME = 'YOUR STRUCTURE' "Create structure and assign here.

Please create structure and assign it in FM

Regards,

E.Ananthachari

7 REPLIES 7

Former Member
0 Kudos

Anucha,

Change your FM call as follows ...

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_repid
i_internal_tabname = 'IT_DISPLAY'
i_inclname = g_repid
CHANGING
ct_fieldcat = fld_catalog[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2.

0 Kudos

Hi Duane,

Error again i don't know why i got the error because i think my code that correct.

former_member194965
Active Participant
,

Hi,

I_INTERNAL_TABNAME = 'IT_DISPLAY'

I_STRUCTURE_NAME = 'YOUR STRUCTURE' "Create structure and assign here.

Please create structure and assign it in FM

Regards,

E.Ananthachari

0 Kudos

Thank you i already got answer.

I don't know how to close my question.

0 Kudos

If you've got your answer, then share it here. This is supposed to be two-way community - give as well as take.

To close a question either "accept" the answer you think gives the answer, or go to "actions" and click on "close".

0 Kudos

Question is answer.

0 Kudos

If you've got your answer, then share it here. This is supposed to be two-way community - give as well as take.

To close a question either "accept" the answer you think gives the answer, or go to "actions" and click on "close".