SAP APO provides two methods for dealing with safety stock--the stock that you keep on hand in the event that you do not have enough material to deliver on orders. They are the Basic and Extended Safety Stock Methods. Each is designed for a specific supply planning methodology. Misalignment between the APO's safety stock methods and a company's supply planning methodology can result in poor management of your safety stock. This article shows how each APO method calculates safety stock and in which situations you use each.
Companies usually keep safety stock as insurance against situations where they do not have enough material to deliver on time due to unexpected peaks in demand or late delivery from a supplier. Every manufacturing company must dip into its safety stock sooner or later, but many companies do not keep enough safety stock to cover this type of event, or keep more safety stock than is required. Also, the chosen safety stock method might be misaligned with the supply planning methodologies available in APO.
I will show you how to make the right decision regarding which method to use, and how to customize it to your business requirements. First, I'll present an overview of APO safety stock methods, showing how they might be used with a planning horizon of up to six months planned with Supply Network Planning (SNP). Then, I'll describe the criteria APO uses to define safety stock and show you all the possible ways that APO can calculate safety stock. Finally, I will tell you how the macro at the heart of the APO safety stock calculations works.
Typical Scenarios
APO offers two types of safety stock methods: basic and extended. With the basic method, you specify the safety stock quantities based on your experience. The extended method takes into account forecasted and actual demand, and it accounts for differences between what you ordered and what was delivered.
Each of these methods is usually associated with one of the two supply planning methodologies in APO. However, SAP does not enforce these combinations.
- Unconstrained planning: Supply and demand is matched without considering constraints such as production capacity or raw material availability. This is a typical MRP 2 environment. Since the planner ultimately makes the decision when an item is manufactured, she should also plan the build-up and usage of safety stocks. In the absence of planning rules, this is the only possibility. The basic safety stock methods are typically used in this scenario.
- Constrained planning: If you take constraints into account during supply-and-demand matching, you should include the build-up and usage of safety stocks directly into the planning run. Safety stock control then leaves the boundaries of a location and becomes the responsibility of the network planner, who uses the extended safety stock methods.
Within each safety stock planning method, you have different options for defining safety stock. You select these options based on your supply planning methodology and related business requirements. How well you select these options determines the effectiveness of your safety stock planning. Let's review these options. This article focuses on the basic method. In a later issue, I will describe the options for the extended method.
Defining Safety Stock
The safety stock is part of the target stock level, which can be defined optionally in the location product master. Consequently, if no target stock level method is applied, the displayed target stock level equals that of the safety stock.
You can define safety stock in APO irrespective of the reordering process you use; it works with deterministic, stochastic, and optimization processes. Only the optimization-based reorder process allows you to actively plan the usage of safety stocks.
In APO, you have three criteria to consider when defining safety stock: the method used to calculate levels, the settings, and how you establish its values. You have two methods to calculate safety stock:
- Time-independent: The safety stock definition is constant over time. You can change the safety stock setting when required, but the basic value is the same for all upcoming planning periods. The safety stock value in this case is stored in the product master.
- Time-dependent: The safety stock definition or calculation changes over time. The safety stock value is stored in a time series (key figure) and not in the product master.
Safety stock settings can be carried out in two ways, expressed in a quantity or as a demand-related figure:
- Quantity-based safety stock is expressed in the product's base unit of measure and stipulates a certain amount that should be kept as a safety stock irrespective of any other factor.
- Demand-based safety stock definitions relate the safety stock to the product's future demand and is expressed in time (days). If the expected demand goes up, so does the planned safety stock. Demand-dependent safety stock methods work with either workdays or calendar days, depending on the macro definition for workdays. The SAP standard system uses the workdays as defined in the location master's Shipping Calendar.
You can establish safety stock values programmatically or as a manual input:
- Programmatic safety stock calculations use an algorithm to calculate safety stock levels based on other factors, such as forecast error or service levels. This requires that the influencing factors are stored in the system. Time-dependent methods rely heavily on this principle, as the user cannot easily define hundreds of safety stock values for a product.
- With manually defined safety stock, the user inputs data based on knowledge and experience, or on strategic decisions as to what the safety stock should be. This method is required when new products are introduced and no reliable information can be obtained. It is suitable for time-independent definitions.
The safety stock method (and possibly value) can be defined per product and location in the Lot Size tab of the Product Master screen. The safety stock method setting defines where the safety stock value is stored and read by the planning algorithms (product master or key figure) and how it is defined (related to the location product demand or not). Defining a safety stock is optional, and leaving the safety stock indicator blank indicates that no safety stock planning is required for the product. The safety stock value is calculated and displayed in the SNP Interactive Planning transaction only if the safety stock method is defined on the Product Master screen and the appropriate key figures and macros are in the SNP planning book.
Table 1 provides an overview of available safety stock calculation methods in regard to safety stock settings and values. The two-letter abbreviations refer to the identifiers used in the Product Master screen when selecting a method.
Safety Stock Calculation Method |
Based on
|
Planned Safety Stock Values Stored in |
Quantity
|
Demand
|
Both
|
Basic Safety Stock Methods |
Time-independent |
SB
|
SZ
|
Product Master |
SM
|
Time-dependent |
MB
|
MZ
|
Key Figure |
|
MM
|
|
Extended Safety Stock Methods |
Alpha service level |
|
AS, AT
|
Key Figure |
Beta service level |
|
BS, BT
|
Key Figure |
No Safety Stock |
None |
|
Not Applicable |
|
Table 1 |
Safety stock calculation methods in APO |
Let's take a more detailed look at all the possible safety stock calculations for the basic safety stock methods:
Basic Safety Stock Calculations
Time-independent options depend on the user typing in a value based on an external decision. None of them use the forecast error. Safety stock values defined in the Safety Stock (planned) key figure are ignored. The settings are:
- SB (quantity-based): The user defines the required safety stock in the product's base unit of measure. No other parameters are required or considered, and the same safety stock level is applied to each period.
- SZ (demand-based): The user defines the number of calendar days that the safety stock must be able to cover in case no other receipts occur. The safety stock is expressed in the product's base unit of measure, and it changes from day to day depending on the demand situation. Note that this demand-based safety stock is always defined and displayed in calendar days (not workdays). If the demand is rising, the safety stock expressed in units rises, and vice-versa. As the system uses calendar days and not workdays, this leads automatically to changing safety stock levels as the result of demand-free weekends. No other parameters are required or considered.
- SM (both quantity- and demand-based): The system reads the safety stock setting from the product master, as is the case with method SB, and compares it with the result of the demand-based calculation of method SZ. It then applies the greater of the two values as the final safety stock level.
Time-dependent option settings are:
- MB (quantity-based): The user defines the required safety stock per period in the SNP Interactive Planning transaction. The key figure Safety Stock (planned) is used to capture the information. Distribution functions can be used to facilitate this task. No further parameters are required or considered.
- MZ (demand-based): This requires that the safety days' supply be defined per period in the SNP Interactive Planning transaction. The key figure to do so is not defined in the SAP-delivered system's planning book, and therefore it needs to be defined beforehand. Distribution functions can be used to facilitate the task of data capturing. No further parameters are required or considered.
- MM (both quantity- and demand-based): This method is again a combination of two other safety stock methods, namely method MB and MZ. As is the case for those methods, MM requires you to define the desired values per period. This can become laborious, as for each period a safety stock level as well as the safety days' supply needs to be captured using the SNP Interactive Planning transaction. The safety stock value is compared every period with the result of the demand-based calculation. The greater of the two values is finally used as the safety stock level. If only one of the two values is defined, it is automatically used as the greater value.
Extended Safety Stock Calculations
Extended methods depend on service level — a location- and product-dependent value. The two available levels are referred to as “alpha” and “beta.” The product master stores these values as well as forecasts and realized sales as well-planned and realized supply lead times and quantities. A special program carries out the safety stock calculation. The results can be used directly or in edited form before reorder planning occurs.
- Alpha service level settings AS and AT (demand-based): A time-dependent safety stock value is established in a special planning step performed by a separate program. This program populates the key figure Safety Stock (planned) with the required safety stock information. Manual updates to the safety stock planning results can be carried out and saved before the SNP planning run. The SNP planning run is either optimization-based for constrained planning or heuristics-based for unconstrained planning. Distribution functions could also be used to facilitate this task.
- Beta service level settings BS and BT (demand-based): The procedure is the same as described above. Again, a follow-up article will cover these extended options in more detail.
The Safety Stock Macro
To understand APO's safety stock functionality, you must first understand a small but important macro called SafetyStck/reorderPoint/targetStckLevel in the standard delivered planning book 9ASN94. It is the hub of the safety stock calculation. As a “default” macro, it is carried out whenever location product data is loaded or changed in the planning book. This macro calculates, among other values, the key figure Safety Stock, using a macro function called SAFETY_CALC.
This macro reads the location product master and reacts to the safety stock method settings as follows:
- If SB, then copy the product master safety stock level into the key figure Safety Stock.
- If SZ, then use the product master safety days' supply and the demand to populate the key figure Safety Stock.
- If SM, then compare the results of methods SB and SZ and copy the greater of the two results into the key figure Safety Stock.
- If MB, then copy contents of the key figure Safety Stock (Planned) into the key figure Safety Stock.
- If MZ, then do nothing, which leaves the key figure Safety Stock zero.
- If MM, then compare the results of methods MB and MZ and copy the greater of the two results into the key figure Safety Stock.
Note that no action is taking place when the safety stock method is MZ. Consequently, methods MB and MM behave identically, since the MZ-based safety stock value is always zero. If you wish to use the safety stock method MZ, then you need to make the modifications described in the sidebar, “Using Safety Stock Method MZ.”
Sometimes macro operands are set to 0. This means that this operand is not defined, and a function of the macro might require this operand to be disabled. An example is the above-mentioned key figure for the safety days' supply.
For demand-based safety stock methods, the macro function determines the safety stock in accordance with the demand. The standard-delivered macro points to the key figure Total Demand for this purpose. To use, for example, only sales-order demand, the SafetyStck/
reorderPoint/targetStckLevel macro needs to be changed in a manner similar to that described in the “Using Safety Stock Method MZ” sidebar. Replace the second-to-last operand, which points to the row Total Demand, to Sales Order.
Another interesting aspect is the possibility to define workdays. Workdays are defined in another macro called Determine workdays. The standard-delivered macro points to the location master shipping calendar (abbreviated SD). Other possibilities are to use the production calendar (abbreviated PP) or the storage calendar (abbreviated ST). If no calendar is specified in the macro, or if the specified calendar does not exist in the location master, then the calendar attached to the time stream used in the planning area's storage bucket profile is used. If you have not attached a calendar to the planning area's storage bucket profile, then every day is treated as a workday.
When using the extended safety stock methods, the macro behaves the same way as if the safety stock method is set to MB. The only difference is that the figures in the key figure Safety Stock (planned) are not entered manually, but by the extended safety stock program.
The various planning algorithms (Heuristics, Optimizer) use the values in the key figure Safety Stock. You can change the key figure names, and even which key figures are used, to suit specific requirements as long as the macro is adapted accordingly.
The safety stock quantity that can be seen in the key figure Safety Stock (SAFTY) is part of the overall definition of the target stock level and therefore incorporated into the key figure Target Stock Level (LAGRZ). The flowchart shown in Figure 2 provides an overview of how the different safety stock methods derive the final required safety stock per period. Note that safety stock values are stored in planning-area-dependent key figures. When working with auxiliary planning areas, each planning area can have potentially different safety stock values.

