Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Giving Dump after execution while clicking in filter, total, etc.

Hello Experts,

Report Given Belo is material Wise report, My Rprt is ALV grid report I am facing one problen in it, After executing when i m trying to do grandtotal, Print preview, Local File, Material recipient, it is giveng dump..... Plz guide me why it is giving dump....

REPORT zsd_repo_sale_material_wise.

TABLES : vbrp, vbrk, konv, kna1, vbak.

TYPE-POOLS : slis.

************************************************************************

  • INTERNAL TABLES *

************************************************************************

DATA : BEGIN OF itab OCCURS 0,

matnr TYPE matnr, " MATERIAL NO

arktx LIKE vbrp-arktx, " MATERIAL DESCRIPTION

vbeln TYPE vbeln_vf,

fkdat TYPE fkdat,

auart LIKE vbak-auart,

detl2(10) TYPE c,

kbetr LIKE komv-kbetr, " RATE PER QUANTITY

fkimg LIKE vbrp-fkimg, " ACTUAL QUANTITY IN THE INVOICE

vrkme LIKE vbrp-vrkme, " UNIT OF MEASUREMENT

kwert LIKE komv-kwert, " BASE AMOUNT IN THE INVOICE

box,

END OF itab.

DATA : BEGIN OF ifinal OCCURS 0,

matnr TYPE matnr, " MATERIAL NO

v_arktx LIKE vbrp-arktx, " MATERIAL DESCRIPTION

  • vbeln TYPE vbeln_vf,

  • fkdat TYPE fkdat,

  • auart LIKE vbak-auart,

detl2(10) TYPE c,

kbetr LIKE komv-kbetr, " RATE PER QUANTITY

fkimg LIKE vbrp-fkimg, " ACTUAL QUANTITY IN THE INVOICE

vrkme LIKE vbrp-vrkme, " UNIT OF MEASUREMENT

kwert LIKE komv-kwert, " BASE AMOUNT IN THE INVOICE

box,

END OF ifinal.

DATA : BEGIN OF jtab OCCURS 0,

vkorg LIKE vbrk-vkorg,

fkdat LIKE vbrk-fkdat,

vbeln LIKE vbrk-vbeln,

fkart LIKE vbrk-fkart,

  • vbeln TYPE vbeln_vf,

auart LIKE vbak-auart,

bzirk LIKE vbrk-bzirk,

matnr TYPE matnr,

spart LIKE mara-spart,

arktx LIKE vbrp-arktx,

posnr LIKE vbrp-posnr,

meins LIKE vbrp-meins,

fkimg LIKE vbrp-fkimg,

vrkme LIKE vbrp-vrkme,

kbetr LIKE konv-kbetr,

kwert LIKE konv-kwert,

END OF jtab.

DATA : cond(4) TYPE c.

DATA : v_matnr LIKE makt-matnr.

DATA : v_maktx LIKE makt-maktx..

************************************************************************

  • DATA DEFINITIONS FOR ALV *

************************************************************************

DATA : fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,

layout TYPE slis_layout_alv,

print TYPE slis_print_alv.

DATA : v_repid LIKE sy-repid.

************************************************************************

  • SELECTION OPTION *

************************************************************************

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE t1.

SELECT-OPTIONS: billdate FOR vbrk-fkdat OBLIGATORY.

SELECT-OPTIONS: s_kunnr FOR kna1-kunnr.

PARAMETERS: pa_vkorg TYPE vkorg DEFAULT 'RLDS'.

SELECTION-SCREEN END OF BLOCK b1.

************************************************************************

  • INITIALIZATION *

************************************************************************

INITIALIZATION.

t1 = 'SELECT OPTION'.

************************************************************************

  • START-OF-SELECTION *

************************************************************************

START-OF-SELECTION.

v_repid = sy-repid.

************************************************************************

*#1 NORMAL SALE *

************************************************************************

SELECT * FROM vbrk INTO vbrk WHERE

fksto <> 'X'

AND fkart <> 'S1'

AND vkorg = pa_vkorg " 'RLDS'

AND fkdat IN billdate

AND kunag IN s_kunnr.

SELECT * FROM vbrp

WHERE vbeln = vbrk-vbeln.

jtab-vbeln = vbrk-vbeln.

jtab-auart = vbak-auart.

jtab-vkorg = vbrk-vkorg.

jtab-fkart = vbrk-fkart.

jtab-fkdat = vbrk-fkdat.

jtab-bzirk = vbrk-bzirk.

jtab-matnr = vbrp-matnr.

jtab-arktx = vbrp-arktx.

jtab-meins = vbrp-meins.

jtab-posnr = vbrp-posnr.

jtab-fkimg = vbrp-fkimg.

jtab-vrkme = vbrp-vrkme.

SELECT SINGLE spart

INTO jtab-spart

FROM mara

