2007 Aug 03 10:22 AM
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'
' ' 'Αρ.Γραμμων' ' ' 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
2007 Aug 03 11:45 AM
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.
2007 Aug 03 11:45 AM
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.
2007 Aug 03 1:09 PM