2006 Sep 21 12:44 PM
in the following code when i am executing it is going to dump with message
'VALUE TOO LARGE FOR CALCULATING TOTALS IN INTERNAL TABLE,
FIELD TOO '
i don't know why?
plz check my code and give the solution .
&----
*& Report Z_VENDOR AGEING *
*& *
&----
*& in this repoet I am calculating the vendor ageing
which is depending on formula
AGEING = Current Date(or any date entered by user) Bline Date(BSIK-ZFBDT) *
*& *
&----
REPORT z_vendor NO STANDARD PAGE HEADING
LINE-SIZE 200
LINE-COUNT 65(3).
TABLES : bsik.
DATA : BEGIN OF t_out OCCURS 0,
bukrs LIKE bsik-bukrs,
saknr LIKE bsik-saknr,
bldat LIKE bsik-bldat,
wrbtr LIKE bsik-wrbtr,
lifnr LIKE bsik-lifnr,
zfbdt like bsik-zfbdt,
zbd1t like bsik-zbd1t,
ageing type i,
END OF t_out.
parameters : p_date1 type d.
SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
s_saknr FOR bsik-saknr,
s_lifnr FOR bsik-lifnr.
SELECT bukrs saknr bldat wrbtr lifnr zfbdt zbd1t
FROM bsik
INTO TABLE t_out
WHERE saknr IN s_saknr
AND bukrs IN s_bukrs
AND lifnr IN s_lifnr.
Loop at t_out.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = p_date1
i_datum_von = t_out-zfbdt
I_KZ_EXCL_VON = '0'
I_KZ_INCL_BIS = '0'
I_KZ_ULT_BIS = ' '
I_KZ_ULT_VON = ' '
I_STGMETH = '0'
I_SZBMETH = '1'
IMPORTING
E_TAGE = t_out-ageing
EXCEPTIONS
DAYS_METHOD_NOT_DEFINED = 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.
Modify t_out.
Clear t_out.
Endloop.
LOOP AT T_OUT.
IF T_OUT-SHKZG = H.
T_OUT-WRBTR = T_OUT-WRBTR * -1.
T_OUT-WRBTR = T_OUT-DMBTR * -1.
ENDIF.
DATA: TOTAL(16) TYPE P DECIMALS 2.
TOTAL = TOTAL + T_OUT-DMBTR.
WRITE : / t_out-saknr,
t_out-lifnr,
t_out-wrbtr,
t_out-zfbdt,
T_OUT-DMBTR,
t_out-ageing.
AT LAST.
SUM.
WRITE:/ TOTAL.
CLEAR TOTAL.
ENDAT.
ENDLOOP.
Message was edited by: sanjeev singh
2006 Sep 21 12:50 PM
hi,
REPORT z_vendor NO STANDARD PAGE HEADING
LINE-SIZE 200
LINE-COUNT 65(3).
TABLES : bsik.
DATA : BEGIN OF t_out OCCURS 0,
bukrs LIKE bsik-bukrs,
saknr LIKE bsik-saknr,
bldat LIKE bsik-bldat,
wrbtr LIKE bsik-wrbtr,
lifnr LIKE bsik-lifnr,
zfbdt like bsik-zfbdt,
zbd1t like bsik-zbd1t,
ageing type i,
END OF t_out.
parameters : p_date1 type d.
SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
s_saknr FOR bsik-saknr,
s_lifnr FOR bsik-lifnr.
SELECT bukrs saknr bldat wrbtr lifnr zfbdt zbd1t
FROM bsik
INTO TABLE t_out
WHERE saknr IN s_saknr
AND bukrs IN s_bukrs
AND lifnr IN s_lifnr.
Loop at t_out.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = p_date1
i_datum_von = t_out-zfbdt
I_KZ_EXCL_VON = '0'
I_KZ_INCL_BIS = '0'
I_KZ_ULT_BIS = ' '
I_KZ_ULT_VON = ' '
I_STGMETH = '0'
I_SZBMETH = '1'
IMPORTING
E_TAGE = t_out-ageing
EXCEPTIONS
DAYS_METHOD_NOT_DEFINED = 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.
Modify t_out.
Clear t_out.
Endloop.
<b>LOOP AT T_OUT.</b> " <b>where is the end loop</b>
IF T_OUT-SHKZG = H.
T_OUT-WRBTR = T_OUT-WRBTR * -1.
T_OUT-WRBTR = T_OUT-DMBTR * -1.
ENDIF.
DATA: TOTAL(16) TYPE P DECIMALS 2.
TOTAL = TOTAL + T_OUT-DMBTR.
LOOP AT t_out.
WRITE : / t_out-saknr,
t_out-lifnr,
t_out-wrbtr,
t_out-zfbdt,
T_OUT-DMBTR,
t_out-ageing.
AT LAST.
SUM.
WRITE:/ TOTAL.
CLEAR TOTAL.
ENDAT.
ENDLOOP.
rgds
anver
in the following code when i am executing it is going to dump with message
'VALUE TOO LARGE FOR CALCULATING TOTALS IN INTERNAL TABLE,
FIELD TOO '
i don't know why?
plz check my code and give the solution .
&----
*& Report Z_VENDOR AGEING *
*& *
&----
*& in this repoet I am calculating the vendor ageing
which is depending on formula
AGEING = Current Date(or any date entered by user) Bline Date(BSIK-ZFBDT) *
*& *
&----
REPORT z_vendor NO STANDARD PAGE HEADING
LINE-SIZE 200
LINE-COUNT 65(3).
TABLES : bsik.
DATA : BEGIN OF t_out OCCURS 0,
bukrs LIKE bsik-bukrs,
saknr LIKE bsik-saknr,
bldat LIKE bsik-bldat,
wrbtr LIKE bsik-wrbtr,
lifnr LIKE bsik-lifnr,
zfbdt like bsik-zfbdt,
zbd1t like bsik-zbd1t,
ageing type i,
END OF t_out.
parameters : p_date1 type d.
SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
s_saknr FOR bsik-saknr,
s_lifnr FOR bsik-lifnr.
SELECT bukrs saknr bldat wrbtr lifnr zfbdt zbd1t
FROM bsik
INTO TABLE t_out
WHERE saknr IN s_saknr
AND bukrs IN s_bukrs
AND lifnr IN s_lifnr.
Loop at t_out.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = p_date1
i_datum_von = t_out-zfbdt
I_KZ_EXCL_VON = '0'
I_KZ_INCL_BIS = '0'
I_KZ_ULT_BIS = ' '
I_KZ_ULT_VON = ' '
I_STGMETH = '0'
I_SZBMETH = '1'
IMPORTING
E_TAGE = t_out-ageing
EXCEPTIONS
DAYS_METHOD_NOT_DEFINED = 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.
Modify t_out.
Clear t_out.
Endloop.
LOOP AT T_OUT.
IF T_OUT-SHKZG = H.
T_OUT-WRBTR = T_OUT-WRBTR * -1.
T_OUT-WRBTR = T_OUT-DMBTR * -1.
ENDIF.
DATA: TOTAL(16) TYPE P DECIMALS 2.
TOTAL = TOTAL + T_OUT-DMBTR.
WRITE : / t_out-saknr,
t_out-lifnr,
t_out-wrbtr,
t_out-zfbdt,
T_OUT-DMBTR,
t_out-ageing.
AT LAST.
SUM.
WRITE:/ TOTAL.
CLEAR TOTAL.
ENDAT.
ENDLOOP.
Message was edited by: sanjeev singh
2006 Sep 21 12:48 PM
Hi
Debug the program na u will trace where exactly the error is coming and where it is going into dump.
Regards
haritha
2006 Sep 21 12:49 PM
Hello,
1. U are running the internal table 'LOOP AT t_out.',twice why i dont understand.
2.Try to change the chracterstics of the varible for which the it is overflowing.Make it Packed decimals.
Please check this and let me know.
Regards
2006 Sep 21 12:50 PM
hi,
REPORT z_vendor NO STANDARD PAGE HEADING
LINE-SIZE 200
LINE-COUNT 65(3).
TABLES : bsik.
DATA : BEGIN OF t_out OCCURS 0,
bukrs LIKE bsik-bukrs,
saknr LIKE bsik-saknr,
bldat LIKE bsik-bldat,
wrbtr LIKE bsik-wrbtr,
lifnr LIKE bsik-lifnr,
zfbdt like bsik-zfbdt,
zbd1t like bsik-zbd1t,
ageing type i,
END OF t_out.
parameters : p_date1 type d.
SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
s_saknr FOR bsik-saknr,
s_lifnr FOR bsik-lifnr.
SELECT bukrs saknr bldat wrbtr lifnr zfbdt zbd1t
FROM bsik
INTO TABLE t_out
WHERE saknr IN s_saknr
AND bukrs IN s_bukrs
AND lifnr IN s_lifnr.
Loop at t_out.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = p_date1
i_datum_von = t_out-zfbdt
I_KZ_EXCL_VON = '0'
I_KZ_INCL_BIS = '0'
I_KZ_ULT_BIS = ' '
I_KZ_ULT_VON = ' '
I_STGMETH = '0'
I_SZBMETH = '1'
IMPORTING
E_TAGE = t_out-ageing
EXCEPTIONS
DAYS_METHOD_NOT_DEFINED = 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.
Modify t_out.
Clear t_out.
Endloop.
<b>LOOP AT T_OUT.</b> " <b>where is the end loop</b>
IF T_OUT-SHKZG = H.
T_OUT-WRBTR = T_OUT-WRBTR * -1.
T_OUT-WRBTR = T_OUT-DMBTR * -1.
ENDIF.
DATA: TOTAL(16) TYPE P DECIMALS 2.
TOTAL = TOTAL + T_OUT-DMBTR.
LOOP AT t_out.
WRITE : / t_out-saknr,
t_out-lifnr,
t_out-wrbtr,
t_out-zfbdt,
T_OUT-DMBTR,
t_out-ageing.
AT LAST.
SUM.
WRITE:/ TOTAL.
CLEAR TOTAL.
ENDAT.
ENDLOOP.
rgds
anver
2006 Sep 21 12:56 PM
sorry anvera
actually i have used loop at t_out twice but now i have used it once u can check the code i have modified it .
but still data overeflows for total why?
2006 Sep 21 1:01 PM
hi sanjeev,
where is this value - > <b>T_OUT-DMBTR</b>
there is no field like that in T_OUT.
rgds
anver
2006 Sep 21 1:02 PM
<b>CHECK the below</b>
Please change the last LOOP code as below...bold add the line and underline is to delete the line.
<b>DATA: TOTAL(18) TYPE P DECIMALS 2.</b>LOOP AT T_OUT.
IF T_OUT-SHKZG = H.
T_OUT-WRBTR = T_OUT-WRBTR * -1.
T_OUT-WRBTR = T_OUT-DMBTR * -1.
ENDIF.
TOTAL = TOTAL + T_OUT-DMBTR.
WRITE : / t_out-saknr,
t_out-lifnr,
t_out-wrbtr,
t_out-zfbdt,
T_OUT-DMBTR,
t_out-ageing.
AT LAST.
<u>SUM.</u>
WRITE:/ TOTAL.
CLEAR TOTAL.
ENDAT.
ENDLOOP.
Message was edited by: Anurag Bankley
2006 Sep 21 1:02 PM
try.
*DATA: TOTAL(16) TYPE P DECIMALS 2.
<b> data: total type TGFMV.</b>
TOTAL = TOTAL + T_OUT-DMBTR.
WRITE : / t_out-saknr,
t_out-lifnr,
t_out-wrbtr,
t_out-zfbdt,
T_OUT-DMBTR,
t_out-ageing.
AT LAST.
SUM.
WRITE:/ TOTAL.
CLEAR TOTAL.
ENDAT.
ENDLOOP.
2006 Sep 21 1:04 PM
Hi,
Change The Data Type of total if ur values are tooo large.And do Not Declare a Variable inside a Loop .Make at The begining of the program.
Regards
Ahasan
2006 Sep 21 1:06 PM
i might have forgotten to mention yaar.
u think that t_out dmbtr is there.
and give the possible solution.
i
2006 Sep 21 1:17 PM
hi kishan
what is this TGFMV.
when i used it a message comes that this type doesn't exist.
2006 Sep 21 1:18 PM
hi anurag
for type p only 16 is allowed boss.
so give some other solutions
2006 Sep 21 1:43 PM
The problem is with the SUM statement..take that out as you need only the total calculated by you rather than all fields.
2006 Sep 21 1:49 PM
hi,
now try this code.
TABLES : bsik.
DATA : BEGIN OF t_out OCCURS 0,
bukrs LIKE bsik-bukrs,
saknr LIKE bsik-saknr,
bldat LIKE bsik-bldat,
wrbtr LIKE bsik-wrbtr,
lifnr LIKE bsik-lifnr,
zfbdt like bsik-zfbdt,
zbd1t like bsik-zbd1t,
ageing type i,
END OF t_out.
parameters : p_date1 type d.
SELECT-OPTIONS : s_bukrs FOR bsik-bukrs,
s_saknr FOR bsik-saknr,
s_lifnr FOR bsik-lifnr.
SELECT bukrs saknr bldat wrbtr lifnr zfbdt zbd1t
FROM bsik
INTO TABLE t_out
WHERE saknr IN s_saknr
AND bukrs IN s_bukrs
AND lifnr IN s_lifnr.
Loop at t_out.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = p_date1
i_datum_von = t_out-zfbdt
I_KZ_EXCL_VON = '0'
I_KZ_INCL_BIS = '0'
I_KZ_ULT_BIS = ' '
I_KZ_ULT_VON = ' '
I_STGMETH = '0'
I_SZBMETH = '1'
IMPORTING
E_TAGE = t_out-ageing
EXCEPTIONS
DAYS_METHOD_NOT_DEFINED = 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.
Modify t_out.
Clear t_out.
Endloop.
<b>DATA: TOTAL(16) TYPE P DECIMALS 2.</b>
<b>LOOP AT T_OUT.</b>
IF T_OUT-SHKZG = H.
T_OUT-WRBTR = T_OUT-WRBTR * -1.
<b>T_OUT-DMBTR = T_OUT-DMBTR * -1.</b>
ENDIF.
<b>TOTAL = TOTAL + T_OUT-WRBTR + T_OUT-DMBTR.</b>
WRITE : / t_out-saknr,
t_out-lifnr,
t_out-wrbtr,
t_out-zfbdt,
T_OUT-DMBTR,
t_out-ageing.
<b>AT LAST.
WRITE:/ TOTAL.
CLEAR TOTAL.
ENDAT.</b>
<b>ENDLOOP.</b>
rgds
anver
if hlped mark points
2006 Sep 22 8:33 AM
2006 Sep 22 8:52 AM
Hello Sanjeev,
Can u tell me how the problem is solved.
Code will be more help full.
Regards,
Ravi
2006 Sep 21 12:52 PM
hi Sanjeev,
try this way out
LOOP AT T_OUT.
IF T_OUT-SHKZG = H.
T_OUT-WRBTR = <b> (( T_OUT-WRBTR ) * -1 )</b>.
T_OUT-WRBTR = <b> (( T_OUT-DMBTR ) * -1 )</b>.
ENDIF.
DATA: TOTAL(16) TYPE P DECIMALS 2.
TOTAL = TOTAL + T_OUT-DMBTR.
<b>ENDLOOP.</b>
Regards,
Santosh
2006 Sep 21 2:58 PM
hi sanjeev,
if ur issue solved, kindly close the thread after giving points to helpful answers.
rgds
anver
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |