‎2007 Dec 13 3:24 PM
Hi,
I have two variables A and B, A is referring data element NTGEW_15 and B is referring data element NETWR
I declared C variable of type BRGEW_15.
In my program I am doing C = A* B.
The values of A and B are coming 151.000 and 100.00 at runtime.
After multiplying these two variables the variable c contains 1510000.000 but it should be 15100.000.
Please tell me where I did mistake.
My user settings contains in 1.234.567,89 format.
Please help me I will give points.
Thanks a lot in advance.
‎2007 Dec 13 3:34 PM
Make sure you have 'fixed point arithmetic' checked in the attibutes.
Rob
‎2007 Dec 13 3:34 PM
Hi,
change your decimal notations to '1,234,567.89' in ur user profile using Tcode SU3.
make sure that after changing you have to logoff and login again.
then test the same it will work.
find the sample code below.
data: l1 type NTGEW_15 value '151.000',
l2 type NETWR value '100.00',
res type BRGEW_15.
res = l1 * l2.
write:/ res.
Reward if useful.
Thanks,
Sreeram.
‎2007 Dec 13 3:39 PM
‎2007 Dec 13 4:24 PM
Hi,
have you logged off after changing the setting in SU3, logoff first and then login again then only the changes will get effected.
Reward if useful,
Thanks,
Sreeram.
‎2007 Dec 13 3:35 PM
I have the same decimals representation, and i had made a report with the multiplication and the result is correct. Perhaps the B variable don´t have 100.00, perhaps it is 10000.
How do you store the dates in the variables?
‎2007 Dec 13 3:37 PM
it_item1-tot = vbdpr-ntgew * vbdpr-netwr.
vbdpr-ntgew contains the value 151.000
vbdpr-netwr contains 100.00
in development i also tested it is working fine but in quality it is giving problem but in both the cases user setting format is same.
‎2007 Dec 13 3:41 PM
my user settings are in other way but still coming up 1510000.000.
Copy all of them into char fields and then do your calculations.
Otherwise
c= c / 100.
‎2007 Dec 13 4:14 PM
hi ,
replace all occurences of ',' by space in A.
replace all occurences of ',' by space in b.
replace all occurences of ',' by space in c.
condense a.
condense b.
condense c.
c = a* b
‎2007 Dec 13 4:41 PM
Hi,
try this
Data: w_a type p decimals 2,
w_b type p decimals 2,
w_c type p decimals 2.
move a to w_a.
move b to w_b.
w_c = w_a * w_b.
move w_c to c.
Regards..
FC