Application Development 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: 

calculation problem in Pricing Routine

Former Member
0 Kudos

Hello every one,

I am working on pricing routine.

I am doing some arthematic calculations.

It is giving some odd reasults and i am unable to resolve it.

I guess it is problem with conversion and type miss match.

data : p1(16) decimals 5,

p2(16) decimals 5,

result type komv-kwert,

rate type komv-kbetr.

p1 = 70.00000.

p2 = 70.00000.

rate = 100.00.

result = rate * ( p1 / p2 ).

i am expecting result to be 100.00.

But result is not 100.00.

It is giving some odd figure.

can any one suggest me to resolve this issue.. and how to convert data types to overcome this problem.

Thanks in advance

ragards

Sunil

1 ACCEPTED SOLUTION

Former Member
0 Kudos

data : p1(16) type p decimals 5,

p2(16) type p decimals 5,

result type komv-kwert,

rate type komv-kbetr.

p1 = '70.00000'.

p2 = '70.00000'.

rate = '100.00'.

result = rate * ( p1 / p2 ).

write result.

i m getting 100.00 as output for the above code.

Check whether Fixed Point arithmetic checkbox is checked in the attributes of the program in se38 , if it is not checked you will get a diff value.

1 REPLY 1

Former Member
0 Kudos

data : p1(16) type p decimals 5,

p2(16) type p decimals 5,

result type komv-kwert,

rate type komv-kbetr.

p1 = '70.00000'.

p2 = '70.00000'.

rate = '100.00'.

result = rate * ( p1 / p2 ).

write result.

i m getting 100.00 as output for the above code.

Check whether Fixed Point arithmetic checkbox is checked in the attributes of the program in se38 , if it is not checked you will get a diff value.