‎2008 Dec 14 2:12 PM
Hello experts ,
I have 2 variables : kbetr type CURR ( 2 decimals )
ekpo-menge type QUAN ( 3 decimals )
lv_kbetr type CURR ( 2 decimals ).
For example: kbetr = 3.000
ekpo-menge = 111.00
When i was to multiply like this : kbetr * ekpo-menge ( 3.000 * 111.00) the result that i get is
lv_kbetr = 333000.00 , and this is wrong.
How i should define the variable lv_kbetr such that the answer will be 333.00 ?
Thanks for the help,
AVI.
‎2008 Dec 14 2:16 PM
‎2008 Dec 14 2:16 PM
‎2008 Dec 14 2:31 PM
You cannot use an operation between two special fields like CURR or QUAN if they don't have the same Currency or Unit. You must first convert one of the factor into a number without dimension or into a field of the same currency of unit than the other one. (Look at documents like [Currency Fields |http://help.sap.com/abapdocu/en/ABENCURRENCY_FIELD.htm] for "Handling in ABAP Programs" and [Quantity Fields |http://help.sap.com/abapdocu/en/ABENQUANTITY_FIELD.htm] for "Handling in ABAP Programs ")
The Currency you use should be a price per unit, so convert the quantity in a number using the conversion between the unit of the quantity and the unit of the price per unit. Then you may multiply the price by the dimensionless number.
Here :
- MENGE = 111.00 quan field
- 1 UNIT = 1.00 quan field
- ratio = 111 floating, packed field or decimal floating numbers:(this must not be a QUAN field!)
- MULTIPLY Curr field by ratio should give the good result if the result field has the same currency that the original price field
Regards
‎2008 Dec 15 7:43 AM
Hi,
In pricing procedure, you will need to divide such fields.
-Maharshi