‎2009 May 06 6:09 AM
Hi Friends,
I have used a quantity field of type mseg-erfmg in a query report, when i am multiplying it by gross weight which is also of same data type it is not giving me proper results.
Ex: 4.000 * 0.750 it is giving me as 3000 instead of 3.
But 4.000 + 0.750 is 4.750 which is right.
It is considering 4.000 as 4000. I tried moving it to a data type declared of type p decimals 0, then also it is coming as 4000 instead of 4.
‎2009 May 06 6:32 AM
Hi Meenu,
Just check in your program this condition, every thing will be set right.
From your program, (Menu bar) Goto-> Attributes->Fixed point Airthmetic...
Make sure this field is marked,,, then check your program,
Thanks & regards,
Dileep .C
‎2009 May 06 6:16 AM
Hi Meenu ,
This looks strange , what i would suggest is put a break point at the multiplication statement and see the values that are being used and the output also .
I think there must be some issue with the data being used in the statement , in case you are unable to figure of the issue please paste your code here , so that we can try to find the issue.
Regards
Arun
‎2009 May 06 6:17 AM
Hi,
Check this code..it is working fine for me ..
DATA g_erfmg TYPE mseg-erfmg VALUE '4.000'.
DATA g_750 type mseg-erfmg VALUE '0.750'.
DATA g_value type mseg-erfmg.
g_value = g_erfmg * g_750 .
Write g_value.
‎2009 May 06 6:20 AM
Use the following code.
DATA :field1 type mseg-erfmg,
field2 type mseg-erfmg,
X(15) type c.
X = field1 * field2.
Hope it will solve ur problem.
‎2009 May 06 6:25 AM
Hi,
Please check the attributes of the program, if "Fixed Point arithmetic" check box is checked or not.
If the check box is not checked please activate "Fixed Point arithmetic" and execute the code.
Regards,
Shruti
‎2009 May 06 6:28 AM
Hi,
Try with this,
data:w_erfmg TYPE mseg-erfmg VALUE '4.000',
w_wt TYPE mseg-erfmg VALUE '0.750',
w_data TYPE p DECIMALS 0.
w_data = w_erfmg * w_wt.
write w_data.
This will give u values as 3.
and if u used w_data type mseg-erfmg , it gives u value as 3.000Thanks & Regards,
Anagha Deshmukh
‎2009 May 06 6:28 AM
Yes in normal report it is working fine but I have written this code in a query report where I am facing this issue.
data : qty type mseg-erfmg,
wt type mseg-erfmg.
qty = mseg-erfmg.
wt = qty * mara-brgew.
‎2009 May 06 6:30 AM
hi meenu b,
check the below code ,it might help u:-
report ZNEW32.
tables: mseg.
data: begin of itab OCCURS 0,
mblnr like mseg-mblnr,
matnr like mseg-matnr,
werks like mseg-werks,
erfmg like mseg-erfmg,
BRGEW like mara-BRGEW,
aa type p DECIMALS 2,
end of itab.
PARAMETERS: plant like mseg-werks,
mblnr like mseg-mblnr.
select a~mblnr a~matnr a~werks a~erfmg b~BRGEW
from mseg as a INNER JOIN mara as b on b~matnr = a~matnr
into table itab where a~werks = plant and a~mblnr = mblnr.
loop at itab.
itab-aa = itab-erfmg * itab-brgew.
write: / itab-mblnr,itab-matnr,itab-erfmg,itab-brgew,itab-aa.
ENDLOOP.
revert back if u need more help.
Edited by: ricx .s on May 6, 2009 7:30 AM
‎2009 May 06 6:32 AM
Hi Meenu,
Just check in your program this condition, every thing will be set right.
From your program, (Menu bar) Goto-> Attributes->Fixed point Airthmetic...
Make sure this field is marked,,, then check your program,
Thanks & regards,
Dileep .C