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: 

Dump Error when i make SUM in alv !!!

Former Member
0 Kudos
135

I write an alv and when i try to SUM the "KWERT" field i take Dump Error ...

I can;t find what to do ...

I declared as "curr" and nothing happened ......

I declared the unit of measurment and nothing happend .....

Please help .....

<b>Points will be rewarded .....</b>


  PERFORM ALV_BUILD_FIELDCAT USING 'EKKO' 'EKGRP' 'ITAB' 'EKGRP'
   ' '   NA NA    NA      NA    NA   NA NA NA NA NA NA  NA NA.

  PERFORM ALV_BUILD_FIELDCAT USING 'T024' 'EKNAM' 'ITAB' 'EKNAM'
   ' '   NA NA    NA      NA    NA   NA NA NA NA NA NA  NA NA.

  PERFORM ALV_BUILD_FIELDCAT USING 'EKKO' 'BUKRS' 'ITAB' 'BUKRS'
   ' '   NA NA    NA      NA    NA   NA NA NA NA NA NA  NA NA.

  PERFORM ALV_BUILD_FIELDCAT USING 'T001' 'BUTXT' 'T001' 'BUTXT'
  ' '   NA ' '    NA      NA    NA   NA NA NA NA NA NA NA NA.

  PERFORM ALV_BUILD_FIELDCAT USING 'EKKO' 'EBELN' 'ITAB' 'EBELN'
  ' '   NA 'X'    NA      NA    NA   NA NA NA NA NA NA 'C311' NA.

<b>  PERFORM ALV_BUILD_FIELDCAT USING 'KONV' 'KWERT' 'ITAB' 'KWERT'
  ' '  'VALUE'  ' '    NA      NA    NA   NA NA NA NA NA NA 'C511' NA.</b>

  PERFORM ALV_BUILD_FIELDCAT USING 'ITAB' 'METR' 'ITAB' 'METR'
  ' '   '&#913;&#961;.&#915;&#961;&#945;&#956;&#956;&#969;&#957;' ' '    NA      NA    'C'   'X' NA NA NA NA NA NA NA.

  PERFORM ALV_BUILD_FIELDCAT USING 'EKKO' 'AEDAT' 'ITAB' 'AEDAT'
  ' '   NA ' '    NA      NA    NA   NA NA NA NA NA NA NA NA.

  PERFORM ALV_BUILD_FIELDCAT USING 'ZVF_POSTATUS' 'SEQNR' 'ITAB' 'SEQNR'
  ' '   NA ' '    NA      NA    NA   NA NA NA NA NA NA 'C311' NA.

      ......................
  PERFORM ALV_BUILD_LAYOUT USING LAYOUT.
  PERFORM ALV_BUILD_EVENT_CATALOG.
  PERFORM ALV_START_VIEWER.
   ...............

*---------------------------------------------------------------------*
*       FORM alv_build_fieldcat                                       *
*---------------------------------------------------------------------*
FORM ALV_BUILD_FIELDCAT USING REF_TABNAME
                          REF_FIELDNAME TABNAME FIELDNAME
                          KEY FTEXT HOTSPOT OUTLEN
                          ICON JUST DOSUM DECS NOZERO UOM
                          INP CHK EMF EDT.

  ADD 1 TO COL_POS.

  FIELDCAT_LN-REF_TABNAME   = REF_TABNAME.
  FIELDCAT_LN-REF_FIELDNAME = REF_FIELDNAME.
  FIELDCAT_LN-TABNAME       = TABNAME.
  FIELDCAT_LN-FIELDNAME     = FIELDNAME.
  FIELDCAT_LN-KEY           = KEY.
  FIELDCAT_LN-COL_POS       = COL_POS.
  FIELDCAT_LN-NO_ZERO       = NOZERO.
  FIELDCAT_LN-SELTEXT_L     = FTEXT.
  FIELDCAT_LN-SELTEXT_M     = FTEXT.
  FIELDCAT_LN-SELTEXT_S     = FTEXT.
  FIELDCAT_LN-DDICTXT       = 'L'.     " (S)hort (M)iddle (L)ong
  FIELDCAT_LN-HOTSPOT       = HOTSPOT.
  FIELDCAT_LN-QFIELDNAME    = UOM.
  FIELDCAT_LN-OUTPUTLEN     = OUTLEN.
  FIELDCAT_LN-ICON          = ICON.
  FIELDCAT_LN-JUST          = JUST.
  FIELDCAT_LN-DO_SUM        = DOSUM.
  FIELDCAT_LN-CHECKBOX      = CHK.
  FIELDCAT_LN-EMPHASIZE     = EMF.
  FIELDCAT_LN-EDIT_MASK     = EDT.

  IF NOT DECS = SPACE.
    FIELDCAT_LN-DECIMALS_OUT  = DECS.
  ENDIF.

  APPEND FIELDCAT_LN TO FIELDCAT.


