Application Development and Automation 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: 
Read only

alv list

Former Member
0 Likes
808

Hi all,

can u pls help in this i wrote alv report for data in mara but its going for dump. says function module the call function module

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' is incorrect.

REPORT ALV_LIST.

TYPE-POOLS : SLIS.
TABLES : MARA.
SELECT-OPTIONS : SO_MATNR FOR MARA-MATNR.

DATA : BEGIN OF IT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,  "Material Number
MTART LIKE MARA-MTART,  "Material Type
MEINS LIKE MARA-MEINS,  "Base Unit of Measure
BRGEW LIKE MARA-BRGEW,  "Gross Weight
KUNNR LIKE MARA-KUNNR,  "Competitor
END OF IT_MARA.

DATA I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.

START-OF-SELECTION.

  SELECT MATNR MTART MEINS BRGEW KUNNR FROM MARA INTO TABLE IT_MARA WHERE MATNR IN SO_MATNR.

    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    I_PROGRAM_NAME               =  SY-CPROG
    I_INTERNAL_TABNAME           = 'IT_MARA'
*   I_STRUCTURE_NAME             =
*   I_CLIENT_NEVER_DISPLAY       = 'X'
    I_INCLNAME                   =  SY-CPROG
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
      CHANGING
        CT_FIELDCAT                  = I_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.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                = ' '
*   I_BUFFER_ACTIVE                   = ' '
    I_CALLBACK_PROGRAM                = SY-CPROG
*   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                       =  I_FIELDCAT[]
*   IT_EXCLUDING                      =
*   IT_SPECIAL_GROUPS                 =
*   IT_SORT                           =
*   IT_FILTER                         =
*   IS_SEL_HIDE                       =
*   I_DEFAULT                         = 'X'
*   I_SAVE                            = ' '
*   IS_VARIANT                        =
*   IT_EVENTS                         =
*   IT_EVENT_EXIT                     =
*   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_MARA.
* EXCEPTIONS
*   PROGRAM_ERROR                     = 1
*   OTHERS                            = 2
          .
 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,

Mahesh.

Moderator message: please use more descriptive subject lines and code tags, leave out commented lines, this just bloats up the post.

Edited by: Thomas Zloch on Nov 11, 2010 9:13 AM

Hi all,

can u pls help in this i wrote alv report for data in mara but its going for dump. says function module the call function module

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' is incorrect.

REPORT ALV_LIST.

TYPE-POOLS : SLIS.
TABLES : MARA.
SELECT-OPTIONS : SO_MATNR FOR MARA-MATNR.

DATA : BEGIN OF IT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,  "Material Number
MTART LIKE MARA-MTART,  "Material Type
MEINS LIKE MARA-MEINS,  "Base Unit of Measure
BRGEW LIKE MARA-BRGEW,  "Gross Weight
KUNNR LIKE MARA-KUNNR,  "Competitor
END OF IT_MARA.

DATA I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.

START-OF-SELECTION.

  SELECT MATNR MTART MEINS BRGEW KUNNR FROM MARA INTO TABLE IT_MARA WHERE MATNR IN SO_MATNR.

    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    I_PROGRAM_NAME               =  SY-CPROG
    I_INTERNAL_TABNAME           = 'IT_MARA'
*   I_STRUCTURE_NAME             =
*   I_CLIENT_NEVER_DISPLAY       = 'X'
    I_INCLNAME                   =  SY-CPROG
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
      CHANGING
        CT_FIELDCAT                  = I_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.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                = ' '
*   I_BUFFER_ACTIVE                   = ' '
    I_CALLBACK_PROGRAM                = SY-CPROG
*   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                       =  I_FIELDCAT[]
*   IT_EXCLUDING                      =
*   IT_SPECIAL_GROUPS                 =
*   IT_SORT                           =
*   IT_FILTER                         =
*   IS_SEL_HIDE                       =
*   I_DEFAULT                         = 'X'
*   I_SAVE                            = ' '
*   IS_VARIANT                        =
*   IT_EVENTS                         =
*   IT_EVENT_EXIT                     =
*   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_MARA.
* EXCEPTIONS
*   PROGRAM_ERROR                     = 1
*   OTHERS                            = 2
          .
 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,

Mahesh.

Moderator message: please use more descriptive subject lines and code tags, leave out commented lines, this just bloats up the post.

Edited by: Thomas Zloch on Nov 11, 2010 9:13 AM

6 REPLIES 6
Read only

Former Member
0 Likes
759

Hi,

Un comment all exceptions and try this

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-CPROG

I_INTERNAL_TABNAME = 'IT_MARA'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = SY-CPROG

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = I_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.

BR,

Lokeswari.

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
759

Pass a refernce structure to the FM . I_STRUCTURE_NAME = ??

Also change the decalration for i_fieldcat -> remove header line , no need of this .

