You are on page 1of 15

92

3. On the Scale tab, deselect the checkboxes to the right oI the labels Maximum and
Minimum.
4. Enter the required range oI values in the Iields to the right oI these labels.
5. Click OK.
Advanced Macros
Use
Advanced macros are used to perIorm complex calculations quickly and easily.
Macros are executed either directly by the user or automatically at a predeIined point in
time.
The deIinition oI macros is optional.
The macros Ior aggregation and disaggregation come predeIined with the system. You do
not have to write them yourselI. Some stock level and days' supply macros are also
delivered with the standard SNP planning books. One can create its own planning book
Ior SNP using one oI the existing books as a template, and copy the standard macros to
the new book.
Integration
An advanced macro can be created either when creating or changing a planning
book in Customizing, or in design mode oI interactive demand planning. One can deIine
a macro either Ior an entire planning book or Ior a speciIic data view.
Prerequisites
1. Planning area has been created.
2. Planning buckets proIile has been created.
3. Planning book with at least one data view has been created.
Features
One can:
Control how macro steps are processed through control instructions and
conditions.
Build a macro consisting oI one or more steps.
Control how macro results are calculated through control instructions and
conditions.
93
Use a wide range oI Iunctions and operators (see F1 Help).
DeIine oIIsets so that, Ior example, the result in one period is determined by a
value in the previous period.
Restrict the horizon in which the macro is executed to a speciIic period or periods.
Write macro results to either a row, or a column, or a cell.
Write the results oI one macro step to a row, column, cell or variable, and use
them only in subsequent iterations, macro steps or macros.
Trigger an alert in the Alert Monitor showing the outcome oI a macro execution.
To create authorizations Ior the creation and execution oI macros, choose
Tools Aaministration User Maintenance Roles Irom the SAP Easy
Access menu.
MacroBuilder Screen

Definition
When advanced macros are deIined in a special desktop environment known as the
MacroBuilder.
Use

