on 2025 Sep 12 5:19 AM
Recently, while working with BAPI_SALESORDER_CREATEFROMDAT2, I faced a strange issue.
I was trying to create a sales order with a custom condition type ZGTC.
Here’s what I did:
In the BAPI input, I passed KBETR = 94.0000000000.
During debugging, I could clearly see that the value was stored as 94.0000000000.
But after executing the BAPI and checking the order in VA02, the value appeared as 940.00!
Why does the BAPI change my condition value from 94.00000000000 to 940.00?
Request clarification before answering.
In pricing, KBETR is not stored as the “human‑readable” amount; it is stored in internal units based on the condition’s pricing unit (KPEIN) and condition unit (KMEIN). For example, if your condition type ZGTC is defined in customizing with Calculation type = per 100 units (or per %), Pricing unit = 10 or 100, then the internal value in KBETR is scaled accordingly. The display in VA02 multiplies the stored value by the pricing unit to show the “per unit” rate. So if you pass 94 with a pricing unit of 10, the display will show 940.00. This is a classic unit/scale mismatch when calling the BAPI. The BAPI doesn’t “fix” it, it just stores what you give it, and the UI applies the scale.
The SAP note referred here explains the Condition value is multiplied by factor 10”) addresses a known scaling issue in older releases where the BAPI multiplied the passed condition value incorrectly because of missing or wrong pricing unit handling. If your system release is one of those covered by the note, and the symptom matches the note’s description (value multiplied by 10 unexpectedly), then applying it can help.
However, in most modern releases, the behaviour you’re seeing is by design. You need to pass KBETR in the internal format: KBETR = <desired display value> / <pricing unit> and set KPEIN (pricing unit) and KMEIN (condition unit) correctly in the BAPI tables ORDER_CONDITIONS_IN and ORDER_CONDITIONS_INX.
So with the above findings, what you can do is check condition type ZGTC in V/06:
Pass matching KPEIN/KMEIN in the BAPI along with KBETR. If you want 94.00 to display in VA02, and the pricing unit is 10, you must pass KBETR = 9.4 with KPEIN = 10. Only if you confirm you’re on a release where Note 886532 applies and the scaling is wrong despite correct KPEIN/KMEIN, should you apply the note.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
try check SAP Note:
886532 - Pricing: Display and rounding of numbers
It might provide some explanation to this behavior.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.