Ask Me Anything: SAP Condition Update, Max # of Orders

Question?

This question comes courtesy of Krishna. He writes (edited for clarity):

My requirement is to give a discount for the first 50 sales orders. I tried this using the condition update tool. It is limited to only 3 sales orders. I want to make it for 50 sales orders, but I am not getting anywhere. Please help me.

I’m not sure there’s much good news ahead on this one, but let’s take a closer look at the ‘Maximum number of orders’ in the SAP Condition Update function.

What is ‘Condition Update’ in SAP?

I’ve written about the ‘Condition Update’ function in the past.  When activated on a particular condition type, this function leverages a standard SAP LIS structure (S071) to track the use of this condition type.  Additional parameters become available on the Condition Record (VK11/VK12) to allow for restrictions to be set:

  • Limit the dollar amount of the condition.  This is handy if, for example, you want to offer new customers a 10% discount on their orders up to a total value of $1,000.00.  After that amount, the discount automatically stops applying.
  • Limit the  total, collective quantity that can take advantage of the condition.  Similar to the above scenario, you can extend a special price or discount to a customer for a limited quantity.  For eample, each customer gets 10% off the first 100 items.  This can be on a single order or cumulatively across multiple.
  • Limit the number of orders that can take advantage of the condition.  This is ideal for extending an offer or price for a certain number of orders.  As above, this is a cumulative value.  But…

The Issue with SAP Condition Update

The limit that Krishna is referring to is that last one — limiting to a certain number of Sales Orders.  There is a built-in restriction on the ‘Maximum number of orders’ value:  3 orders.  Not 10.  Not 5.  Three.  Here is the explanation in the field help (F1) on that field:

SAP "Help" on the Max No. or Orders Field
SAP “Help” on the Max No. or Orders Field

But surely there is a way to extend this to be some value greater than ‘3’, right?  Well, SAP Note 615370 (“Condition update: Functions and restrictions”) says otherwise:

Specifying a maximum number of orders

1, 2 or 3:

If a maximum of three orders is specified, for example, the condition record is used only in the first three orders. As of the fourth order, the condition record is no longer taken into account. A maximum number larger than three orders cannot be specified.

…and to put a final nail in the coffin of hope, the solution reads:

Solution

There is no solution. The design is restricted.

Perfect.  “There is no solution”.  This seems crazy, right?  You can set a maximum value of $999,999,999 which could be across hundreds of orders (theoretically), but you’re limited to a measly 3 orders for the Max Orders function.

Other Details

The whole condition update function is supported by an LIS structure, S071.  Every condition with the “Condition Update” flag set on the Condition Type will create a record in S071 when it is used on a Sales Order.  You can view this table in your SAP system using transaction SE16n.

Workarounds

Unfortunately, I’m unaware of any ways to bypass this restriction on the…restriction.  Standard SAP will support only between 1 and 3 for the maximum number of orders value.  HOWEVER, the fact that the S071 table is updated for ALL ‘Condition Update’ conditions is very interesting.  One potential solution would be to write a custom pricing requirement that checks the number of sales orders used for that condition.  The solution would look like this:

  • Maintain the ‘Condition Update’ flag in Pricing Condition Type customizing.
  • Create your condition records in VK11 WITHOUT specifying a Max number of Orders (or any other restrictions).
  • Create a VOFM Pricing Requirement that does the following:
    • Finds the current Condition Record Number.
    • Queries S071 for that Condition Number.
    • Count the number of past orders retrieved.  You may need to exclude your current document number if it’s listed.
    • Compare the total number of past orders to your limit number.  This could be hard coded in the requirement (not recommended), or maintained in a TVARVC variable or Z-table.
    • If below the threshold, the requirement passes; otherwise do not apply the condition.

In case it isn’t clear, I haven’t actually tried this method, but assuming that S071 table is updated upon Sales Document Save (which it should) you should be able to use it in your logic.

Another possibility…

Though not technically a workaround, as mentioned above SAP does allow for a limitation on the quantity of an item to which the condition can be applied.  Frustratingly, this is a cumulative restriction which could potentially involve a multitude of orders.  This value is only useable when working with a quantity-, weight- or volume-based condition type.  A percentage, for example, will not show this field.  SAP explains its usage in that same Note:

Specifying a maximum condition basis

For example, 200 PC:

The condition basis is fully taken into account only if the specified upper limit of 200 PC is not exceeded. The specified upper limit is a cross-document limit and therefore does not apply to each order item or order individually.

