Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

calculation problem in Pricing Routine

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

replied

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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question