Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

calculation between type DEC & CURR

Former Member
0 Likes
1,721

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?

3 REPLIES 3
Read only

davis_raja
Active Participant
0 Likes
1,180

Use the data type PACKED

Read only

former_member194152
Contributor
0 Likes
1,180

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.

Read only

Former Member
0 Likes
1,180

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