This means that: The system cumulates the condition bases of all order items. As soon as an order item exceeds the upper limit, the system takes into account only the remaining difference between the upper limit and the condition bases that have been cumulated to date, instead of the actual condition basis. For all other orders or order items, the condition basis is calculated as zero.

You can see that condition updates are used from the fact that the field for the maximum base value (KOMV-KMXAW) is also displayed on the condition detail screen for the relevant condition in the order. Depending on the situation, this field has one of the following attributes:

“X Maximum value set: limit has been exceeded” or

“Y Maximum value set: limit has not yet been exceeded”

Here is what the condition maintenance screen (VL11, VK12) looks like for this type of restriction:

Transaction VK11, VK12 - Quantity Restriction
Transaction VK11, VK12 – Quantity Restriction

Again, this is not a workaround, but it is another type of restriction that will work across many orders.

Conclusion

SAP Condition Update…  Yet again, SAP provides a less-than-flexible solution, but provides the mechanics for creating one of your own design.  If anyone decides to try the custom pricing requirement out, please let me know how it works in the comments below.

And thanks to Krishna for posing the question!

12 thoughts on “Ask Me Anything: SAP Condition Update, Max # of Orders

  1. Hi Michael, is there a way to redetermine “condition update” at the time of billing incase your quantities change between order and billing? Looks like it only works with order quantities and doesnt redetermine with billing quantities

    1. Serhat: Thanks for posting. When you test, are you under- or over-delivering when compared to your Sales Order? What is your process for this scenario? If you under-deliver, are you going back to your Sales Order and adjusting the quantity? -Michael

  2. Hi Michael greetings. in sales order if we have set up batch determination and when we click on item determination then based on batch selection criteria if any batch fulfills the criteria then its selected.But what if no batch meets the criteria ?should the schedule line confirm the line item?What i think is the schedule line gets confirmed provided there is stock at plant level.Even though no batch is meet the criteria (>365 days expiry date for example) the stock exist in plant level so schedule line should be confirmed right?

    1. Vikram, thanks for the question. It’s funny you ask me this question now; I was just having a similar discussion with colleagues this week about Batch Determination on the Sales Order and the result of no batch qualifies. Short answer is: I don’t know. Batch selection on the Sales Order is typically custom (I am unaware of any standard SAP Sales Order batch determination). It’s possible that this is a custom solution and you should probably reach out to your organization to get the best answer. The question becomes what WOULD you like the sales order to do? It may make sense to prevent confirmation, but you would need to use or develop a report with which to monitor Unconfirmed orders. What are your thoughts? -Michael

  3. Hi Michael
    I have an issue regarding maximun condition basis. Is there any way to make this field appears in porcentage conditions? I need both value and quantity max options for my discounts.

    1. Hello Yamila. Thanks for posting. I have not looked into this topic much since writing this article. As far as I am aware, no changes have been made around this function: “This value is only useable when working with a quantity-, weight- or volume-based condition type.”

  4. Hi Michael, Warm Greetings !! Thanks for the excellent post.

    Is there a way to get the cumulated condition value populated in sales order ? I am aware that the cumulated value is visible in the S071 structure. Is it possible to populate that value in the sales order using a standard solution and without using any VOFM routine.

    My requirement is to perform additional calculations / surcharges depending on the cumulated condition value so far.

    Thank You.

    1. Thank you for finding my site, Chandra. I am unaware of any standard function which would allow a user to view the current condition value on the Sales Order. I could imagine a custom pricing condition (statistical) which could display this value using some sort of custom routine. Otherwise, a user exit could display this value on the item level Additional Data B tab. Good luck!

    1. Kumar, apologies for the delay. I have had to do something similar about a year ago and needed to find some time to dig back through my notes. I ran into a similar issue with a different S-table. It was relating to Product Allocation: we did not want to update the allocation table when items were rejected (by default, SAP allows a rejected line item to count towards the customer’s allocation). Anyway, please refer to these notes which may provide some additional information:

      19295 – SIS: Updating even rejected items
      1597096 – FAQ: Statistics update in Sales Information System (Question 1, in particular)

      I hope this helps. -Michael

  5. My client wants to ration certain product lines for a period. i.e. Every customer is allowed to buy only 5 pieces during the month of August. Is it possible to utilize these functionalities above to achieve this ? We want to avoid having to create thousands of condition records. Ideally one condition record for a material that applies to all customers that limits them to 5 pieces for a validity period ?

    1. Thanks for the question, Ian. These functions are only used for pricing. It sounds like you need to look into Product Allocation which is intended to address issues related to product scarcity.

Leave a Reply

Your email address will not be published. Required fields are marked *