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

Pricing Routine-Calculation gives Wrong value

Former Member
0 Likes
1,202

Dear Experts,

I have a simal requirements, just i want to calculate my basic value divided by tax amount. So i have incorporated the the logic in to a pricing routine, When i check the output its gave a wrong value. So i debuged the program i came to know while doing division its not working properly. I made the same code ( for testing ) in a normal z program its giving the correct value. How to manage this issue?


    data : l_mrp1_temp1 type  p decimals 4.
    data : i_value4 TYPE  p decimals 4 value '3.7600'.
    data : l_tax1 type p DECIMALS 4 VALUE '1.1376'.
    l_mrp1_temp1 = i_value4 / c_tax1 * 100.
    
     xkomv-kbetr =   l_mrp1_temp1 . 

Reg,

Mohana

3 REPLIES 3
Read only

Shahid
Product and Topic Expert
Product and Topic Expert
0 Likes
641

330.5203..this should be the result of your calculation.

What is the value that you are getting in the pricing routine? Have you checked in debug mode?

Division is not working properly? or this " xkomv-kbetr = l_mrp1_temp1 " statemen?

Read only

Former Member
0 Likes
641

Hi

Perhaps the problem is the flag "Fixed point aritmhetic" is set in the attribute of your z-program but not in the main of the pricing routine (probably SAPLV61A)

If it's so, try to run your modification in a your function module where main program has that flag

Max

Read only

Shahid
Product and Topic Expert
Product and Topic Expert
0 Likes
641

thaz true, i experienced those sort of calculation issues when "Fixed point aritmhetic" is not checked in the attributes of classes. I wasnt aware that it might happen in the reports too. thz was the reason i was asking for the result of the calculation you have got