09-09-2008 9:52 AM
Hi Gurus,
I am trying to do multiplication of two quantities in this given code.
t_temp1-comp2_qty = v_comp1_qty * t_stpo2-menge.
But qunatity value is coming too large.
So I am getting the "Overflow for arithmetical operation (type P) in program "ZOUM_R021 ".
Actual code is like this.
LOOP AT t_stpo2 WHERE stlnr = t_mast2-stlnr.
t_temp1-idnrk = t_stpo2-idnrk.
t_temp1-bwkey = t_stpo2-werks.
t_temp1-stlnr = t_stpo2-stlnr.
t_temp1-comp2_qty = v_comp1_qty * t_stpo2-menge.
COLLECT t_temp1.
CLEAR t_temp1.
ENDLOOP.
wherer v_comp1_qty and t_stpo2-menge
is already calculated value.
Then please suggest how to avoid this overflow .
Regards,
Amit Kumar Singh
09-09-2008 9:57 AM
09-09-2008 10:06 AM
09-09-2008 9:58 AM
Hi,
declare the target variable in the similar way as shown below:
t_temp1-comp2_qty(30) type p decimal 4...
Regards,
Kunjal
09-09-2008 10:03 AM
Hi Amit,
Declare all the variables of type F (float), then you wont get the overflow error while multiplying....
Hope it helps
Regards,
Sujatha
09-09-2008 10:31 AM
>
> Hi Amit,
>
> Declare all the variables of type F (float), then you wont get the overflow error while multiplying....
>
> Hope it helps
>
> Regards,
> Sujatha
Type F will lose accuracy. Better declare a type P of sufficient size to hold the product.
09-09-2008 10:41 AM
Hi all,
I used like this.
DATA l_quant(16) TYPE p decimals 3.
My program is working for max of 14 length.
Still it's giving error if i give input more than 14 length data.
Please suggest is there any way to sort out this error.
Regards,
Amit Kumar Singh