You are on page 1of 1

Users face numerous complex situations in the planning process, such as adjusting a

key figure value in the planning book or working out one key figure value to
calculate another. They can easily use the standard macro functionality to achieve
this. But there might be more complex scenarios where use of standard macros may
not achieve results. One example is finding out the order number for a cell value
from live cache and using it in alerts or adjusting the forecast figures by using a
complex formula which cannot be accommodated in standard macros. Writing a user
exit macro is one of the solutions to overcome this. The grid structure of the
planning book is transferred in the user exit macro. The cell value of a key figure
can therefore be read from the grid structure and used in various ways to complete
the gaps.
Steps to create a macro

The following example explains how to develop a user exit macro based on a given
set of circumstances. Imagine an automotive plant where a buyer has issued a large
number of purchase orders for a component and uses SAP Advanced Planning and
Optimization for planning. Standard SAP APO alerts are generated if there is any
delay by the vendor. But the buyer does not know which purchase order (PO) is due.
He needs to get the number of the PO which is due in the alert. To do this a user
exit macro can be used. In this example the production plant code is 1200, the
destination area warehouse codes are 1300 and 1400 and the product codes are 100-
500 and 100-501.
To develop the user exit macro a whole series of steps have to be completed. It is
assumed here that mySAP SCM version 4.0 and above is being used. The process starts
at the macro workbench by using the path Demand Planning � Environment � Current
settings � Macro Workbench. Then the planning book is selected for which the user
exit macro needs to be developed. Once the macro workbench is entered (by selecting
the macro workbench button), the user exit macro button should be dragged and
dropped from the top left hand side window into the working area (bottom section of
the middle window).The macro should be given an appropriate name. If a large number
of user exit macros are to be developed, the name needs to be carefully selected as
this drives the execution of code as explained in the next section. The macro
should be saved. This occurs when exiting the workbench and the user exit project
activated by using enhancement component �APODM005�. This calls up a user exit
function module �EXIT_/SAPAPO/SAPMMCP6_005�.
Parameters

I_MACRO_NAME: This will convey the name of the macro and help control which part of
the code is used. If a large number of user exit macros have been developed for
different planning books, verify the execution of relevant code in the exit
function module by checking the name of the user exit macro.
E.g. if I_MACRO_NAME = �XYZ�.
Code�.
Elseif I_MACRO_NAME = �ABC�.
Code�.
Endif.

You might also like