Former Member

# Distributed Condition Based on Total Value w/ Calculation Routine

Hello All,

I have an interesting pricing procedure requirement and I'm wondering if anybody else has had this issue.

I have a pricing condition that's currently maintained as a Manual Header Condition, that is a complex calculation based on a subtotal within my pricing procedure. The calculation cannot happen based on the Item Value of this subtotal, but instead based on the total of the order.

Once the value is calculated, it must be distributed to the Sales Order Items based on value.

That's all working as expected, manually.

I would like to now automate this calculation, however because Header Conditions do not support calculation routines, how can I write a Calculation Routine and assign to the item, and have it calculate based on the header value, and distribute correctly at each item on the order?

----

Item 10 Subtotal \$100

Item 20 Subtotal \$200

Based on \$300, Calculate the total value (i.e. Header) via Calc Routine - which includes scaling, subtraction, etc. within ABAP, determine the result, distribute it to Item 10 and Item 20 proportionately. Unfortunately the calculation cannot be accomplished via Scales and Pricing Tables in a standard fashion.

Any Thoughts?

Thanks!

10|10000 characters needed characters exceeded

### Related questions

• Posted on Jan 10, 2014 at 08:49 AM
Header Conditions do not support calculation routines

Your understanding is wrong. You can very well create a new routine in VOFM, add the required logic and assign it in pricing procedure under Calculation Type or Base Type.

G. Lakshmipathi

10|10000 characters needed characters exceeded
• Former Member

Does anybody have any sort of documentation on the basics of how to code a Calc Routine specifically for a header condition, based on header values?

As pricing fires at the item level, how do you prevent the routine from firing on every line of the sales order? And how do you force it to calculate only based on the header value of pricing procedure?

Unfortunately our calc cannot happen at the item level because it is based on the value of the whole order.

Just looking for some direction.

Thanks!

• Posted on Jan 11, 2014 at 06:52 AM

I am not clear on your requirement--If Total Value is 300\$--On this 300 what you want to give at the header level?(discount/Surcharge!!!!!)

Phanikumar

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 11, 2014 at 10:24 AM

I am hoping that you can sheer more details on the calculations. Nevertheless, you might want to refer to OSS 844141 - FAQ on Cumulated Conditions.

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 11, 2014 at 05:12 PM

HI,

U understand one thing, hedder condition can't support calculations routins

first u clear ur concept , very good logicall thinking