‎2008 Dec 24 12:26 PM
Hi experts,
I need to avoid some Fields in structure while using SUM macro's within loop.
My program terminates due to "SUM_OVERFLOW ", pl suggest me how to avoid this issue.
Thanks and Regards,
Ramachandran S
‎2008 Dec 24 12:29 PM
hi,
Declare the field which you are using for SUM with large values.
‎2008 Dec 24 12:30 PM
Length of SUMMING field should be more
Declare as such and check.
‎2008 Dec 24 12:30 PM
Increase the length of that quantity field (or) currency field.
Regards
‎2008 Dec 26 4:25 AM
Hi chandra madapati,
First thanks for your timely reply,
The table i'm using is not changeable, so i have to use the same length and field type. While calculating SUM i need to avoid those fields with a low length and which i don't take to process.
Thanks and Regards,
Ramachandran
Edited by: Ramachandran Sivaraman on Dec 26, 2008 9:55 AM
‎2008 Dec 26 4:36 AM
Hi Ram,
Did you check the value of the sum in debuggin ??? which data element are you using?
you can also use user defined variable in the internal tables if standard table fields are falling short.
for example
data : begin of itab occurs 0.
include structure mara.
data : quan(20) type p decimals 3,
end of itab.
here you can use quan field if standard fields falling short of requirement.
First check the value in Debug mode is it going beyond the allowed length.
Regards
Ramchander Rao.K
‎2008 Dec 24 1:03 PM
Hi,
Increase the length of the SUM field in ur declaration so that it accoumodate
how many digits ur 'SUM' field has.
‎2008 Dec 24 2:17 PM
Fields which u want to avoid make them as char type if possible.
Else use bapicurr_d to declare numeric pack variables.
‎2008 Dec 26 4:30 AM
Dear,
Can u paste your code here, so that you will get more ideas.
Regards,
‎2008 Dec 26 4:59 AM
Hi chandra,
The code is pasted below ,
DATA: it_opbal_temp type table of rfposxext with header line ,
it_opbal_sum type table of rfposxext with header line .
{color:green}Inside where i used sum field the error occurs due to field zbd1t which is Dec with 3 len
{color}
clear it_opbal_sum[].
loop at it_opbal.
it_opbal_temp[] = it_opbal[].
delete it_opbal_temp where konto ne it_opbal-konto.
loop at it_opbal_temp.
sum.
append it_opbal_temp to it_opbal_sum.
exit.
endloop.
append it_opbal_temp to it_opbal_sum.
delete it_opbal where konto eq it_opbal-konto.
endloop.
The rfposxext is Global structure so i cannot modify the len of the fields.
The error occurs due to overflow of zbd1t field so i need some help to avoid this field while processing.
or
If we can move the value of it_opbal_temp to another internal table which has specify fields of structure rfposxext. I tried this using move-corresponding , the values not moving to another internal table.
Regards,
Ramachandran
‎2008 Dec 26 5:03 AM
Hi
it_opbal_temp[] = it_opbal[].
--Just comment this part
loop at it_opbal.
delete it_opbal_temp where konto ne it_opbal-konto.
--
loop at it_opbal_temp.
use control break statements starts with AT like AT NEW etc
for more info Take F1 help
then use key word SUM
endloop.
Regards
Ramchander Rao.K
‎2008 Dec 26 5:12 AM
Hi,
Thanks for your reply.
I tired AT New too even then the zbd1t field overflow due to it have move values in internal table for particular konto, zbd1t contains only two digit like "15,15,30,26 " but the total length is 3. if we sum this internal table the zbd1t field alone gets overflow.
Regards,
Ramachandran