Figure 2
Safety stock determination
Using Safety Stock Method MZ
Before you can use the MZ setting when calculating safety stocks, you
must make the following changes. Make them in a copy of SAP's
standard-delivered planning book, as you likely have no authority to
change the delivered planning book, and it makes good sense to use your
own planning books that meet the precise business requirements.
1. Define the Safety Days' Supply key figure in your planning book. Follow the menu path Supply Network Planning>Environment>Current Settings>Design Planning Books. Choose your planning book and click on Edit. Select the Key fig. attributes tab and type in the name of the new key figure, SVTETY (Figure 1). Use the name Safety Days' Supply (planned).
Click on Save settings, which creates the new key figure in the planning book. Ensure that the Storage in database flag is on and that the Unit of measure indicator is set to Days. Click on Continue twice, and then on Complete. Confirm to save.
Go back to the Design Planning Books screen and again select your planning book and click on Edit. Select the second Key figures tab and drag the SVTETY key figure from the right to the left tree structure (Figure 2).
Once the key figure is part of the left tree structure, it can be
repositioned to appear at the desired position using the drag-and-drop
function.
2. Set the Safety Days' Supply key figure to Input/output. Use the menu path Supply Network Planning>Planning>Interactive Supply Network Planning to open the SNP Interactive Planning transaction, and select the planning book and view that contains the Safety Days' Supply key figure to be changed. Switch to Design mode. Open the context-sensitive menu on the Safety Days' Supply key figure SVTETY and choose Selected rows>Input/output (Figure 3). Switch back to Live mode while saving the changed planning book.
3. Adapt the safety stock macro. Follow the menu path Supply Network Planning >Environment> Current Settings>Macro Builder. Choose your planning book, Data View 1, and click on Edit. Move the SafetyStck/reorderPoint/ targetStckLevel macro to the work area. Change the fifth line of this macro (which is an operator/function step) from the existing value ) ; 0 to the new value ) ; (Figure 4). Make sure to leave a space between the close-bracket and semicolon characters.
Select the row under the previously edited row (which is
a planning row table row), activate the context-sensitive menu, and
select Insert Argument Row. Choose the newly created key figure Safety Days' Supply (planned) (Figure 5). Do not change any other parameter, and press the Enter key. Select the macro header line and click on Generate. The macro status should change to green. If this is not the case, double-check the macro. Save and exit the macro builder.
Now you can use the safety stock methods MZ and MM, and
they work as expected! During the macro function execution, a new
possible condition exists:
- If MZ, then use the key figure Safety Days' Supply (planned) and the demand to populate the key figure Safety stock.

