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: 

No fieldcatalog generated when using REUSE_ALV_FIELDCATALOG_MERGE

aris_hidalgo
Contributor
0 Kudos

Hello Experts,

I am trying to use the said FM but my fieldcatalog table is not generated. I tried using SY-REPID in the

'i_program_name' and 'i_inclname' parameters. I also tried putting the name of my include program where

my data declaration is lcoated. Below is my code:


Include ZTXXR_P911_9000:

TYPES: BEGIN OF y_batchrun,
        zattrrultyp LIKE ztxx_pt9125-zattrrultyp,
        zattrrulid  LIKE ztxx_pt9126-zattrrulid,
        zattrrulde  LIKE ztxx_pt9125-zattrrulde,
        zattrseq    LIKE ztxx_pt9126-zattrseq,
        aedat       LIKE ztxx_pt9125-aedat,
        aenam       LIKE ztxx_pt9125-aenam,
        ersda       LIKE ztxx_pt9125-ersda,
        ernam       LIKE ztxx_pt9125-ernam,
       END OF y_batchrun.

DATA: is_ztxx_pt9124 TYPE STANDARD TABLE OF ztxx_pt9124,
      ts_batchrun    TYPE STANDARD TABLE OF y_batchrun.

PERFORM f_build_fieldcatalog
                      USING
                         'TS_BATCHRUN'
                      CHANGING
                         ts_batchrun
                         is_fieldcat.

Include ZTXXR_P911_TEST(Main program):

FORM f_build_fieldcatalog USING us_itabname TYPE slis_tabname
                       CHANGING ch_table TYPE STANDARD TABLE
                                ch_fieldcat TYPE lvc_t_fcat.

  REFRESH is_slis_fieldcat.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name               = 'ZTXXR_P911_9000'
      i_internal_tabname           = us_itabname
*     I_STRUCTURE_NAME             =
*     I_CLIENT_NEVER_DISPLAY       = 'X'
      i_inclname                   = 'ZTXXR_P911_9000'
*     I_BYPASSING_BUFFER           =
*     I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = is_slis_fieldcat
   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.
  ENDIF.

ENDFORM.                    "f_build_fieldcatalog

1 ACCEPTED SOLUTION

former_member1245113
Active Contributor
0 Kudos

Hi,

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name               = 'ZTXXR_P911_9000' " Replace this with the Main Program where you are using this Include
" Go through the Function Module Documentation for more info.
      i_internal_tabname           = us_itabname
*     I_STRUCTURE_NAME             =
*     I_CLIENT_NEVER_DISPLAY       = 'X'
      i_inclname                   = 'ZTXXR_P911_9000'
*     I_BYPASSING_BUFFER           =
*     I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = is_slis_fieldcat
   EXCEPTIONS
     inconsistent_interface       = 1
     program_error                = 2
     OTHERS                       = 3.

Cheerz

Ram

6 REPLIES 6

amit_khare
Active Contributor
0 Kudos

You need to pass value to I_STRUCTURE_NAME which should refer to an structure/table existing in DD02L table OR

Read this from help -

The program-internal table must either be in a TOP Include or its Include must be specified explicitly in the interface.

0 Kudos

Hi Amit,

I tried moving the structure(y_batch) and the itab(ts_batch) to my top include but there is still no fieldcatalog.

former_member1245113
Active Contributor
0 Kudos

Hi,

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name               = 'ZTXXR_P911_9000' " Replace this with the Main Program where you are using this Include
" Go through the Function Module Documentation for more info.
      i_internal_tabname           = us_itabname
*     I_STRUCTURE_NAME             =
*     I_CLIENT_NEVER_DISPLAY       = 'X'
      i_inclname                   = 'ZTXXR_P911_9000'
*     I_BYPASSING_BUFFER           =
*     I_BUFFER_ACTIVE              =
    CHANGING
      ct_fieldcat                  = is_slis_fieldcat
   EXCEPTIONS
     inconsistent_interface       = 1
     program_error                = 2
     OTHERS                       = 3.

Cheerz

Ram

0 Kudos

Hi,

I checked the documentation and tried doing hwta you said but still no value in my field catalog.

0 Kudos

hi

Try This one if possible and Feesible to you
" Check this Standard Program BILLING_INDIVIDUAL_I01
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name               = sy-repid " You can omit this even

      I_STRUCTURE_NAME             = 'ZTXX_PT9125'  " Use only Structure If you dont want all the fields of this structure
" you can create one more in SE11 with required fields and pass here

      i_inclname                   = sy-repid

    CHANGING
      ct_fieldcat                  = is_slis_fieldcat
   EXCEPTIONS
     inconsistent_interface       = 1
     program_error                = 2
     OTHERS                       = 3.
Take Where Used List Help As i Just Checked the Standard one able to Fill FCAT using above method

venkat_o
Active Contributor
0 Kudos

Hello friend,


TYPES: BEGIN OF y_batchrun,
        zattrrultyp LIKE ztxx_pt9125-zattrrultyp,
        zattrrulid  LIKE ztxx_pt9126-zattrrulid,
        zattrrulde  LIKE ztxx_pt9125-zattrrulde,
        zattrseq    LIKE ztxx_pt9126-zattrseq,
        aedat       LIKE ztxx_pt9125-aedat,
        aenam       LIKE ztxx_pt9125-aenam,
        ersda       LIKE ztxx_pt9125-ersda,
        ernam       LIKE ztxx_pt9125-ernam,
       END OF y_batchrun.
<li>Instead of defining TYPES and defining Internal table based on above TYPES, Define internal table like below then It works.

DATA: BEGIN OFts_batchrun occurs 0, "Internal table needs to be defined like below.
        zattrrultyp LIKE ztxx_pt9125-zattrrultyp,
        zattrrulid  LIKE ztxx_pt9126-zattrrulid,
        zattrrulde  LIKE ztxx_pt9125-zattrrulde,
        zattrseq    LIKE ztxx_pt9126-zattrseq,
        aedat       LIKE ztxx_pt9125-aedat,
        aenam       LIKE ztxx_pt9125-aenam,
        ersda       LIKE ztxx_pt9125-ersda,
        ernam       LIKE ztxx_pt9125-ernam,
       END OF ts_batchrun.
Thanks Venkat.O