WHERE matnr = jtab-matnr.

cond = 'PR00'.

SELECT * FROM konv

WHERE knumv = vbrk-knumv

AND kposn = jtab-posnr

AND kinak = ' '

AND kschl = cond.

jtab-kbetr = konv-kbetr.

jtab-kwert = konv-kwert.

ENDSELECT.

SELECT SINGLE auart INTO jtab-auart FROM vbak

WHERE vbeln = vbrp-aubel.

APPEND jtab.

CLEAR jtab.

ENDSELECT.

ENDSELECT.

SORT jtab BY auart matnr.

LOOP AT jtab.

IF itab-matnr <> jtab-matnr.

IF itab-matnr IS NOT INITIAL.

APPEND itab.

CLEAR itab.

ENDIF.

itab-matnr = jtab-matnr.

itab-arktx = jtab-arktx.

itab-kwert = jtab-kwert.

itab-vbeln = jtab-vbeln.

itab-fkdat = jtab-fkdat.

itab-kbetr = jtab-kbetr.

itab-vrkme = jtab-vrkme.

itab-fkimg = jtab-fkimg.

itab-auart = jtab-auart.

ELSE.

itab-kwert = itab-kwert + jtab-kwert.

itab-kbetr = jtab-kbetr.

itab-fkimg = itab-fkimg + jtab-fkimg.

ENDIF.

IF ( itab-matnr+10(2) = '51' ) OR

( itab-matnr+10(2) = '52' ) OR

( itab-matnr+10(2) = '53' ) OR

( itab-matnr+10(2) = '54' ) OR

( itab-matnr+10(2) = '71' ) OR

( itab-matnr+10(2) = '72' ) .

CASE itab-matnr+10(2).

WHEN '51' OR '52' OR '53' OR '54'.

itab-detl2 = 'SEMIFNSD'.

WHEN '71'.

itab-detl2 = 'AUTO CHN'.

WHEN '72'.

itab-detl2 = 'AUTO HUB'.

ENDCASE.

ENDIF.

IF ( itab-matnr+0(2) = 'SC' ).

CASE itab-matnr+0(2).

WHEN 'SC'.

itab-detl2 = 'AUTO SCR'.

ENDCASE.

******

ENDIF.

ENDLOOP.

IF itab-matnr IS NOT INITIAL.

APPEND itab.

CLEAR itab.

ENDIF.

SORT itab BY matnr.

DELETE itab WHERE auart <> 'ZALZ' AND auart <> 'ZTAM' AND auart <> 'ZOR'.

DELETE itab WHERE detl2 <> 'AUTO HUB' AND detl2 <> 'AUTO CHN' AND detl2 <> 'AUTO SCR'.

.

LOOP AT itab.

MOVE-CORRESPONDING itab TO ifinal.

COLLECT ifinal.

CLEAR : itab,

ifinal.

ENDLOOP.

loop at ifinal.

select single arktx into ifinal-v_arktx from vbrp where

matnr = ifinal-matnr.

modify ifinal transporting v_arktx.

clear : ifinal.

endloop.

refresh : itab,

jtab.

***********************************************************************

  • END-OF-SELECTION *

***********************************************************************

END-OF-SELECTION.

***********************************************************************

  • PEROFORM OPERATION *

***********************************************************************

PERFORM make_fieldcat_merge TABLES fieldcat.

PERFORM fill_layout.

PERFORM print.

PERFORM display.

*&----


*

*& FORM MAKE_FIELDCAT_MERGE

*&----


  • TEXT

*----


  • -->P_FIELDCAT TEXT

*----


FORM make_fieldcat_merge TABLES p_fieldcat STRUCTURE fieldcat.

DATA: col_pos TYPE i.

col_pos = 1.

p_fieldcat-col_pos = col_pos.

p_fieldcat-fieldname = 'MATNR'.

p_fieldcat-tabname = 'IFINAL'.

p_fieldcat-col_pos = col_pos.

p_fieldcat-ref_fieldname = 'MATNR'.

p_fieldcat-ref_tabname = 'MARA'.

  • p_fieldcat-ddictxt = 'M'.

p_fieldcat-lzero = 'X'.

  • p_fieldcat-

  • p_fieldcat-tech = 'X'.

  • p_fieldcat-no_zero = 'X'.

p_fieldcat-seltext_m = 'MATERIAL NO'.

p_fieldcat-seltext_l = 'MATERIAL NO'.

col_pos = col_pos + 1.

APPEND p_fieldcat.

CLEAR p_fieldcat.

p_fieldcat-col_pos = col_pos.

p_fieldcat-fieldname = 'ARKTX'.

p_fieldcat-tabname = 'IFINAL'.

p_fieldcat-col_pos = col_pos.

p_fieldcat-ddictxt = 'M'.

