Macros for Stock Balance, Production, Days’ Supply, and Historical Totals 

You can use the following special operators to record a macro:

Operator

Description

L0

Stock balance

L1

Target stock/receipts

L2

Receipts

L3

Issues

L4

Target stock/issues

PR

Target supply/production

RW

Days’ supply

ZS

Historical total

 

The operations performed by these operators are defined internally as described below. All you need to do is specify which lines in the planning type are to represent which operands in the macro (see Defining a Macro in a Planning Type); for example, you might define the sales line as goods issues and the production line as goods receipts.

Stock Balance

The operator L0 Stock balance calculates stock levels. As the basis for this calculation, you specify goods receipts, goods issues, and (if required) an opening stock level.

For every period (i):

stock level (i) = receipts (i) + stock level (i - 1) - issues (i)

where stock level (i - 1) is the closing stock from the previous period

Receipts Based on Target Stock

The operator L1 Target stock/receipts calculates goods receipts and stock levels. You specify target stock levels, goods issues, and (if required) an opening stock level as the basis for this calculation.

For every period (i):

receipts (i) = target stock (i) + issues (i) - stock (i - 1)

if receipts (i) < 0, then receipts (i) = 0

stock (i) = receipts (i) + stock (i - 1) - issues (i)

Receipts

The operator L2 Receipts calculates goods receipts. You specify goods issues, stock levels, and (if required) an opening stock level as the basis for this calculation.

For every period (i):

receipts (i) = stock (i) + issues (i) - stock (i - 1)

Issues

The operator L3 Issues calculates goods issues. You specify goods receipts, stock levels, and (if required) an opening stock level as the basis for this calculation.

For every period (i):

issues (i) = receipts (i) + stock (i - 1) - stock (i)

Issues Based on Target Stock

The operator L4 Target stock/issues calculates goods issues and stock levels. You specify target stock levels, goods receipts, and (if required) an opening stock level as the basis for this calculation.

For every period (i):

issues (i) = receipts (i) + stock (i - 1) - target stock (i)

if issues (i) < 0, then issues (i) = 0

stock (i) = receipts (i) + stock (i - 1) - issues (i)

Production Based on Target Days’ Supply

The operator PR Target supply/production calculates goods receipts. As the basis for this calculation, you specify goods issues, target days’ supply, and (if required) an opening stock level. In the macro, you record which lines represent goods issues and goods receipts; typically, you define the sales line as goods issues and the production line as goods receipts. The system works out for each period the quantity that will need to be received (that is, produced) in order to cover both sales and target days’ supply in the current period, where one day’s supply is the quantity sold in the next period divided by the number of workdays in that period.

Key Figure

0 column

Month 1
(20 workdays)

Month 2
(19 workdays)

Month 3
(23 workdays)

Issues (sales)

   

190

230

Target days’ supply

 

15

15

 

Opening stock level

100

     

Receipts (production)

 

50

190

80

 

This is what happens when target days’ supply exceeds the number of workdays in the month.

Key Figure

0 column

Month 1

Month 2

Month 3

Workdays

 

20

20

20

Issues (sales)

 

1000

1200

1400

Target days’ supply

 

24

   

Opening stock level

100

     

Receipts (production)

 

(1000-100) +
1200/20*20 +
1400/20*4 = 2380

   

 

Days’ Supply

The operator RW Days’ supply calculates days’ supply. As the basis for this calculation, you specify stock levels and goods issues. Typically, you define the sales line as goods issues. The system works out the days’ supply in a period according to the closing stock level and goods issues (that is, sales) in that period.

Key Figure

Month 1
(20 workdays)

Month 2
(19 workdays)

Month 3
(23 workdays)

Month 4
(22 workdays)

Issues (sales)

200

190

230

220

Stock

0

100

200

...

Days’ supply

0

10

20

...

 

Days’ supply is calculated only up to the end of the planning horizon, even if stocks would last for longer.

Historical Total

The operator ZS Historical total calculates the sum of all the historical values of a chosen key figure, and displays the result in the first future period of either the same or a different key figure. You use this operator to calculate a backlog such as open orders.

In this context, historical periods are historical periods that have not been defined as ready for input in the planning type.