Skip to Content

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

Problem in using FM REUSE_ALV_FIELDCATALOG_MERGE

Hi,

Please check where i am doing wrong its giving dump 'No catalog found'.I am sending you the code.

REPORT ztest_merge .

TYPE-POOLS : slis.

TABLES : qals.

TYPES : BEGIN OF t_out,

matnr LIKE qals-matnr, "MATERIAL

werk LIKE qals-werk, "PLANT

END OF t_out.

DATA : i_out TYPE STANDARD TABLE OF t_out WITH HEADER LINE,

wa_out TYPE t_out.

DATA : i_fieldcat TYPE slis_t_fieldcat_alv,

i_layout TYPE slis_layout_alv,

gs_layout TYPE lvc_s_layo,

g_repid TYPE sy-repid,

ls_fieldcat TYPE slis_fieldcat_alv.

PARAMETER : p_prflos LIKE qals-prueflos.

INITIALIZATION.

g_repid = sy-repid.

i_layout-zebra = 'X'.

i_layout-colwidth_optimize = 'X'.

START-OF-SELECTION.

PERFORM fetch_data.

END-OF-SELECTION.

PERFORM fill_fieldcat.

PERFORM display_alv.

FORM fetch_data .

SELECT SINGLE matnr werk

FROM qals

INTO i_out

WHERE prueflos = p_prflos.

ENDFORM. " FETCH_DATA

FORM fill_fieldcat .

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = g_repid

i_internal_tabname = 'I_OUT'

i_inclname = g_repid

CHANGING

ct_fieldcat = i_fieldcat

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

LOOP AT i_fieldcat INTO ls_fieldcat.

CASE ls_fieldcat-fieldname.

WHEN 'MATNR'.

ls_fieldcat-col_pos = '1'.

ls_fieldcat-outputlen = '15'.

ls_fieldcat-seltext_l = 'MATERIAL NUMBER'.

WHEN 'WERK'.

ls_fieldcat-col_pos = '2'.

ls_fieldcat-outputlen = '15'.

ls_fieldcat-seltext_l = 'PLANT'.

ENDCASE.

MODIFY i_fieldcat FROM ls_fieldcat INDEX sy-tabix.

ENDLOOP.

ENDFORM. " FILL_FIELDCAT

FORM display_alv .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = g_repid

is_layout = i_layout

it_fieldcat = i_fieldcat[]

TABLES

t_outtab = i_out

EXCEPTIONS

program_error = 1

OTHERS = 2.

ENDFORM. " display_alv

Tags:
Former Member
Former Member replied

If you use LIKE the field takes up all the dictionary field properties...

If you use TYPE the field takes up only the datatype of the referenced field.

type declarations the FM will not accept, like declarations it will take. or else if you don't want to change the declaration then go for manuall filling.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = V_REPID

I_INTERNAL_TABNAME = 'IT_MARC'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = V_REPID

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = IT_FIELDCATALOG_MARC

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

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