09-11-2007 2:53 PM
Hi,
I am trying to multiply 2 fields (TYPE KBETR) and store the result in a field (KBETR). When I multiply 722.00 * 279.00 value is getting stored as 20143800.00 instead of 201438.00. Why? & how to correct it.
Thanks in advance.
Regards,
Balaji Viswanath.
09-11-2007 2:58 PM
Hello Balaji,
Do you have "Fixed point arithmetic" set in the attributes of your program.
Regard,
Chester
09-11-2007 2:58 PM
Try debugging your code. It should work fine.
data: field1 type KBETR,
field2 type KBETR,
field3 type KBETR.
field1 = '722.00'.
field2 = '279.00'.
field3 = field1 * field2.
WRITE: / field3.
Output:
201,438.00
09-11-2007 2:58 PM
Hello Balaji,
Do you have "Fixed point arithmetic" set in the attributes of your program.
Regard,
Chester
09-11-2007 2:58 PM
Hi,
The resule field should also the type KBETR.
i ahve writen an example program and it is working fine
data: var1 type KBETR.
data: var2 type KBETR.
data: var3 type KBETR.
var1 = '722.00'.
var2 = '279.00'.
var3 = var1 * var2.
Write:/ var3.
Regards
Sudheer
09-11-2007 3:24 PM
What is the aim of the operation ? In which business case do you have to multiply an amount by another amount ? What is the unit of the result ? Square currency unit ?
09-11-2007 3:41 PM
Hi Balaji,
If you are handling Japan/Korean currency then it will be multiplied by internally 100 by SAP itself . Please check the function module CURRENCY_AMOUNT_SAP_TO_DISPLAY. Here you have to pass the amount and currency key then you will get the SAP display for the amount entered.
<b><REMOVED BY MODERATOR></b>
Regards,
Shaju
Message was edited by:
Alvaro Tejada Galindo
09-11-2007 4:16 PM
check currency setting in User Profile-Own Data-Decimal
hope it will resolved.
09-12-2007 7:19 AM
Hi,
Actually I have written the code inside include MV45AFZZ in turn it's under include SAPMV45A, in that Fixed point arithmetic is not selected. Since it's standard SAP program I can't change it. So now I am dividing the output by 100.
Thanks to everyone.
Regards,
Balaji Viswanath.
09-12-2007 8:23 AM
Hi Balaji,
Yes, you will need to divide by 100. With fixed point aritmetic this calculation would have been performed successfully.
Regards,
Chester