Former Member

### Pricing issue - Unit price difference

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

Capture.JPG (52.5 kB)
Capture1.JPG (51.5 kB)
10|10000 characters needed characters exceeded

• Jan 22, 2013 at 09:20 AM

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

QuantityCondition ValueCalculation

A﻿mount

per unit amount

1.10071464.3571464.35 / 1.100 64967.590.60038980.5538980.55 / 0.60064967.58

Regards, JP

10|10000 characters needed characters exceeded
• Jyoti Prakash Former Member

Fine... That's a standard behaviour. And I don't think you can control this.

Thanks, JP

• Jan 22, 2013 at 11:15 AM

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.

Regards

10|10000 characters needed characters exceeded
• Former Member Former Member

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.

Thanks,

Umashankar

• Former Member
Jan 22, 2013 at 11:04 AM

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