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: 

REUSE_ALV_FIELDCATALOG_MERGE with internal table

FredericGirod
Active Contributor
0 Kudos

Hi,

I'm trying to use the function module REUSE_ALV_FIELDCATALOG_MERGE to get the fieldcatalog of an internal table. But, that didn't work.

type-pools : slis.

data : begin of it_toto occurs 0 ,
         matnr type matnr ,
         maktx type maktx ,
       end   of it_toto ,

       it_fieldcatalog  type slis_t_fieldcat_alv.




CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    I_PROGRAM_NAME               = sy-repid
    I_INTERNAL_TABNAME           = 'IT_TOTO'
*   I_STRUCTURE_NAME             =
*   I_CLIENT_NEVER_DISPLAY       = 'X'
*   I_INCLNAME                   =
    I_BYPASSING_BUFFER           = 'X'
*    I_BUFFER_ACTIVE              =
  CHANGING
    ct_fieldcat                  = it_fieldcatalog.
* 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.

Somebody have an idea ?

Rgd

Frédéric

1 ACCEPTED SOLUTION

Former Member

Hi frederic,

1. use LIKE (and not type)

while defining internal table FIELDS.

Then it will work.

regards,

amit m.

6 REPLIES 6

Former Member

Hi frederic,

1. use LIKE (and not type)

while defining internal table FIELDS.

Then it will work.

regards,

amit m.

0 Kudos

Hi Amit,

that doesn't work ..

thanks for the answer.

type-pools : slis.

data : begin of it_toto occurs 0 ,
         matnr like  mara-matnr ,
         maktx like  makt-maktx ,
       end   of it_toto ,

       it_fieldcatalog  type slis_t_fieldcat_alv.




CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    I_PROGRAM_NAME               = sy-repid
    I_INTERNAL_TABNAME           = 'IT_TOTO'
*   I_STRUCTURE_NAME             =
*   I_CLIENT_NEVER_DISPLAY       = 'X'
*   I_INCLNAME                   =
    I_BYPASSING_BUFFER           = 'X'
*    I_BUFFER_ACTIVE              =
  CHANGING
    ct_fieldcat                  = it_fieldcatalog.
* 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.

0 Kudos

hi again,

1. I_INCLNAME = sy-repid

pass this parameter also.

It will work now.

regards,

amit m.

0 Kudos

Well done !

thanks Amit.

0 Kudos

Hi,

just check this code..

report  ztesss123.

type-pools : slis.
data : begin of it_toto occurs 0 ,
         matnr like  mara-matnr ,
         maktx like  makt-maktx ,
         end   of it_toto ,
         it_fieldcatalog  type slis_t_fieldcat_alv.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
  exporting
    i_program_name         = sy-repid
    i_internal_tabname     = 'IT_TOTO'
   <b> i_inclname             = sy-repid</b>
  changing
    ct_fieldcat            = it_fieldcatalog
  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.

regards

vijay

former_member188685
Active Contributor
0 Kudos

change type to like

<b>data : begin of it_toto occurs 0 ,

matnr like matnr ,

maktx like maktx ,

end of it_toto ,</b>

regards

vijay