A macro is a mathematical operation that consists of a sequence of instructions. These instructions are carried out when the macro is executed. Macros are therefore useful for frequently required and/or complicated series of instructions. Although the instructions themselves may be complex, the execution of the macro by the user is very simple. S/he does not even need to be familiar with the calculation being performed. Thus, macros save time and prevent typing errors.
You can use two kinds of macros in Sales & Operations Planning (SOP):
Standard SOP comes supplied with macros for the dual-level planning of product groups and materials (see
You can define your own macros in a planning type. You then apply these macros in plans which are based on this planning type.
You can execute macros either in the background or online. In background processing, the system calculates the results at the planning level defined in the variant. In online processing, the system calculates the results in one of two ways:
The Aggr. planning indicator in the planning type is switched on.
The Aggr. planning indicator in the planning type is switched off.
The planning level at which you execute the macro makes a difference to the results, as the following example illustrates.
The planned sales values of your company are as follows:
You record the following macro:
Operand |
Operator |
Operand |
Result |
Sales |
+ |
1 |
Revised sales |
If you execute this macro at the sales organizational level, you get the following result:
Operand |
Operator |
Operand |
Result |
100 |
+ |
1 |
101 |
The total is 101. This total is disaggregated to the detailed level.
If you execute the macro at the material level (that is, the detailed level), you get the following result:
Operand |
Operator |
Operand |
Result |
10 |
+ |
1 |
11 |
40 |
+ |
1 |
41 |
20 |
+ |
1 |
21 |
30 |
+ |
1 |
31 |
These results are aggregated to the total level. The total is 104.