ENDFORM.                    "alv_build_fieldcat

1 ACCEPTED SOLUTION

Former Member
0 Kudos
81

PASS THE VALUE 'X' INTO THE COULMN RELATED TO SUM IN CREATE CATALOG.

ie

PERFORM add_field_catalog USING :

'01' 'SNO' 'ITAB' text-001 'L' ' ' ' ' ' ' ' ' ' ' 'C110' ' ' 'X',

'02' 'PERNR' 'ITAB' text-002 'L' '1' ' ' ' ' ' ' ' ' 'C210' ' ' ' ',

'03' 'ENAME' 'ITAB' text-010 'L' ' ' ' ' ' ' ' ' ' ' 'C310' ' ' ' ',

'04' 'SUBTY' 'ITAB' text-003 'L' ' ' ' ' ' ' ' ' ' ' 'C410' 'X' ' ',

'05' 'BEGDA' 'ITAB' text-004 'L' ' ' ' ' ' ' ' ' ' ' 'C510' ' ' ' ',

'06' 'ENDDA' 'ITAB' text-005 'L' ' ' ' ' ' ' ' ' ' ' 'C610' ' ' ' ',

'07' 'WERKS' 'ITAB' text-006 'L' ' ' ' ' ' ' ' ' ' ' 'C710' ' ' ' ',

'08' 'BTRTL' 'ITAB' text-009 'L' ' ' ' ' ' ' ' ' ' ' 'C810' ' ' ' ',

'09' 'PERSG' 'ITAB' text-007 'L' ' ' ' ' ' ' ' ' ' ' 'C910' ' ' ' ',

'10' 'PERSK' 'ITAB' text-008 'L' ' ' ' ' ' ' ' ' ' ' 'C110' ' ' ' ',

'11' 'CBOX' 'ITAB' text-011 'L' ' ' ' ' ' ' 'X' 'X' 'C210' ' ' ' ',

'12' 'CUR_FLD' 'ITAB' text-011 'L' ' ' ' ' ' ' ' ' ' ' 'C210' ' ' 'X'.

ENDFORM. " CREATE_ALV_CATALOG

FORM add_field_catalog USING p_col_pos

p_fieldname

p_tabname

p_text

p_just

p_key

p_key_sel

p_fix_column

p_edit

p_checkbox

P_EMP

P_HOT

p_sum.

where my cur_fld is type Curr and I am getting the sum correctly.

2 REPLIES 2

Former Member
0 Kudos
82

PASS THE VALUE 'X' INTO THE COULMN RELATED TO SUM IN CREATE CATALOG.

ie

PERFORM add_field_catalog USING :

'01' 'SNO' 'ITAB' text-001 'L' ' ' ' ' ' ' ' ' ' ' 'C110' ' ' 'X',

'02' 'PERNR' 'ITAB' text-002 'L' '1' ' ' ' ' ' ' ' ' 'C210' ' ' ' ',

'03' 'ENAME' 'ITAB' text-010 'L' ' ' ' ' ' ' ' ' ' ' 'C310' ' ' ' ',

'04' 'SUBTY' 'ITAB' text-003 'L' ' ' ' ' ' ' ' ' ' ' 'C410' 'X' ' ',

'05' 'BEGDA' 'ITAB' text-004 'L' ' ' ' ' ' ' ' ' ' ' 'C510' ' ' ' ',

'06' 'ENDDA' 'ITAB' text-005 'L' ' ' ' ' ' ' ' ' ' ' 'C610' ' ' ' ',

'07' 'WERKS' 'ITAB' text-006 'L' ' ' ' ' ' ' ' ' ' ' 'C710' ' ' ' ',

'08' 'BTRTL' 'ITAB' text-009 'L' ' ' ' ' ' ' ' ' ' ' 'C810' ' ' ' ',

'09' 'PERSG' 'ITAB' text-007 'L' ' ' ' ' ' ' ' ' ' ' 'C910' ' ' ' ',

'10' 'PERSK' 'ITAB' text-008 'L' ' ' ' ' ' ' ' ' ' ' 'C110' ' ' ' ',

'11' 'CBOX' 'ITAB' text-011 'L' ' ' ' ' ' ' 'X' 'X' 'C210' ' ' ' ',

'12' 'CUR_FLD' 'ITAB' text-011 'L' ' ' ' ' ' ' ' ' ' ' 'C210' ' ' 'X'.

ENDFORM. " CREATE_ALV_CATALOG

FORM add_field_catalog USING p_col_pos

p_fieldname

p_tabname

p_text

p_just

p_key

p_key_sel

p_fix_column

p_edit

p_checkbox

P_EMP

P_HOT

p_sum.

where my cur_fld is type Curr and I am getting the sum correctly.

Former Member
0 Kudos
81

Try to load the fieldcat field inttype with 'P'.