on 01-22-2013 9:05 AM
Hi friends,
I have a pricing issue. In one of my sales order, two line items are having same material code and same pricing structure, but with different quantities. My issue is both the line items unit price should be the same to dot. But I am getting decimal value difference. I know the logic how SAP is doing the calculation and I hope we cannot do anything in the standard for this. So kindly let me know what to do further in this to have same unit price either through standard or any exit / routine, etc.
Here goes the example:
Friendly
Ratna
Hi Ratna,
To control such rounding differenceyou may use alternative calculation with formula which can reduce such arthmatic error.
The issue which you are getting is not SAP issue, This issue coming due to limitation of Mathmatics to handle such number.
To handle such issue you need to work on business process as well as calculation formula.
1. You can write a new calculation formula to handle such condtion value:
for example:
Quantity/ (Condtion Value * 100)
So it means for case 1 you will get result 71464.35/110 = 649.67590 (Take 5 decimal
then multiply result with 100 = 64967.590
in second case it will become 38980.55/60 = 649.67583
Multiply it with 100 = 64967.583
Take result till three decimal and then round up if third decimal is greater than zero
so in first case it will be 64967.59
in second case it will be 64967.59 (round up 3)
This will minimise such decimal difference error.
You may choose multiple unit and formula wisely after analysing the kind of pricing unit business maintain and order units in your business process.
2. Another way is to change in Business process, you may suggest business instead of maintaining records for 1 piece or decimal number quantity, business can use a whole unit say price for 1000 piece in condtion record.
Hope this will help you.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Neeraj Lal,
Thank you for your reply and analysis. I have already tried the first option given by you. But the problem in this is:
1st line item result is 64967.583 and rounding result will be 64967.59 which is no issues
But if suppose the result of 2nd line item is 64967.591 then the rounding up result will be 64967.60 which will not match to the 1st line item unit price.
In this case this rounding up solution will not solve the problem. This will solved for only few documents but not for all.
So kindly suggest.
Ratna
Yes Ratna,
Thats why I mentioned that you need to choose wisely multiplication formula, which suits most of your business scenario.
This is not SAP issue, you need work with business to solve this.
To solve you need to suggest change in business process like how business maintain condtion record. For example business can maintain condtion in absolute number instead of using decimal number. For examle 1100 Euro per 1000 Km in stead of per KM.
Change in Business process and calculation formula will minimise such error
I used similar solution in my previous project and it worked there.
Regards
Ratha,
you can make rounding for price to one decimal place.
In this case, if you have only one decimal place in amount, you will always get what you need.
Example,
1. price = 38 980.55 / 0.600 = 64 967.58
rounding = 0.02 * 0.600 = 0.01
price with rounding = 38 980.56 / 0.6 = 64 967.6
2. price = 71 464.35 / 1.100 = 64 967.59
rounding = 0.01 * 1.100 = 0.01
price with rounding = 71 464.36 / 1.1 = 64 967.6
or something like that.
Thanks,
Evgenii
Hello Ratna Kumar,
As suggested by others Rounding is the best solution to tackle your problem. But just an query is a difference of couple of cents / paise a big matter for y our client?
I means this is practical business scenario & most of the client agree with the difference due to decimal calculations & adopt Rounding rules to suit their need.
Thanks,
Jignesh Mehta
Hi Jignesh,
Thank you for your mail. I am also looking for the best rounding solution only which I am discussing with Neeraj lal with exact numbers. Kindly suggest the logic to have in the rounding rule as per my issue.
Yah some of the international customers will return the invoices even if there is 0.01 difference in unit price.
I know that this is not SAP problem. But I am trying to look some alternatives to have the exact same unit price. If you think rounding rule will clear the issue. Kindly let me know in detail with the numbers from the above example.
Ratna
Dear Neeraj Lal,
Thank you for your reply. Business is always maintaining condition record per 1 KM, for PR00. There is no decimal value (in PR00) in quantity, it is always per 1 KM only. (Only sales order will have quantity in decimals). Still you will suggest to maintain condition record in meters? In that case condition record for PR00 will be always per 1000 meters. We don't have any issue to maintain like this. But can you please tell me in detail (by taking the above example numbers), how this will resolve if I maintain condition record (PR00) per 1000 meters?
And also please let me know the calculation formula in detail, which you are talking about.
Thanking you,
Ratna
Hi Ratna,
The main objective is that, how we can reduce impact of rounding . every iteration can increase rounding error. Mutiplying and dividing with 1000 or 10000 you are allowing system to calculate more decimal value. Otherwise after each iteration, system is rounding value to two decimal which intensify error.
In case your business is ready to enter order quantity in meter than you can maintain pricing unit in 1000 meters. You need to check how business can adopt new change to minimise such error. It will be good to maintian pricing unit in 100 or 1000 or any such unit.This will minimise rounding error.
Same way you need to rewrite formula in such a way that where actual rounding impact come at the end result. For example calculating order value and then converting it to another currency here during calculation of order value may add rounding error which may again intensify when converting calculated value in USD to Lira or any such currency.
You need to check you business process carefully and take action on point which are intensifying such error by keeping above point in consideration. This will minimise such rounding error in results.
Regards
Hi Ratna,
You can use the BAPI_SALESORDER_CHANGE bapi to change the sale order values.This BAPI is used to change the values of the existing sale order which will directly gets reflected in the transaction level and table level.
Also refer the below link if you want to change the value using user-exit.
http://scn.sap.com/thread/591419
Thanks,
Umashankar
Hello,
i think, there is only one way to control it -- rounding.
You need to create new rounding routine in VOFM-formulas-condition values and add new condition type with this formula.
Of course, rounding depends on number of decimal places in amount. It's just a math.
Thanks,
Evgenii Sakovich
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ratna,
This is happening b'coz amounts get reverse calculated based on condition amount for subtotal's amount in the pricing procedure. Refer following table for calculation
Quantity | Condition Value | Calculation | Amount per unit amount |
---|---|---|---|
1.100 | 71464.35 | 71464.35 / 1.100 | 64967.59 |
0.600 | 38980.55 | 38980.55 / 0.600 | 64967.58 |
Regards, JP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.