Forecast, Automatic Reorder
Point and Safety Stock
Calculation
February 15, 2015 by immoniks
SAP can calculate the reorder point and safety stock based on materials past
consumption. As mentioned inConsumption based planningCBP, there
are several prerequisites for this calculation.
First of all, the forecast must be executed (in MP30) and the reorder point
and safety stock will be proposed.
Recently, Ive been trying to crack how exactly these two values are
calculated. I have found many reading materials; unfortunately, none of
them could really answer my curiosity.
Apparently there are many values and statistic calculation involved. In this
post, I will try to share the knowledge I have built up so far.
To come up with the reorder point and safety stock, SAP bases this
calculation on the forecast of material consumption.
This forecast is, in turns, based on the historical consumption values (in
material master). To be able to execute forecast for a material, some settings
in the material master record (Forecast view) must be in placed which are
the following:
Period indicator: this specifies how the historical consumption values are
managed (daily, weekly or monthly).
A forecast model must be selected as well as the necessary model values
must be defined or initialised (basic value, trend value and seasonal indices
depending on the forecast model).
Historical consumption values must be recorded.
Now I will go further into the calculation, formulas and necessary settings.
In material master:
Period indicator: M for monthly. This means my period of historical
consumption is one month.
Forecast model: D for constant model. I have chosen this model for
demonstration because it is the simplest in terms of the formula used. Please
refer to SAP documentation for the formulas used in other types of forecast
model.
No. of historical period: 60 periods. This tells the system how many
periods of historical consumption values are relevant for the calculation of
the forecast. The system default is 60 periods. If, however, you dont have 60
historical values, the system will use just the periods you have.
Period f. init: 1 period. This instructs the system how many periods will be
used for the model initialisation. The model initialisation is the calculation of
basic values, trend values and seasonal indices. Depending on the forecast
model selected, the system initialises only the values that are needed for a
respective forecast model. Also, the number of periods needed for the model
initialisation varies depending on the forecast model. In my case, I have
selected D constant model, so at least 1 period of consumption value is a
prerequisite. And with the constant model, only basic value is the model
independent parameter. Please refer
tohttp://help.sap.com/saphelp_46c/helpdata/en/a5/6320e843a211d18941000
0e829fbbd/frameset.htm for model independent parameters and number of
periods needed for model initialisation.
Forecast period: 6 periods. This is the forecast horizontal. The system will
calculate the forecast for 6 periods in this case.
Initialisation indicator: X for automatic initialisation. This is used in
combination with Period f.init. This instructs the system to initialise the
model dependent parameter (only basic value in my case) for the first time
execution of the forecast. The system will then use the number of periods
specified in Period f.init to calculate the first basic value. If this indicator is
not set, you will have to maintain the basic value (and other model
dependent values) before the forecast execution.
Smoothing factor for basic value (Alpha factor): This factor is used
when smoothing the basic values from the previous period to the current
period. If you dont specify any value here, the system will use the default
value which is 0.2.
Lets see the formula for the constant forecast model (D).
Basic value (t) = Alpha*Actual consumption (t-1) + [1-Alpha]*Basic value (t1)
Where,
Basic value (t) is the basic value for the forecast period. It is actually your
forecasted consumption value.
Alpha is the smoothing factor of basic value.
Actual consumption (t-1) is your historical consumption from the previous
period
Basic value (t-1) is the basic value from the previous period.
The following is a demonstration:
Period
Actual Consumption
Basic values
Basic values
202.242
202.558
4.2011
220
197.802
198.197
3.2011
170
204.752
205.245
2.2011
210
203.44
204.056
1.2011
230
196.799
197.569
12.201
200
195.998
196.961
11.201
180
199.997
201.201
10.201
230
192.496
194
9.201
230
183.12
8.201
170
186.4
7.201
220
178
6.201
170
5.201
180
180
As stated above, I set model initialisation = X and my period for initialisation
= 1 period. The system normally calculates the basic value on the basis
of an average value. Since I specify 1 period for initialisation, the
consumption value of period 5.2010 is then my initialised basic value for
period 6.2010.
For period 7.2010, the formula for constant model is then used.
Basic value (7.2010) = Alpha*Actual consumption(6.2010) + [1-Alpha]*Basic
value (6.2010)
= 0.2*170 + [1-0.2]*180
= 178
Basic value (8.2010) = Alpha*Actual consumption(7.2010) + [1-Alpha]*Basic
value (7.2010)
= 0.2*220 + [1-0.2]*178
= 186.4
It continues the calculation up until period 5.2011 which is the period I want
to run the forecast for. And for the constant model, the forecasted value
remains constant in my forecast horizontal (which is 6 periods) until I
execute the next forecast.
So, now lets see if I change Period f.init from 1 to 5. This means I will use 5
periods of my historical consumption values to initialise my basic value. As
mentioned, the system calculates the basic value on the basis of an average
value. So, in my example, the consumption values from 5.2010 to 9.2010 will
be averaged to form an initialised basic value for period 10.2010.
Basic value (10.2010) = Average of consumption values from period 5.2010
to 9.2010
= (180 + 170 + 220 + 170 + 230)/5
= 194
The basic value of period 11.2010 to 5.2011 is then calculated using the
same method as the above.
Period
Actual Consumption
Basic values
Basic values
202.242
202.558
4.2011
220
197.802
198.197
3.2011
170
204.752
205.245
2.2011
210
203.44
204.056
1.2011
230
196.799
197.569
12.201
200
195.998
196.961
11.201
180
199.997
201.201
10.201
230
192.496
194
9.201
230
183.12
8.201
170
186.4
7.201
220
178
6.201
170
180
5.201
180
I would like to point out here one more time that I only demonstrate and
need the calculation of the basic values because I use the constant forecast
model (D). If it was a trend or seasonal model, other model independent
must be also calculated. Also, for model initialisation, it would be other
method for initialising the trend value and seasonal indices.
In my system, the forecasted basic value is rounded up to be a forecasted
value for the forecast horizontal. So, in this case, my forecasted consumption
is 203 regardless of how many periods I have used for model initialisation.
It is worth to mention that this activity of forecasting the past periods is
called ex-post forecasting. This happens when you have more consumption
values than what is needed for model initialisation.
Reorder point calculation
Now that we have our forecast value, lets look at how this is involved in our
reorder point and safety stock calculation.
The formula for reorder point is:
Reorder point = Lead time * Forecast (in days) + Safety stock
Where,
Lead time = total lead time of the material. Please refer to Consumption
based planningCBP
Forecast (in days) = the forecasted consumption value on a daily basis. In
my example, I use period indicator M for monthly which means that I have to
convert my monthly forecasted consumption into a daily consumption. I do
that by dividing my forecast value with 21.4 (working days).
Safety stock = safety stock calculated by the system. I will explain this a
little later. Now lets just assume that our safety stock is 0.
Lets say I have a lead time of 3 days (1 day each for purchasing processing
time, planed delivery time and goods receipt time).
Reorder point = 3 * 203/21.4 + 0.
= 28.46
= 29 (rounded up)
This basically tells us that we have an average consumption of 9.48 pieces
per day (203/21.4). It takes 3 days until the materials are available.
Therefore, a procurement order should be placed when you have 29 piece
left in your stock.
In an ideal case, if there is no turbulence to the delivery, your stock will be
refilled after 3 days, and all these 29 pieces will be used up. However, what if
there are delays in the delivery. That is why you have a safety stock to
ensure that you will be able to serve the demand in case something happens
with your procurement process.
In SAP,
Safety stock = R * Sqrt (W) * MAD
Where,
R = statistical factor determined by service level (specified in MRP 2 view).
For the service level below 50%, R is equal to 0. The following is the table for
factor R (from help.sap.com).
W = the ratio of lead time to forecast (in days) = lead time (in days)/forecast
(in days)
MAD = Mean average deviation.
We have now all the values to calculate the safety stock excepts for the
MAD. So, now let me show you how MAD can be achieved.
First of all, similar to calculating the basic values, MAD is calculated for
initialisation and for ex-post forecasting. Also, similar to the basic value, MAD
has also a smoothing factor which is called Delta and can be set in the
material master record (Forecast view). Otherwise, the default Delta of
0.3 is used in the calculation.
I will now demonstrate the calculation of MAD when we have 1 period for
model initialisation and 5 periods for model initialisation.
Lets first look at the formulas involved.
There are 2 formulas used in order to calculate the MAD values: one used to
initiate the first MAD and the other one is for determining the MAD for the
next period.
Lets start with MAD for initialisation.
MAD = Average |Actual consumption (i) G(init)|
Where,
G(init) = Average of the actual consumptions for the periods for initialisation.
i = 1 to the period for initialisation.
MAD for forecasting is then,
MAD (t) = Delta * |Actual consumption Basic values| + [1-Delta] * MAD (t1)
This looks very complicated. But I will demonstrate the calculation in table
format below. It is actually simple if you use excel.
Again, I will show the calculation when using 1 period for model initialisation
and 5 periods for model initialisation.
Period f.init = 1 period
G(init) = Average of the actual consumptions for the periods for initialisation
= 180
MAD(init) = Average |Actual consumption (i) G(init)|
= 180 180
=0
Therefore, MAD for period 6.2010 = 0.
The formula for MAD for ex-post forecasting applies from period 7.2010
onwards.
MAD(7.2010) = Delta * |Actual consumption (6.2010) Basic values (6.2010)
| + [1-Delta] * MAD (6.2010)
= 0.3 * |170 180| + (1-0.3) * 0
= 0.3 * 10
=3
MAD(8.2010) = Delta * |Actual consumption (7.2010) Basic values (7.2010)
| + [1-Delta] * MAD (7.2010)
= 0.3 * |220 178| + (1-0.3) * 3
= 0.3 * 42 + 0.7 * 3
= 14.7
Perio
d
Actual
Consumpt
ion
Basic
value
s
Absolute Error
202.2
42
4.20
11
220
197.8
02
G(ini
t)
Absolute(Act
ual
Consumptio
n G(init))
22.9
94
22.198
23.3
35
3.20
11
170
204.7
52
34.752
18.4
42
2.20
11
210
203.4
4
6.56
23.5
34
1.20
11
230
196.7
99
33.201
19.3
9
12.2
01
200
195.9
98
4.0020000000
0001
25.9
84
11.2
01
180
199.9
97
19.997
28.5
49
10.2
01
230
192.4
96
37.504
24.7
11
9.20
1
230
183.1
2
46.88
15.2
1
8.20
1
170
186.4
16.4
14.7
7.20
1
220
178
42
6.20
1
170
180
10
5.20
1
180
Period f.init = 5 periods
180
This is how it looks when you use 5 consumption values for model
initialisation.
G(init) = Average of the actual consumptions for the periods for initialisation
= (180 + 170 + 220 + 170 + 230)/5
= 194
MAD(init) = Average |Actual consumption (i) G(init)|
= (|180-194| + |170-194| + |220-194| + |170-194| + |230-194|)/5
= (14+24+26+24+36)/5
= 24.8
Therefore, MAD for period 6.2010 = 24.8.
The formula for MAD for ex-post forecasting applies from period 11.2010
onwards.
MAD(11.2010) = Delta * |Actual consumption (10.2010) Basic values
(10.2010) | + [1-Delta] * MAD (10.2010)
= 0.3 * |230 194| + (1-0.3) * 24.8
= 28.16
MAD(12.2010) = Delta * |Actual consumption (11.2010) Basic values
(11.2010) | + [1-Delta] * MAD (11.2010)
= 0.3 * 21.201 + (1-0.3) * 28.16
= 26.073
Perio
d
Actual
Consumpti
on
Basic
values
Absolute (Actual
consumption
Basic value)
202.5
58
4.20
11
220
198.1
97
Absolute(Actua
l Consumption
G(init))
22.7
55
21.803
23.1
63
3.20
11
170
205.2
45
35.245
17.9
84
2.20
11
210
204.0
56
5.943999999999
99
23.1
44
1.20
11
230
197.5
69
32.431
19.1
63
12.2
01
200
196.9
61
3.038999999999
99
26.0
73
11.2
01
180
201.2
01
21.201
28.1
6
10.2
01
230
194
36
24.8
9.20
1
230
36
8.20
1
170
24
7.20
1
220
26
6.20
1
170
24
5.20
1
180
14
Now we can finish our safety stock calculation.
Assume,
Service level = 95%. Factor R is then equal to 2.06 according to the Factor R
table above. And MAD = 22.755.
From,
Safety stock = R * Sqrt (W) * MAD
= 2.06 * Sqrt (3/(203/21.4)) * 22.755
= 14.824
Now I must admit I am having trouble getting the right value for W. According
to SAP, it is the ratio of delivery time to the forecast value in days (W =
delivery time/forecast). But, I am not sure if it is work days or calendar days
here. :p
However, SAP would get the value of 17.539 for the safety stock with this set
of data and setting. I would say missing by 3-4 pieces is not that
critical?
Recall from the reorder point calculated above:
Reorder point = Lead time * Forecast (in days) + Safety stock
Reorder point = 3 * 203/21.4 + 14.824.
= 43.284
As reference, SAP proposes 45.897.