Application Development and Automation 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: 
Read only

field catalog generation using merge function

Former Member
0 Likes
1,066

i am trying to generate the field catalog using the below finction module, but i am not able to generate one and it is showing that 'FIeld catalog not generated'

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = LV_prog_name

I_INTERNAL_TABNAME = 'UT_FINAL'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = LV_prog_name

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = LT_FIELDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

please help.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
958

Hello Pramod

The following sample report show how to use definitions of internal tables for creating (SLIS) fieldcatalogs. The data include contains the data definition that is commented (below INCLUDE statement).

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_FIELDCATALOG_1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_fieldcatalog_1.


TYPE-POOLS: slis.

include zus_sdn_slisfcat_Data.
*DATA: BEGIN OF ty_s_list.
*DATA:   bukrs    LIKE knb1-bukrs.
*DATA:   kunnr    LIKE knb1-kunnr.
*DATA:   vkorg    TYPE knvv-vkorg.  " type does not work !!!
*DATA: END OF ty_s_list.


DATA:
  gs_list         LIKE ty_s_list,
  gt_list         LIKE ty_s_list OCCURS 0.

DATA:
  gt_fcat         TYPE slis_t_fieldcat_alv.


START-OF-SELECTION.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name               = syst-repid
      i_internal_tabname           = 'TY_S_LIST'
*     I_STRUCTURE_NAME             =
*     I_CLIENT_NEVER_DISPLAY       = 'X'
      i_inclname                   = 'ZUS_SDN_SLISFCAT_DATA'
      I_BYPASSING_BUFFER           = 'X'
*     I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = gt_fcat
    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.




  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
      i_structure_name = 'LVC_S_FCAT'
    TABLES
      t_outtab         = gt_fcat
    EXCEPTIONS
      program_error    = 1
      OTHERS           = 2.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

END-OF-SELECTION.

Regards

Uwe

8 REPLIES 8
Read only

Former Member
0 Likes
958

See this link:

http://www.sap-img.com/fu015.htm

Basically what this fm does is, that it will build a field catalog table based on the standard data elements and the domains the fields in the internal table are referring to.

Read only

Former Member
0 Likes
958

U shud be specifiying a ictionary structure in structure_name

Read only

Former Member
0 Likes
958

i want to generate the field catalog using the internal table only..i cannot use the dictionary structure.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
958
Read only

Former Member
0 Likes
958

Hi promod,

Check whether LV_prog_name = sy-repid is done in u r coding.

or change u r code,

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = sy-repid

I_INTERNAL_TABNAME = 'UT_FINAL'

I_INCLNAME = sy-repid

CHANGING

CT_FIELDCAT = LT_FIELDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

Read only

Former Member
0 Likes
958

1. Checkout if ur program name and include name are same

2. In ur internal table , use LIKE instead of TYPES

do not use MATNR TYPE MATNR but use

MATNR LIKE MARA-MATNR.

Read only

uwe_schieferstein
Active Contributor
0 Likes
959

Hello Pramod

The following sample report show how to use definitions of internal tables for creating (SLIS) fieldcatalogs. The data include contains the data definition that is commented (below INCLUDE statement).

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_FIELDCATALOG_1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_fieldcatalog_1.


TYPE-POOLS: slis.

include zus_sdn_slisfcat_Data.
*DATA: BEGIN OF ty_s_list.
*DATA:   bukrs    LIKE knb1-bukrs.
*DATA:   kunnr    LIKE knb1-kunnr.
*DATA:   vkorg    TYPE knvv-vkorg.  " type does not work !!!
*DATA: END OF ty_s_list.


DATA:
  gs_list         LIKE ty_s_list,
  gt_list         LIKE ty_s_list OCCURS 0.

DATA:
  gt_fcat         TYPE slis_t_fieldcat_alv.


START-OF-SELECTION.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name               = syst-repid
      i_internal_tabname           = 'TY_S_LIST'
*     I_STRUCTURE_NAME             =
*     I_CLIENT_NEVER_DISPLAY       = 'X'
      i_inclname                   = 'ZUS_SDN_SLISFCAT_DATA'
      I_BYPASSING_BUFFER           = 'X'
*     I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = gt_fcat
    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.




  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
      i_structure_name = 'LVC_S_FCAT'
    TABLES
      t_outtab         = gt_fcat
    EXCEPTIONS
      program_error    = 1
      OTHERS           = 2.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

END-OF-SELECTION.

Regards

Uwe

Read only

Former Member
0 Likes
958

Hi Uwe Schieferstein,

Thanx for the solution.