Read only

Former Member
0 Likes
759

Hi,

there are two ways:

1)

DATA I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

instead of

DATA I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.

2)

use CT_FIELDCAT = I_FIELDCAT[]

instead of

CT_FIELDCAT = I_FIELDCAT

hope it helps.

regards, Dieter

Read only

Clemenss
Active Contributor
0 Likes
759

Hi,

I_PROGRAM_NAME               =  SY-CPROG

causes the dump. Because I_PROGRAM_NAME is passed by reference, the system variable will have a new value inside the function.


DATA:
  lv_cprog TYPE SY-CPROG.

lv_cprog = SY-CPROG.

...

I_PROGRAM_NAME               =  lv_CPROG

will resolve this.

The other replies are possible ways to get around, but no answer to your question.

Regards,

Clemens

Read only

Former Member
0 Likes
759

Try this:



REPORT alv_list.

TYPE-POOLS : slis.
TABLES : mara.
SELECT-OPTIONS : so_matnr FOR mara-matnr.

TYPES: BEGIN OF t_mara,
        matnr LIKE mara-matnr,  "Material Number
        mtart LIKE mara-mtart,  "Material Type
        meins LIKE mara-meins,  "Base Unit of Measure
        brgew LIKE mara-brgew,  "Gross Weight
        kunnr LIKE mara-kunnr,  "Competitor
END OF t_mara.

DATA: it_mara TYPE TABLE OF t_mara        WITH HEADER LINE,
      wa_fcat TYPE slis_t_fieldcat_alv,
      wa_fcat_aux LIKE LINE OF wa_fcat.

START-OF-SELECTION.

  SELECT matnr mtart meins brgew kunnr FROM mara INTO TABLE it_mara WHERE matnr IN so_matnr.

  wa_fcat_aux-fieldname = 'MATNR'.
  wa_fcat_aux-tabname   = 'T_MATA'.
  wa_fcat_aux-seltext_l = 'Material Number'.
  APPEND wa_fcat_aux TO wa_fcat.
  CLEAR wa_fcat_aux.

  wa_fcat_aux-fieldname = 'MTART'.
  wa_fcat_aux-tabname   = 'T_MATA'.
  wa_fcat_aux-seltext_l = 'Material Type'.
  APPEND wa_fcat_aux TO wa_fcat.
  CLEAR wa_fcat_aux.

  wa_fcat_aux-fieldname = 'MEINS'.
  wa_fcat_aux-tabname   = 'T_MATA'.
  wa_fcat_aux-seltext_l = 'Base Unit of Measure'.
  APPEND wa_fcat_aux TO wa_fcat.
  CLEAR wa_fcat_aux.

  wa_fcat_aux-fieldname = 'BRGEW'.
  wa_fcat_aux-tabname   = 'T_MATA'.
  wa_fcat_aux-seltext_l = 'Gross Weight'.
  APPEND wa_fcat_aux TO wa_fcat.
  CLEAR wa_fcat_aux.

  wa_fcat_aux-fieldname = 'KUNNR'.
  wa_fcat_aux-tabname   = 'T_MATA'.
  wa_fcat_aux-seltext_l = 'Competitor'.
  APPEND wa_fcat_aux TO wa_fcat.
  CLEAR wa_fcat_aux.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      it_fieldcat              = wa_fcat[]
      i_grid_title             = 'Information'
      i_callback_program       = sy-repid
*      i_callback_pf_status_set = 'SET_STATUS'
*      i_callback_user_command  = 'USER_COMMAND'
    TABLES
      t_outtab                 = it_mara.
*  IF sy-subrc EQ 0.
*    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
*            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*  ENDIF.

Edited by: Raul Natu on Dec 6, 2010 5:18 PM

Read only

Clemenss
Active Contributor
0 Likes
759

Sorry Mahesh,

somebody should have seen it before:

DATA I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE

declares an internal table with (obsolete) header line.

CHANGING
        CT_FIELDCAT                  = I_FIELDCAT.

will pass the header line only whereas an internal table is required - you can see this in your dump(!).

So you can use

CHANGING
        CT_FIELDCAT                  = I_FIELDCAT[].

or declare the table state-of-the art

DATA I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

without header line.

Additionaly you should set the unit reference for the BRGEW field.

Even better: Create a dictionary structure for the output, it will enforce the unit reference.

Or (easier)

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    I_STRUCTURE_NAME             = 'MARA'
  CHANGING
        CT_FIELDCAT                  = I_FIELDCAT[].
delete I_FIELDCAT where
  fieldname NE MATNR and
  fieldname NE MTART and
  fieldname NE MEINS and
  fieldname NE BRGEW and
  fieldname NE KUNNR.

If you use the method suggested by Raul Natu, you will have no F1 or F4, no unit reference, little more than nothing.

Regards,

Clemens