‎2007 Jan 08 7:17 AM
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.
‎2007 Jan 08 8:32 AM
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
‎2007 Jan 08 7:19 AM
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.
‎2007 Jan 08 7:24 AM
‎2007 Jan 08 7:46 AM
i want to generate the field catalog using the internal table only..i cannot use the dictionary structure.
‎2007 Jan 08 7:59 AM
‎2007 Jan 08 8:00 AM
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
‎2007 Jan 08 8:06 AM
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.
‎2007 Jan 08 8:32 AM
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
‎2007 Jan 08 10:01 AM