Figure 1
Type in the name of the new key figure

Figure 2
Drag the SVTETY key figure to the tree structure

Figure 3
Set the Safety Days' Supply key figure to Input/output

Figure 4
Edit the safety stock macro with a new value

Figure 5
Insert the new key figure Safety Days' Supply
Note
This article is based on APO Releases 3.0 and 3.1. Naming conventions
differ slightly between these versions. The "enhanced" safety stock
methods of release 3.0 are now called "extended" safety stock methods.
No important functional differences exist between the two releases.In APO 4.0, SAP has changed the name to the "standard" method.The generic term "demand" used in the basic safety-stock-level
calculations refers to the same demand that can be seen in the key
figure Total Demand in the SNP Interactive Planning transaction. Should
you wish to use other definitions for "demand," you must change the
safety stock macro (see "Using Safety Stock Method MZ" above).

Wolfgang Eddigehausen
Wolfgang Eddigehausen is a highly experienced expert in the areas of business process design, re-engineering, and user adaption, as well as process realization in complex SAP-centric environments. He has experience in solution and enterprise architecture and project management (PRINCE2 certified) domains defining enterprise capabilities with a focus on delivering effective and efficient solutions to organizations. Wolfgang's industry knowledge includes public sector, utilities, mining, distribution, general manufacturing, process and steel industries, and consumer goods.
In most roles his task is not only to architect a solution but also to evaluate and define strategic options with a focus on end-to-end solutions rather than systems. This also includes strong emphasis on the user acceptance through an innovative user experience and mobility enablement.
His career includes successful participation and management of projects in Australia, Europe, India, Japan, Singapore, South Africa, Taiwan, and the US. These projects required interaction with all levels of an organization, from the shop floor or office through to the CxO level. Throughout his career, Wolfgang has put emphasis on a holistic approach bringing together people, processes, information, and systems in project management, architecture, and implementation roles.
You may contact the author at we@avox.com.au.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.