Date post: | 24-Oct-2014 |
Category: |
Documents |
Upload: | ankush-agrawal |
View: | 219 times |
Download: | 9 times |
92
3. On the Scale tab, deselect the checkboxes to the right of the labels Maximum and Minimum.
4. Enter the required range of values in the fields to the right of these labels. 5. Click OK.
Advanced Macros
UseAdvanced macros are used to perform complex calculations quickly and easily.
Macros are executed either directly by the user or automatically at a predefined point in
time.
The definition of macros is optional.
The macros for aggregation and disaggregation come predefined with the system. You do
not have to write them yourself. Some stock level and days' supply macros are also
delivered with the standard SNP planning books. One can create its own planning book
for SNP using one of the existing books as a template, and copy the standard macros to
the new book.
IntegrationAn advanced macro can be created either when creating or changing a planning
book in Customizing, or in design mode of interactive demand planning. One can define
a macro either for an entire planning book or for a specific data view.
Prerequisites
1. Planning area has been created.
2. Planning buckets profile 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 of one or more steps.
• Control how macro results are calculated through control instructions and
conditions.
93
• Use a wide range of functions and operators (see F1 Help).
• Define offsets so that, for 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 specific period or periods.
• Write macro results to either a row, or a column, or a cell.
• Write the results of 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 of a macro execution.
To create authorizations for the creation and execution of macros, choose
Tools → Administration → User Maintenance → Roles from the SAP Easy
Access menu.
MacroBuilder Screen
Definition
When advanced macros are defined in a special desktop environment known as the
MacroBuilder.
Use To open the MacroBuilder, do one of the following:
• From the SAP Easy Access menu, choose Demand Planning → Environment
→ Current Settings → MacroBuilder.
• From design mode of interactive demand planning, choose MacroBuilder =>
Planning book or MacroBuilder => Data view (icon�refer to SAP help �macro
builder screen�)
Structure The MacroBuilder consists of the following screen areas:
• Macro elements in a tree on the top left
• Depot with parked macros on the bottom left
94
Keep all macros that you are not currently editing in the depot. This has performance
advantages: the macros tree containing the macros that you are currently editing
works faster.
• Demand planning table in the top center
• Macro tree with the macro tools in the bottom center
To see the attributes of 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 of one or more macro steps. To define the conditions
under which individual macro steps are carried out, you use control structures. Each
macro step consists of one or more calculations. To define these calculatons in the macro
tree, you use calculation structures.
Example of a Macro Structure
Control Instructions 1 (for steps) ex. IF Condition 1 (for steps) Step 1 Logical Condition Condition Instruction 1 (for results) IF Condition Logical Condition Result 1
Condition Instruction 2(for results) Else Result 2 Condition Instruction 2(for results) End If
Control Instructions 2 (for steps) ex. ELSE Step 2 Control Instructions 3 (for steps) ex. End IF
Macro
95
Control StructuresControl StructuresControl StructuresControl Structures
Control structures is used to control calculations and macro steps. A control
structure is made up of one or more instructions and conditions. The two elements are
located on the same level of 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 If)
Calculation StructuresCalculation StructuresCalculation StructuresCalculation Structures Calculation structures is used to define which calculations the system should
perform 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 ElementsUsing Macro ElementsUsing Macro ElementsUsing 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 frequent planning tasks quickly and easily. You can execute a macro in interactive planning or as part of mass processing.
User exit macro A unique and/or complex macro used in Demand
Planning or Supply Network Planning that you implement through functional enhancement APODM005 (transaction CMOD). A user exit macro can be executed in interactive planning or mass processing.
Step A macro step consists of one or more macro calculations
or macro activities. For each macro step, you define how many iterations of the macro calculations or macro activities are to be performed; that is, the area of the table to which the macro calculations/activities apply.
The sequence of the macro calculations/activites in a step is not significant; that is, a calculation/activity cannot use the results of another calculation/activity within the same iteration.
Control statement Used together with a condition (see below) to control
macro steps and calculations.
Condition Used for the definition of a logical condition that, together with a control instruction, is used for macro steps and calculations.
Row Row in the table. You can assign the results of 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 of 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 of 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 fixed cells in the table. You can assign the results of a calculation to an area. Use an area if the function of a macro step changes several cells in one iteration. For example, the function CPY copies values from one area to another area: e.g. to the auxiliary table. In the "copy to" area, you select only the top left cell of the area before pasting.
Auxiliary table Holds data that is used subsequently as part of the macro
execution. Use the auxiliary table to retain intermediary results for subsequent calculations, or to collect data for calculations.
An auxiliary table is available in every macros book.
Operator/function 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 i+2 )
See also F1 Help.
Function You define functions for a rectangular section of the table. The section borders either are fixed or move with each iteration. If an "$" appears next to a function in the macro tree, this means that the coordinates of the section are fixed 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: for example, you can define an alert that is triggered when a condition (e.g. demand > 1000 boxes) is fulfilled. A status alert displays the status after the execution of the macro. Any previous statuses are deleted from the Alert Montior.
98
If you run a macro twice, you see only the latest alert. A message alert displays the current status after the execution of the macro, and also any previous statuses. If you run a macro twice, you see two alerts. You assign one of the following priorities to an alert:
• Error • Warning • Information
You also assign a text to an alert. This is the text that appears in the Alert Monitor; for example, MAPE is too big: &. In the Alert Monitor, the actual value of MAPE appears in place of the &.
Procedural message Using this element, you can have the system issue a
message. You define the message text yourself. In interactive forecasting, an information message appears in a dialog box, while warning, success and error messages appear at the bottom of 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 function. If you do not want to assign the macro results to a specific element of the planning table, use an action box. Always use the following functions in an action box:
• HELPTAB_CLEAR • OUTPUT_POPUP() • REPORT_SUBMIT()
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 for sending to Internet addresses, for sending regular or express mails, and for including the demand planning table as an attachment to the email
Using Macro ToolsUsing Macro ToolsUsing Macro ToolsUsing 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 left 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 of one macro or of all macros in the tree.
Generate Generate one macro or all macros. You must generated a macro before it can be executed.
Active/inactive Activate/deactivate an element in the macro tree. For example, use this tool to check individual sections of 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 of 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 after you have adjusted the size of some of 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 MacroBuilderin the MacroBuilderin the MacroBuilderin the MacroBuilder
UseYou define macros in planning books using drag & drop techniques in
combination with macro elements and macro tools. The appearance of the Ø icon means
that the action is not possible for this element. The appearance of the + icon means that
the action is possible for this element, in which case you can let go of the left mouse
button.
Activities Use drag&drop to do any of the following: ��Add or insert any macro element in the macro tree
When you drop the element, the system offers a choice of options if more than
option is available.
��Move elements within the macro tree
��Drag a macro from the macro tree to the standard macros screen area
��Remove a macro from a standard macro sequence by dragging the macro
downwards to the blank space in the standard macros screen area
��Change the sequence of the standard macros
��Copy a part of the macro tree to the clipboard
Menu Functions For MacrosMenu Functions For MacrosMenu Functions For MacrosMenu Functions For Macros
UseThree functions are available if MacroBuilder is accessed as a stand-alone
application (Demand Planning ! Environment ! Current Settings ! Macro Builder) as
opposed to through interactive demand planning. These functions are found in the Edit
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 of the following 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 define a macro as a standard macro:
1. Drag and drop the macro from the macro tree to the appropriate standard macro icon in the top right area of the MacroBuilder.
2. Set the attribute No direct execution for the macro.
One possible use of standard macros is to calculate the difference between forecasts of different periods. This is part of the process for 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 for which the demand
planner is responsible.
From a technical point of view, a selection is a group of characteristic value combinations
that form a subset of 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 for 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 InfoObjects toolbar.
2. In the Object Selection dialog box, enter the object to be shown in the selection.
For example, one might enter Product group.
103
3. In the Object Selection dialog box, enter any further criteria that define 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 for 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
UseAfter creating a selection, assign it to a user selection profile 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 profile. To find out how to assign a
selection to another user's profile, 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
profile in the selector.
2. Proceed as described in Selection Management
Selection Management
UseUse these functions to manage selection IDs.
PrerequisitesThe selections already exist in the system.
104
FeaturesOne can build a working profile of selection IDs for each demand planner.
This profile is then available in the Selections tree of interactive demand planning to help
the demand planner access selections quickly and easily.
To faciliate the task of building user-specific profiles, one can build a master profile of
selection IDs. The building of a master profile is optional. Profiles are built on the left
side of the screen.
Activities
To build a master profile:
1. From the SAP Easy Access menu, choose Demand Planning → Environment
→ Selection Organization → Maintain Selection Assignments.
2. Enter the name of the plannning book and choose Program → Execute.
3. In the Profile field on the top left, choose Master sel.org.
4. In the Reference field on the top right, choose All selection IDs.
5. Drag and drop the desired selection IDs from the complete list of selection IDs on
the right side of the screen to the master profile on the left side of the screen.
6. If necessary, create folders in the master profile to group selection IDs that belong
together. To create a folder, right click the master profile or on an existing folder
on the left side of the screen and choose Create folder.
7. Choose Save.
To build a user profile:
1. From the APO menu tree, choose Demand Planning → Environment → Selection
Organization → Maintain Selection Assignments.
2. Enter the name of the plannning book and choose Program → Execute.
3. Click on the Create icon on the top left.
4. Enter a user, and choose F8.
5. In the Reference field on the top right, choose All selection IDs, Master sel.org. or
the selection IDs of the planning book.
105
6. Drag and drop the desired selection IDs from the right side of the screen to the
user profile on the left side of the screen.
7. If necessary, create folders in the user profile to group selection IDs that belong
together. To create a folder, click with the right mouse button on the master
profile or on an existing folder on the left side of the screen and choose Create
folder.
8. Choose Save.
To delete a selection ID
Choose Demand Planning → Environment → Selection Organization → Delete
Selection. This transaction can also be used to delete selection IDs of other applications.
Conclusion
Now, at the end of this chapter, it is expected that reader is thorough with the concepts of
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 functions/features of planning table were covered
in detail.
106
CHAPTER 5-- Definition/Redefinition of Forecast Models Focus of this chapter is creating Master Forecast Profile, briefly describing
various statistical forecasting techniques. Also various techniques of Forecasting accuracy measurement will be covered. In the chapter, Multiple Linear Regression model (MLR) & Causal analysis and Composite forecast will also be briefly discussed.