To open the MacroBuilder, do one oI the Iollowing:
From the SAP Easy Access menu, choose Demana Planning Environment
Current Settings MacroBuilaer.
From design mode oI interactive demand planning, choose MacroBuilaer ~
Planning book or MacroBuilaer ~ Data view (iconrefer to SAP help 'macro
builaer screen`)
Structure
The MacroBuilder consists oI the Iollowing screen areas:
Macro elements in a tree on the top leIt
Depot with parked macros on the bottom leIt
94
Keep all macros that you are not currently editing in the depot. This has perIormance
advantages: the macros tree containing the macros that you are currently editing
works Iaster.
Demand planning table in the top center
Macro tree with the macro tools in the bottom center
To see the attributes oI any item in the tree, double-click on the item.
Standard macros on the top right
Clipboard on the bottom right
ADVANCED MACRO STRUCTURES
Definition
An advanced macro consists oI one or more macro steps. To deIine the conditions
under which individual macro steps are carried out, you use control structures. Each
macro step consists oI one or more calculations. To deIine these calculatons in the macro
tree, you use calculation structures.
Example of a Macro Structure



Control Instructions 1 (Ior steps) ex. IF
Condition 1 (Ior steps)
Step 1 Logical Condition

Condition Instruction 1 (Ior results) IF
Condition
Logical Condition
Result 1


Condition Instruction 2(Ior results) Else
Result 2

Condition Instruction 2(Ior results) End II

Control Instructions 2 (Ior steps) ex. ELSE
Step 2
Control Instructions 3 (Ior steps) ex. End IF
Macro
95

Control Structures Control Structures Control Structures Control Structures
Control structures is used to control calculations and macro steps. A control
structure is made up oI one or more instructions and conditions. The two elements are
located on the same level oI the macro tree. For every condition, you create a subtree
containing a logical condition.
Example of a Control Structure

Control Instructions 1 (Eg. IF)
Condition 1
Examples
Sales
Logical Condition
100

Calculation Structures 1
Control Instruction 2 (Eg. ELSE)

Calculation Structures 2

Control Instruction 3 (Eg. End II)

Calculation Structures Calculation Structures Calculation Structures Calculation Structures
Calculation structures is used to deIine which calculations the system should
perIorm and where the results should be written to:
Example of a Calculation Structure
Result 1 (Eg. Row 1)

Row 2

Row 3

Result 2






96
Using Macro Elements Using Macro Elements Using Macro Elements Using Macro Elements

Use
Use macro elements in combination with macro tools and drag&drop techniques to define
macros.
Features
Icon Element Description

Macro Used in Demand Planning or Supply Network Planning to
carry out complex or Irequent planning tasks quickly and
easily. You can execute a macro in interactive planning or
as part oI mass processing.

User exit macro A unique and/or complex macro used in Demand
Planning or Supply Network Planning that you implement
through Iunctional enhancement APODM005 (transaction
CMOD). A user exit macro can be executed in interactive
planning or mass processing.

Step A macro step consists oI one or more macro calculations
or macro activities. For each macro step, you deIine how
many iterations oI the macro calculations or macro
activities are to be perIormed; that is, the area oI the table
to which the macro calculations/activities apply.
The sequence oI the macro calculations/activites in a step
is not signiIicant; that is, a calculation/activity cannot use
the results oI another calculation/activity within the same
iteration.

Control statement Used together with a condition (see below) to control
macro steps and calculations.

Condition Used Ior the deIinition oI a logical condition that, together
with a control instruction, is used Ior macro steps and
calculations.

Row Row in the table. You can assign the results oI a
calculation to a row (a results row). A row can be used as
an argument in a calculation. A row can also be an
argument in a logical condition (an argument row).

Column Column in the table. You can assign the results oI a
calculation to a column (a results column). A column can
be used as an argument in a calculation. A column can
also be an argument in a logical condition (an argument
column).
97

Cell Cell in the table. You can assign the results oI a
calculation to a cell (a results cell). A cell can be used as
an argument in a calculation. A cell can also be an
argument in a logical condition (an argument cell).

Area Several Iixed cells in the table. You can assign the results
oI a calculation to an area. Use an area iI the Iunction oI a
macro step changes several cells in one iteration. For
example, the Iunction CPY copies values Irom one area to
another area: e.g. to the auxiliary table. In the "copy to"
area, you select only the top leIt cell oI the area beIore
pasting.

Auxiliary table Holds data that is used subsequently as part oI the macro
execution. Use the auxiliary table to retain intermediary
results Ior subsequent calculations, or to collect data Ior
calculations.
An auxiliary table is available in every macros book.

Operator/Iunction Symbolizes:
Comparative operators such as
or ~
Arithmetic operators such as or -
Functions whose arguments are not necessarily
adjacent to each other in the table, such as:
min (sales
i
; sales
i2
)
See also F1 Help.

Function You deIine Iunctions Ior a rectangular section oI the table.
The section borders either are Iixed or move with each
iteration.
II an "$" appears next to a Iunction in the macro tree, this
means that the coordinates oI the section are Iixed and are
not relative to the iterations.
See also F1 Help.

Alert/status Using this element, you can send an alert to the Alert
Monitor: Ior example, you can deIine an alert that is
triggered when a condition (e.g. demand ~ 1000 boxes) is
IulIilled.
A status alert displays the status aIter the execution oI the
macro. Any previous statuses are deleted Irom the Alert
Montior.

98
II you run a macro twice, you see only the latest alert.
A message alert displays the current status aIter the
execution oI the macro, and also any previous statuses. II
you run a macro twice, you see two alerts.
You assign one oI the Iollowing priorities to an alert:
Error
Warning
InIormation
You also assign a text to an alert. This is the text that
appears in the Alert Monitor; Ior example, MAPE is too
big. &. In the Alert Monitor, the actual value oI MAPE
appears in place oI the &.

Procedural message Using this element, you can have the system issue a
message. You deIine the message text yourselI. In
interactive Iorecasting, an inIormation message appears in
a dialog box, while warning, success and error messages
appear at the bottom oI the screen. In mass processing, the
messages are shown in the job log.

Action box Using this element, you can trigger an action that contains
a Iunction. II you do not want to assign the macro results
to a speciIic element oI the planning table, use an action
box. Always use the Iollowing Iunctions in an action box:
HELPTABCLEAR
OUTPUTPOPUP()
REPORTSUBMIT()

Document Using this element, you can have the system send an
email. The recipients can be a single internal user, a
distribution list, or an external user. There are options Ior
sending to Internet addresses, Ior sending regular or
express mails, and Ior including the demand planning
table as an attachment to the email
Using Macro Tools Using Macro Tools Using Macro Tools Using Macro Tools
Use
Use macro tools in combination with macro elements and drag&drop techniques to define
macros.





99
Features

Icon Tool Use this icon to

Attributes Display or change an element's attributes.
Click on the icon, drag it in the macro tree
to the element whose attributes you wish to
see, release the leIt mouse button, and click
on the element. A dialog box appears in
which you can view and change the
requested attributes.

Delete Delete an element in the macro tree. The
deleted element is automatically copied to
the macro clipboard.

Check Check the syntax oI one macro or oI all
macros in the tree.

Generate Generate one macro or all macros. You
must generated a macro beIore it can be
executed.

Active/inactive Activate/deactivate an element in the macro
tree. For example, use this tool to check
individual sections oI complex macros by
deactivating some sections and then
checking the remaining section(s).

Copy to macro clipboard Copy an element in the macro tree to the
clipboard.

Paste Paste the contents oI the clipboard to the
macro tree.

Undo Undo the previous step. You can undo up to
15 steps.

Redo Redo the step you have just undone. You
can redo up to 15 undone steps.

Expand all Expand all nodes in the macro tree.

Collapse all Collapse all nodes in the macro tree.
100

Save layout settings Save the MacroBuilder's new layout aIter
you have adjusted the size oI some oI the
screen areas. The new screen layout is then
retained and appears the next time you open
the MacroBuilder.

Drag&Drop Techniques Drag&Drop Techniques Drag&Drop Techniques Drag&Drop Techniques in the MacroBuilder in the MacroBuilder in the MacroBuilder in the MacroBuilder
Use
You deIine macros in planning books using drag & drop techniques in
combination with macro elements and macro tools. The appearance oI the icon means
that the action is not possible Ior this element. The appearance oI the + icon means that
the action is possible Ior this element, in which case you can let go oI the leIt mouse
button.
Activities

Use drag&drop to do any oI the Iollowing:
Add or insert any macro element in the macro tree
When you drop the element, the system oIIers a choice oI options iI more than
option is available.
Move elements within the macro tree
Drag a macro Irom the macro tree to the standard macros screen area
Remove a macro Irom a standard macro sequence by dragging the macro
downwards to the blank space in the standard macros screen area
Change the sequence oI the standard macros
Copy a part oI the macro tree to the clipboard
Menu Functions For Macros Menu Functions For Macros Menu Functions For Macros Menu Functions For Macros
Use
Three Iunctions are available iI MacroBuilder is accessed as a stand-alone
application (Demana Planning Environment Current Settings Macro Builaer) as
opposed to through interactive demand planning. These Iunctions are Iound in the Eait
menu.
101
Features
Menu option Use this function to
Change name of book Change the name of a macro book. A macro book contains either
all of the macros created for the planning book as a whole or all of
the macros created for a specific data view in the planning book.
Initially, the macro book has the same name as the planning book.
Import macro(s) Import either all macros or one macro from another macro book.
After you have carried out the import, you must perform a
consistency check on the macros to ensure, for example, that all
the rows in the source book also exist in the target book.
After you have carried out the consistency check, you must
activate the macros in the target macro book.
User function Add a function that you have programmed in your own system to
the list of possible operators/functions in the MacroBuilder. You
have programmed the function with transaction SE37. With this
function, you also define the export parameters of the function.

Standard Macro Standard Macro Standard Macro Standard Macro

Definition
A standard macro is a macro that is executed automatically; its execution is not triggered
manually by the demand planner.
A standard macro is one oI the Iollowing types:
Default
A default macro is executed when the demand planner opens the demand planning
desktop and specifies the selection ID, regenerates the screen (for example, by choosing
Enter or Tab), or saves the plan.
Level change
A level change macro is executed when the demand planner drills up or down in
interactive forecasting.
Start
A start macro is executed when the demand planner opens the demand planning desktop
and specifies the selection ID.
102
Exit
An exit macro is executed when the demand planner saves the plan. The
demand planning desktop is closed automatically.

Use
To deIine a macro as a standard macro:
1. Drag and drop the macro Irom the macro tree to the appropriate standard macro
icon in the top right area oI the MacroBuilder.
2. Set the attribute No airect execution Ior the macro.
One possible use oI standard macros is to calculate the diIIerence between Iorecasts oI
diIIerent periods. This is part oI the process Ior Statistical Error Analysis.
Selections

Definition
A selection, sometimes known as a selection ID or a selection variant, groups
together objects that are planned by a demand planner in one planning run. For example,
a selection may contain all the brands and products in the region Ior which the demand
planner is responsible.
From a technical point oI view, a selection is a group oI characteristic value combinations
that Iorm a subset oI the characteristic value combinations that can be planned in one
planning area.
Creating a Selection in Interactive Demand Planning
Prerequisites
Demand Planning master data has been created.
Time series objects Ior the planning area has been created.
Planning book with a data view has been created.
Procedure
1. In interactive demand planning, click (on selection id) in the InIoObjects toolbar.
2. In the Obfect Selection dialog box, enter the object to be shown in the selection.
For example, one might enter Product group.
103
3. In the Obfect Selection dialog box, enter any Iurther criteria that deIine the
selection. At the very least, one must enter a version. For example, one might
enter version 000 and region Eastern.
4. Choose Save selection.
Result

The selection Ior the example described above might look like this:
Show Product group
That fulfills the following conditions

APO planning version 000
Region Eastern

Assigning a Selection in Interactive Demand Planning
Use
AIter creating a selection, assign it to a user selection proIile in order to make it
visible to the demand planner in interactive demand planning. This procedure explains
how to assign a selection to your own selection proIile. To Iind out how to assign a
selection to another user's proIile, see Selection Management.
Prerequisites
A selection has been created.
Procedure
1. In interactive demand planning, click on the Change icon next to one`s selection
proIile in the selector.
2. Proceed as described in Selection Management
Selection Management
Use
Use these Iunctions to manage selection IDs.

Prerequisites
The selections already exist in the system.
104

Features
One can build a working profile of selection IDs for each demand planner.
This proIile is then available in the Selections tree oI interactive demand planning to help
the demand planner access selections quickly and easily.
To Iaciliate the task oI building user-speciIic proIiles, one can build a master profile oI
selection IDs. The building oI a master proIile is optional. ProIiles are built on the leIt
side oI the screen.
Activities
To build a master profile:
1. From the SAP Easy Access menu, choose Demana Planning Environment
Selection Organi:ation Maintain Selection Assignments.
2. Enter the name oI the plannning book and choose Program Execute.
3. In the Profile Iield on the top leIt, choose Master sel.org.
4. In the Reference Iield on the top right, choose All selection IDs.
5. Drag and drop the desired selection IDs Irom the complete list oI selection IDs on
the right side oI the screen to the master proIile on the leIt side oI the screen.
6. II necessary, create Iolders in the master proIile to group selection IDs that belong
together. To create a Iolder, right click the master proIile or on an existing Iolder
on the leIt side oI the screen and choose Create folaer.
7. Choose Save.
To build a user profile:
1. From the APO menu tree, choose Demana Planning Environment Selection
Organi:ation Maintain Selection Assignments.
2. Enter the name oI the plannning book and choose Program Execute.
3. Click on the Create icon on the top leIt.
4. Enter a user, and choose F8.
5. In the Reference Iield on the top right, choose All selection IDs, Master sel.org. or
the selection IDs oI the planning book.
105
6. Drag and drop the desired selection IDs Irom the right side oI the screen to the
user proIile on the leIt side oI the screen.
7. II necessary, create Iolders in the user proIile to group selection IDs that belong
together. To create a Iolder, click with the right mouse button on the master
proIile or on an existing Iolder on the leIt side oI the screen and choose Create
folaer.
8. Choose Save.
To delete a selection ID
Choose Demana Planning Environment Selection Organi:ation Delete
Selection. This transaction can also be used to delete selection IDs oI other applications.

Conclusion

Now, at the end oI this chapter, it is expected that reader is thorough with the concepts oI
Planning Books, Planning view. One should be able to create planning books, data views,
Macro in the Demand Planning module.
Also we covered here what is macro and how it can be advantageous while creating
planning views/planning book. Various Iunctions/Ieatures oI planning table were covered
in detail.


















106




















CHAPTER 5-- Definition/Redefinition of Forecast Models
Focus oI this chapter is creating Master Forecast ProIile, brieIly describing
various statistical Iorecasting techniques. Also various techniques oI Forecasting
accuracy measurement will be covered. In the chapter, Multiple Linear Regression model
(MLR) & Causal analysis and Composite Iorecast will also be brieIly discussed.

You might also like