Defining a Macro in a Planning Type 
The definition of macros is optional.

In the case of consistent planning, the macros for aggregation and disaggregation come predefined with the system. You do not have to write them yourself. In both consistent and level-by-level planning, a function for disaggregating a line using the predefined proportional factors is available.
See also:
You can define a macro in one of two ways:
The Record function allows you to define a macro directly in the planning screen. It is therefore quicker than the Create function. The operands can be either texts from lines in the planning table or numerical values. The operators are displayed in the application toolbar. Standard operators are provided for the calculation of stock balance, production, days’ supply, and historical totals (see
The Create function allows you to define a macro in a separate window. You therefore see exactly how each macro is calculated. You also set two indicators that determine how the macro is handled in the planning table. The operands can be either texts from lines in the planning table or numerical values. This function is suitable for complicated macros consisting possibly of several lines.

You can also write your own coding for function module EXIT_SAPMMCP6_002 to define a highly complicated macro. See also the Implementation Guide for Sales & Operations Planning (the step "Develop functional enhancement to calculate a macro").
To define a macro using the Record function:
The Define Macro dialog box appears.
To continue, choose ENTER .
To define a macro for stock balances, production, days’ supply, or a historical total using the Record function:
The Define Macro dialog box appears.
To continue, choose ENTER .
See also Macros for Stock Balance, Production, Days’ Supply, and Historical Totals.
The mathematical operations to be performed by this operator are recorded internally.

You cannot try out macros for production or days’ supply in the planning type. This is because these macros depend on the number of workdays in a period and the period length is not specified in the planning type.
To define a macro using the Create function:
The Define Macro dialog box appears.
To continue, choose ENTER .
You leave the field blank if, for example, you want to aggregate members (first Operand) to owner level (Result).
To change or display an existing macro, choose Macro ® Edit. To try out a macro, choose Macro ® Execute. To delete a macro, choose Macro ® Delete.