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: 

Issues when building ALV catalog

Former Member
0 Kudos

Hello experts,

I am using the following function module to build my ALV catalog:

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name     = 'ZLRLEXC_QUANTS_X_MATERIAL'
      i_internal_tabname = 'ALV_ITAB'
      i_inclname         = 'ZLRLEXC_QUANTS_X_MATERIAL_TOP'
    CHANGING
      ct_fieldcat        = field.
  IF sy-subrc <> 0.
    WRITE: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_FIELDCATALOG_MERGE'.
  ENDIF.

The problem that I'm facing is that the "field" internal table does not contain any information after processing, and the odd thing is that sy-subrc = 0.

Any help would be highly appreciate it!

Regards,

-C

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

data: v_repid type sy-repid.

v_repid = 'ZLRLEXC_QUANTS_X_MATERIAL_TOP'

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name     = SY-REPID
      i_internal_tabname = 'ALV_ITAB'
      i_inclname            =  V_REPID
    CHANGING
      ct_fieldcat        = field.
  IF sy-subrc  0.
    WRITE: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_FIELDCATALOG_MERGE'.
  ENDIF.

All the Internal tables field should be defined using LIKE

you should define in the below mentioned way...

Data: begin of itab occurs 0,
           matnr like mara-matnr,  
         end of itab.

5 REPLIES 5

JozsefSzikszai
Active Contributor
0 Kudos

how are field and alv_itab defined?

former_member181995
Active Contributor
0 Kudos

use like this:

DATA:  lt_fieldcat TYPE slis_t_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name         = sy-repid
      i_structure_name       = 'FAGL_S_RFBELJ10_COMPANY_CODES'
    CHANGING
      ct_fieldcat            = lt_fieldcat
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS

it should work.

Amit.

former_member188685
Active Contributor
0 Kudos

data: v_repid type sy-repid.

v_repid = 'ZLRLEXC_QUANTS_X_MATERIAL_TOP'

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name     = SY-REPID
      i_internal_tabname = 'ALV_ITAB'
      i_inclname            =  V_REPID
    CHANGING
      ct_fieldcat        = field.
  IF sy-subrc  0.
    WRITE: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_FIELDCATALOG_MERGE'.
  ENDIF.

All the Internal tables field should be defined using LIKE

you should define in the below mentioned way...

Data: begin of itab occurs 0,
           matnr like mara-matnr,  
         end of itab.

0 Kudos

Thanks Vijay... you nailed the issue.. I was using "type" instead of "like" when creating the ALV_ITAB internal table.

Thanks everyone for you input!

Regards,

-C

Former Member
0 Kudos

hi did you defield like this..

data: alv_itab type SLIS_TABNAME .

data: ZLRLEXC_QUANTS_X_MATERIAL_TOP type TRDIR-NAME .

data: field type SLIS_T_FIELDCAT_ALV .