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: 

How to use 'REUSE_ALV_FIELDCATALOG_MERGE'

Former Member
0 Kudos

What am I missing? the alv is not recognising my field catalog

here is my code http://www.copypastecode.com/25895/

1 ACCEPTED SOLUTION

Rocky1
Active Participant
0 Kudos

Hi,

Please post the thread after preview. What problem are you facing?

If simply you want to use the FM then do the following:


 DATA: g_tabname_header TYPE slis_tabname.
g_repid = sy-repid.
  g_tabname_header = 'ZLS_PROD_ERR_LOG'.

* For detailed view of ALV list
  IF rb_dtld EQ c_x.
    REFRESH i_fieldcat.

    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = g_repid
        i_structure_name       = g_tabname_header
      CHANGING
        ct_fieldcat            = i_fieldcat
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.

Thanks & Regards

Rocky

4 REPLIES 4

Rocky1
Active Participant
0 Kudos

Hi,

Please post the thread after preview. What problem are you facing?

If simply you want to use the FM then do the following:


 DATA: g_tabname_header TYPE slis_tabname.
g_repid = sy-repid.
  g_tabname_header = 'ZLS_PROD_ERR_LOG'.

* For detailed view of ALV list
  IF rb_dtld EQ c_x.
    REFRESH i_fieldcat.

    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = g_repid
        i_structure_name       = g_tabname_header
      CHANGING
        ct_fieldcat            = i_fieldcat
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.

Thanks & Regards

Rocky

Former Member
0 Kudos

in the variables declaration I have this:

DATA:BEGIN OF tabi OCCURS 0,
        vkorg     LIKE vbak-vkorg,
        name1     LIKE kna1-name1,
        vbeln     LIKE vbak-vbeln,
        audat     LIKE vbak-audat,
        vbeln_d   LIKE likp-vbeln,
        wadat_ist LIKE likp-wadat_ist,
        vbeln_b   LIKE vbrk-vbeln,
        fkdat     LIKE vbrk-fkdat,
        gbstk     LIKE vbuk-gbstk,
END OF tabi.

DATA: wa_tabi LIKE tabi,
      tabi2 LIKE tabi OCCURS 0.

the thingy with tabi and tabi2 is because 'REUSE_ALV_FIELDCATALOG_MERGE' cant import tabi directly...dont know why

0 Kudos

In the code snippet you have pasted i cannot see where you have populated your field catalog ?

Anyways i think you had posted a similar question yesterday & marked it as answered: .

Anyways the structure of the fieldcatalog for OO ALV is different than the REUSE* ALV grid. You have to use LVC_FIELDCATALOG_MERGE instead. Check this thread:

Former Member
0 Kudos

In Exporting Pass the structure reference like table name or structure name which you are using then it will work definately

i_structure_name   = 'NAST'