p_fieldcat-seltext_m = 'MATERIAL DESC'.

p_fieldcat-seltext_l = 'MATERIAL DESC'.

col_pos = col_pos + 1.

APPEND p_fieldcat.

CLEAR p_fieldcat.

  • p_fieldcat-col_pos = col_pos.

  • p_fieldcat-fieldname = 'AUART'.

  • p_fieldcat-tabname = 'IFINAL'.

    • p_fieldcat-col_pos = col_pos.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-seltext_m = 'COND'.

  • p_fieldcat-seltext_l = 'COND'.

  • col_pos = col_pos + 1.

  • APPEND p_fieldcat.

  • CLEAR p_fieldcat.

p_fieldcat-col_pos = col_pos.

p_fieldcat-fieldname = 'DETL2'.

p_fieldcat-tabname = 'IFINAL'.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-col_pos = col_pos.

p_fieldcat-seltext_m = 'DETAIL'.

p_fieldcat-seltext_l = 'DETAIL'.

p_fieldcat-outputlen = '12'.

col_pos = col_pos + 1.

APPEND p_fieldcat.

CLEAR p_fieldcat.

p_fieldcat-col_pos = col_pos.

p_fieldcat-fieldname = 'VBELN'.

p_fieldcat-tabname = 'IFINAL'.

*p_fieldcat-col_pos = col_pos.

p_fieldcat-ref_fieldname = 'VBELN'.

p_fieldcat-ref_tabname = 'VBAK'.

p_fieldcat-ddictxt = 'M'.

p_fieldcat-no_zero = 'X'.

p_fieldcat-no_out = 'X'.

p_fieldcat-seltext_m = 'INVNO'.

p_fieldcat-seltext_l = 'INVNO'.

col_pos = col_pos + 1.

APPEND p_fieldcat.

CLEAR p_fieldcat.

p_fieldcat-col_pos = col_pos.

p_fieldcat-fieldname = 'FKDAT'.

p_fieldcat-tabname = 'IFINAL'.

*p_fieldcat-col_pos = col_pos.

p_fieldcat-ddictxt = 'M'.

p_fieldcat-no_out = 'X'.

p_fieldcat-seltext_m = 'INVDAT'.

p_fieldcat-seltext_l = 'INVDAT'.

col_pos = col_pos + 1.

APPEND p_fieldcat.

CLEAR p_fieldcat.

p_fieldcat-col_pos = col_pos.

p_fieldcat-fieldname = 'KBETR'.

p_fieldcat-tabname = 'IFINAL'.

*p_fieldcat-col_pos = col_pos.

p_fieldcat-ddictxt = 'M'.

p_fieldcat-seltext_m = 'RATE'.

p_fieldcat-seltext_l = 'RATE'.

col_pos = col_pos + 1.

APPEND p_fieldcat.

CLEAR p_fieldcat.

p_fieldcat-col_pos = col_pos.

p_fieldcat-fieldname = 'FKIMG'.

p_fieldcat-tabname = 'IFINAL'.

*p_fieldcat-col_pos = col_pos.

p_fieldcat-ddictxt = 'M'.

p_fieldcat-seltext_m = 'INVOICE QTY'.

p_fieldcat-seltext_l = 'INVOICE QTY'.

col_pos = col_pos + 1.

APPEND p_fieldcat.

CLEAR p_fieldcat.

p_fieldcat-col_pos = col_pos.

p_fieldcat-fieldname = 'VRKME'.

p_fieldcat-tabname = 'IFINAL'.

*p_fieldcat-col_pos = col_pos.

p_fieldcat-ddictxt = 'M'.

p_fieldcat-seltext_m = 'SU'.

p_fieldcat-seltext_l = 'SU'.

col_pos = col_pos + 1.

APPEND p_fieldcat.

CLEAR p_fieldcat.

p_fieldcat-col_pos = col_pos.

p_fieldcat-fieldname = 'KWERT'.

p_fieldcat-tabname = 'IFINAL'.

*p_fieldcat-col_pos = col_pos.

p_fieldcat-ddictxt = 'M'.

p_fieldcat-seltext_m = 'VALUE'.

p_fieldcat-seltext_l = 'VALUE'.

col_pos = col_pos + 1.

APPEND p_fieldcat.

CLEAR p_fieldcat.

  • CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

  • EXPORTING

  • i_program_name = v_repid

  • i_internal_tabname = 'ITAB'

  • i_inclname = v_repid

  • CHANGING

  • ct_fieldcat = p_fieldcat[].

*

  • LOOP AT p_fieldcat.

  • IF p_fieldcat-fieldname = 'MATNR'.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-seltext_m = 'MATERIAL NO'.

  • p_fieldcat-seltext_l = 'MATERIAL NO'.

  • CLEAR : p_fieldcat-tech, p_fieldcat-no_out.

  • ENDIF.

