ERPClimb logoERPClimb
Pricing
SD / O2Cadvanced 6 min read

SD Pricing Part 7: Pricing Routines — Requirements, Alternative Calculation Types and Base Values

Preview · a free account unlocks the full lesson

Key takeaway

Extend pricing logic without modifications: requirement routines that decide whether a condition is determined, alternative calculation type routines that compute the value, alternative condition base value routines, standard examples (2, 10, 11, 16), and how to create and govern custom 9xx routines in VOFM.

In this lessonShow sections

Visual overview

SD Pricing Part 7: Pricing Routines — Requirements, Alternative Calculation Types and Base Values — learning sheetFlow: Check whether configuration can express the rule → If not, copy the closest standard routine to 9xx → Implement minimal logic, activate, assign in V/08 → Test with positive/negative cases and measure performance. Key ideas: REQUIREMENT ROUTINES; ALTERNATIVE CALCULATION TYPE; ALTERNATIVE CONDITION BASE VALUE; CREATING CUSTOM ROUTINES. Watch out: Pricing routines run for every item and every repricing — slow SELECTs here slow down every order.ERPClimb.com / SD / LESSON 5/10 / LEARNING SHEETSD Pricing Part 7: Pricing Routines — Requirements,Alternative Calculation Types and Base Values1 · HOW IT FLOWS1Check whetherconfigurationcan express the…2If not, copy theclosest standardroutine to 9xx3Implementminimal logic,activate, assign…4Test withpositive/negativecases and…2 · KEY IDEAS EXPLAINEDRequirement RoutinesAssigned per procedure line (Reqt).Examples: 2 = item relevant for pricing, 4 = cost,10 = plant is set (tax), 23 = only in billing.Alternative Calculation TypeReplaces the standard calculation.Examples: 11 profit margin (net − cost), 16 taxcalculation.Alternative Condition Base ValueChanges the base: e.g. net value instead of gross,or a weight- or volume-based base.Custom: base = net value excluding certainconditions.Creating Custom RoutinesVOFM > Requirements > Pricing (or Formulas> Condition value / Condition base value).Copy closest standard, number 9xx, activate,assign, transport.3 · REMEMBER · WATCH OUTRememberRequirement routine (Reqt column): condition is determined only if theroutine returns sy-subrc = 0 (e.g. requirement 2 = item relevant for…Alternative calculation type (AltCTy): computes the condition valuewith custom logic instead of rate × base (e.g. 11 profit margin).Alternative condition base value (AltCBV): changes the base the rateapplies to (e.g. net value, weight).!Watch outPricing routines run for every itemand every repricing — slow SELECTshere slow down every order.4 · IN A REAL PROJECTA client added a custom alternative calculation type that read the customer's contract table with anon-buffered SELECT for every condition line. Orders with 400 items took minutes to price, and billing runsoverran their batch window. The routine was rewritten to read the contract once per document into a buffer…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Beyond what standard configuration can express, pricing routines let you inject custom logic at specific points in the calculation, and there are three main mechanisms for doing this.

A requirement routine, assigned in the Reqt column of a pricing procedure line, decides whether a given condition is even determined at all — the condition is only evaluated if the routine returns sy-subrc equal to 0, and standard examples include requirement 2, which checks that the item is relevant for pricing at all, while a custom routine might restrict a condition to export customers only, or to certain item categories.

An alternative calculation type replaces the standard rate-times-base calculation entirely with custom logic — the standard example is routine 11, which calculates profit margin as net value minus cost rather than through a rate, and routine 16, which handles tax calculation; a custom version of this might calculate freight as a percentage of value but subject to a minimum charge, or compute a price via some other formula entirely.

An alternative condition base value, by contrast, leaves the calculation method alone but changes what base the rate actually applies to — for example, using net value instead of gross value, or switching to a weight- or volume-based base, with a custom example being a base defined as net value excluding certain other conditions.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Referenced SAP objects

Reviewed reference pages for the objects this page mentions.

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.