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: 

FM REUSE_ALV_GRID_DISPLAY - runtime error

Former Member
0 Kudos

I get the following error when I use FM REUSE_ALV_GRID_DISPLAY:

"Field catalog not found".

I realize that it is looking for the parameter it_fieldcat but I don't remember ever passing that parameter before; it also says that it is optional. Below is my call to the FM. Does the addition of it_sort mean that I must pass it_fieldcat?

      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
*     I_INTERFACE_CHECK                 = ' '
*     I_BYPASSING_BUFFER                = ' '
*     I_BUFFER_ACTIVE                   = ' '
*     I_CALLBACK_PROGRAM                = ' '
*     I_CALLBACK_PF_STATUS_SET          = ' '
*     I_CALLBACK_USER_COMMAND           = ' '
*     I_CALLBACK_TOP_OF_PAGE            = ' '
*     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*     I_CALLBACK_HTML_END_OF_LIST       = ' '
*     I_STRUCTURE_NAME                  =
*     I_BACKGROUND_ID                   = ' '
*     I_GRID_TITLE                      =
*     I_GRID_SETTINGS                   =
*     IS_LAYOUT                         =
*     it_fieldcat                       = it_fieldcat
*     IT_EXCLUDING                      =
*     IT_SPECIAL_GROUPS                 =
         it_sort                           = it_sort
*     IT_FILTER                         =
*     IS_SEL_HIDE                       =
*     I_DEFAULT                         = 'X'
*     I_SAVE                            = ' '
*     IS_VARIANT                        =
*     IT_EVENTS                         =
*     IT_EVENT_EXIT                     =
*       is_print                          = is_print
*     IS_REPREP_ID                      =
*     I_SCREEN_START_COLUMN             = 0
*     I_SCREEN_START_LINE               = 0
*     I_SCREEN_END_COLUMN               = 0
*     I_SCREEN_END_LINE                 = 0
*     I_HTML_HEIGHT_TOP                 = 0
*     I_HTML_HEIGHT_END                 = 0
*     IT_ALV_GRAPHICS                   =
*     IT_HYPERLINK                      =
*     IT_ADD_FIELDCAT                   =
*     IT_EXCEPT_QINFO                   =
*     IR_SALV_FULLSCREEN_ADAPTER        =
*   IMPORTING
*     E_EXIT_CAUSED_BY_CALLER           =
*     ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_out
*   EXCEPTIONS
*     PROGRAM_ERROR                     = 1
*     OTHERS                            = 2
                .

Davis

1 ACCEPTED SOLUTION

Former Member
0 Kudos

populate the catalogue table as follows

CLEAR alv_fieldcat_line.

alv_fieldcat_line-fieldname = 'PERNR'. " Name of the field

alv_fieldcat_line-tabname = 'it_out'. " Name of the internal table

alv_fieldcat_line-seltext_m = 'Personnel number'. " Lable of the field

alv_fieldcat_line-hotspot = ' '.

APPEND alv_fieldcat_line TO it_fieldcat. " Append the field to the it_fieldcat table

A

11 REPLIES 11

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please check this line and I think should be uncommented.

  • it_fieldcat = it_fieldcat

Regards,

Ferry Lianto

0 Kudos

Ferry,

It is asking for something to be passed but so I put that in there but I don't have it populated so I commented it out. I am not sure what I need to populate in that table or if I need to populate it at all.

Davis

0 Kudos

You need to populat it for your all internal table.


DATA:  WA_FIELDCAT   TYPE SLIS_FIELDCAT_ALV.
DATA: T_FIELDCAT   TYPE SLIS_T_FIELDCAT_ALV.

  WA_FIELDCAT-COL_POS = 1.
  WA_FIELDCAT-FIELDNAME = 'FIELD1.
  WA_FIELDCAT-TABNAME = 'T_FINAL_TAB'.
  WA_FIELDCAT-SELTEXT_L = L_SELTEXT_L.
  APPEND WA_FIELDCAT TO T_FIELDCAT.

Fill this table T_FIELDCAT for all the fields which you want to display in the output.

Pass the field table T_FIELDCAT to the ALV.

Regards,

Naimesh Patel

Former Member
0 Kudos

populate the catalogue table as follows

CLEAR alv_fieldcat_line.

alv_fieldcat_line-fieldname = 'PERNR'. " Name of the field

alv_fieldcat_line-tabname = 'it_out'. " Name of the internal table

alv_fieldcat_line-seltext_m = 'Personnel number'. " Lable of the field

alv_fieldcat_line-hotspot = ' '.

APPEND alv_fieldcat_line TO it_fieldcat. " Append the field to the it_fieldcat table

A

0 Kudos

Amandeep,

Thanks a lot for that code. I was doing just what you posted except I was doing it inside a loop so my it_fieldcat had too many entries.

Thanks a lot!

Davis

Former Member
0 Kudos

Why don't you read the documentation for the FM? It's quite helpful.

Rob

0 Kudos

Rob,

Don't you think that it was the first thing that I did? Thanks for your input though.

Everybody else,

Thanks for the tips; I'll take a look at what you posted shortly.

Davis

0 Kudos

Davis,

I dont know how much it will be of help to you. But this is how I used in one of my programs.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            I_BACKGROUND_ID         = 'ALV_BACKGROUND'
            I_CALLBACK_PROGRAM      = G_REPID
*            I_STRUCTURE_NAME        = 'SFLIGHT'
            IS_LAYOUT               = GS_LAYOUT
            IT_FIELDCAT             = f_cat[]
*           IT_EXCLUDING            =
*            IT_SPECIAL_GROUPS       = GT_SP_GROUP[]
*            IT_SORT                 = GT_SORT[]
*           IT_FILTER               =
*           IS_SEL_HIDE             =
*           i_default               = g_default
            I_SAVE                  = G_SAVE
            IS_VARIANT              = G_VARIANT
            IT_EVENTS               = GT_xEVENTS
*           IT_EVENT_EXIT           =
*            IS_PRINT                = GS_PRINT
*           I_SCREEN_START_COLUMN   = 0
*           I_SCREEN_START_LINE     = 0
*           I_SCREEN_END_COLUMN     = 0
*           I_SCREEN_END_LINE       = 0
*      IMPORTING
*           E_EXIT_CAUSED_BY_CALLER =
       TABLES
            T_OUTTAB                = bestand.

Regards

Aneesh.

0 Kudos

Didn't the documentation help?

You can also do a where used list to see how it is called.

Rob

0 Kudos

The documentation told me how to use it but it still wasn't working. It wasn't until I checked my code with the posted code that I realized I had my code in a loop so it was appending too many lines to the table.

Davis

0 Kudos

Good u resolved it.

A