*

  • IF p_fieldcat-fieldname = 'ARKTX'.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-seltext_m = 'MATERIAL DESC'.

  • p_fieldcat-seltext_l = 'MATERIAL DESC'.

  • CLEAR : p_fieldcat-tech, p_fieldcat-no_out.

  • ENDIF.

*

  • IF p_fieldcat-fieldname = 'AUART'.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-seltext_m = 'COND'.

  • p_fieldcat-seltext_l = 'COND'.

  • CLEAR : p_fieldcat-tech, p_fieldcat-no_out.

  • ENDIF.

*

  • IF p_fieldcat-fieldname = 'DETL2'.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-seltext_m = 'DETAIL'.

  • p_fieldcat-seltext_l = 'DETAIL'.

  • CLEAR : p_fieldcat-tech, p_fieldcat-no_out.

  • ENDIF.

*

  • IF p_fieldcat-fieldname = 'VBELN'.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-seltext_m = 'INVNO'.

  • p_fieldcat-seltext_l = 'INVNO'.

  • CLEAR : p_fieldcat-tech, p_fieldcat-no_out.

  • ENDIF.

*

*

*

  • IF p_fieldcat-fieldname = 'KBETR'.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-seltext_m = 'RATE'.

  • p_fieldcat-seltext_l = 'RATE'.

  • CLEAR : p_fieldcat-tech, p_fieldcat-no_out.

  • ENDIF.

*

  • IF p_fieldcat-fieldname = 'FKIMG'.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-seltext_m = 'INVOICE QTY'.

  • p_fieldcat-seltext_l = 'INVOICE QTY'.

  • CLEAR : p_fieldcat-tech, p_fieldcat-no_out.

  • ENDIF.

*

  • IF p_fieldcat-fieldname = 'VRKME'.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-seltext_m = 'SU'.

  • p_fieldcat-seltext_l = 'SU'.

  • CLEAR : p_fieldcat-tech, p_fieldcat-no_out.

  • ENDIF.

*

  • IF p_fieldcat-fieldname = 'KWERT'.

  • p_fieldcat-ddictxt = 'M'.

  • p_fieldcat-seltext_m = 'VALUE'.

  • p_fieldcat-seltext_l = 'VALUE'.

  • CLEAR : p_fieldcat-tech, p_fieldcat-no_out.

*

  • ELSEIF

  • p_fieldcat-fieldname = 'BOX'.

  • p_fieldcat-tech = 'X'.

  • ENDIF.

*

  • CLEAR p_fieldcat-key.

  • MODIFY p_fieldcat.

  • ENDLOOP.

ENDFORM. " MAKE_FIELDCAT_MERGE

*

**&----


*& FORM FILL_LAYOUT

*&----


  • TEXT

*----


  • --> P1 TEXT

  • <-- P2 TEXT

*----


FORM fill_layout .

layout-totals_text = 'KWERT'.

layout-box_fieldname = 'BOX'.

layout-box_tabname = 'IFINAL'.

layout-zebra = 'X'.

ENDFORM. " FILL_LAYOUT

*&----


*& FORM DISPLAY

*&----


  • TEXT

*----


  • --> P1 TEXT

  • <-- P2 TEXT

*----


FORM display .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = v_repid

is_layout = layout

it_fieldcat = fieldcat[]

i_default = 'X'

i_save = 'A'

is_print = print

TABLES

t_outtab = ifinal.

ENDFORM. " DISPLAY

*&----


*& FORM PRINT

*&----


  • TEXT

*----


  • --> P1 TEXT

  • <-- P2 TEXT

*----


FORM print .

print-no_print_selinfos = 'X'.

print-no_print_listinfos = 'X'.

ENDFORM. " PRINT

Tags:
replied

Hi

Check the value of <ls_fcat>-fieldname: it seems you're transfering a field in CATALOG TABLE isn't in the internal table IFINAL:

DATA : BEGIN OF IFINAL OCCURS 0,
        MATNR TYPE MATNR, " MATERIAL NO
        V_ARKTX LIKE VBRP-ARKTX, " MATERIAL DESCRIPTION
* VBELN TYPE VBELN_VF,
* FKDAT TYPE FKDAT,
* AUART LIKE VBAK-AUART,
        DETL2(10) TYPE C,
        KBETR LIKE KOMV-KBETR, " RATE PER QUANTITY
        FKIMG LIKE VBRP-FKIMG, " ACTUAL QUANTITY IN THE INVOICE
        VRKME LIKE VBRP-VRKME, " UNIT OF MEASUREMENT
        KWERT LIKE KOMV-KWERT, " BASE AMOUNT IN THE INVOICE
        BOX,
      END OF IFINAL.

Perhasp it can be VBELN or FKDAT you've deleted them from defination, but you still transfer them to FIELDCAT table.

Max

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question