on 01-13-2005 3:18 PM
Hi,
I am trying to divide a currency field with quantity field and want to store the result in currency field or decimal field. I tried it as below...
DATA: l_field1 LIKE J_1IEXCDTL-EXBAS,
l_field2 LIKE j_1iexcdtl-menge,
l_field3 TYPE p DECIMALS 2.
l_field1 = ' 165915.00'.
l_field2 = ' 15.000'.
l_field3 = l_field1 / l_field2.
WRITE 😕 l_field3.
I am getting the desired result (output is comming as 11061.00).
But same thing is not working, output is comming as 11.06 for below code...
l_field3 = it_excdtl-exbas / it_excdtl-menge.
Why? How to solve it.
Advance thanks.
Regards,
Balaji Viswanath.
More details would help.
Is it_excdtl-exbas defined the same as J_1IEXCDTL-EXBAS? Likewise for it_excdtl-menge and j_1iexcdtl-menge?
What dictionary data element do they refer to?
Do you have the Fixed Point Arithmetic flag set in the attributes of your program?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Balaji,
one possible reason:
fields it_excdtl-exbas and it_excdtl-menge are referred to currency and unit fields. They are filled in your 11.05-case. Behind currency decimal definition can be customized (e.g. US-dollar 2, Italian Lira 0). Behind unit decimals can be customized (e.g. kilogram 3, piece 0). So different 'real' amounts can be defined.
Theses customizing is different to the number of default decimals, which is defined behind fields exbas and menge - which is used in debugger and SE16.
Check, if your currency for exbas has 5 decimals (table TCURX) - then 11.06 is correct value.
If you can't find a reason - just move value and amount into dummy-fields before calculation. Then it should work like i_fieldx-example.
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.