2012 Mar 01 7:22 AM
data l_dmbtr type dmbtr. " curr 13 2
data l_dec type zdec. " dec 12 6
l_dec = '10.000000'.
l_dmbtr = 10000 * l_dec.
in program, the L_dmbtr get value '100000.00',
but in OO context, l_dmbtr get value '1000000000.00'.
could someone give me some link to explain the calculation of the DEC and CURR?
and is there the problem of OO context?
data l_dmbtr type dmbtr. " curr 13 2
data l_dec type zdec. " dec 12 6
l_dec = '10.000000'.
l_dmbtr = 10000 * l_dec.
in program, the L_dmbtr get value '100000.00',
but in OO context, l_dmbtr get value '1000000000.00'.
could someone give me some link to explain the calculation of the DEC and CURR?
and is there the problem of OO context?
2012 Mar 01 7:29 AM
2012 Mar 01 8:01 AM
there is nothing related to OO context over here, go to program attribute window and check a checkbox names "Fixed Point Arithmatic", your problem will be solved.
2012 Mar 01 8:36 AM
Hi,
Fixed point arithmetic
If you mark this checkbox, all calculations in the program will use fixed point arithmetic.
If you do not, packed numbers (ABAP/4 type P, Dictionary types CURR, DEC or QUAN) will be treated as integers when they are used in assignments, comparisons, and calculations, irrespective of the number of decimal places defined. Intermediate results in arithmetic calculations will also be rounded to the next whole number. The number of decimal places defined is only taken into account when you output the answer using the WRITE statement.
Regards,
Gaurav
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |