The macro workbench is a tool for administrating macro books and individual macros. It enables you to quickly find macro books and perform the functions described in the Features section. You program the macros themselves in the MacroBuilder.
Schematic View of the Macro Workbench Screen
The macro workbench consists primarily of two work areas: The tool area that contains buttons with which you can start various functions, and the macro book area where the macro books are displayed. If necessary, separate screens are opened in which the individual macros of a macro book are displayed. You can display the contents of two macro books simultaneously.
The macro book area is the center of the function. Here you select the macro books you want to work with. The list viewer in which the macro books are displayed offers several features for finding and sorting entries. For more information about these functions, see SAP List Viewer (ALV) Grid Control (BC-SRV-ALV) or choose in the toolbar.
In the macro book area, you can select one or more macro books and then perform the following activities:
· Copy the macro books
· Start the MacroBuilder
· Display the macros in the macro books(s)
· Display the coding
· Change the grouping of the macro books(s)
· Generate (activate) all the macros in a macro book
· Start semantic checking for the macro books (see Semantic Check for Macros)
· Delete macro books
· Transport macro books to another system
You can also call up a where-used list without selecting a macro book (see below).
You use macro groups to restrict your selections in the macro workbench. You can select macro books in the SAP List Viewer either manually or by using the filter and sorting functions in the SAP List Viewer.
You use this function to find macros books and individual macros that contain the following:
· A particular key figure
· A particular macro function
· A particular macro element (alert/status, process message, or document)
The system first displays the macro books in which the object is used. If you then display the macros in the macro book, the macros in which the object is used are marked with .
In general, to carry out a function on a macro book, you select the macro book in the macro book window and then select the relevant button in the toolbar or use the context menu.
Displaying Macros in Macros Books
You can display the macros contained in a macro book. To do so, you choose the macro book and either click the description of the macro book or choose in the application toolbar. A list of the available macros appears with columns that show if the macro has a note (), or is a standard macro. If the latter is the case, the relevant icon and the position of the standard macro are displayed within the planning book. This can be important if several standard macros are executed one after the other.
To copy one or more macros from one macro book to another, do the following:
1. Select the source macro book and display the macros. The macro book appears in the lower window.
2. Select the target macro book and choose Display second macro book from the context menu. The macro book appears in the lower right-hand window.
Alternatively, you can select both the source and the target macro book in the macro book window and then choose from the toolbar. Both windows are opened together.
3. In the source book, you select the macros to be copied. Choose or the requisite entry in the context menu. The macros are copied to the clipboard.
4. In the target book, choose or the requisite entry in the context menu. The macros are copied to the target book.
When macros are copied, they are in deactivated status. This is intentional. Before you activate the macros, check that all the key figures exist in the planning book and that compatible periods are used.
Similarly, you can move macros from one macro book to another. You open the two macro screens as described above and use Drag&Drop to move one or more macros from one macro book to another. As above, the macros are deactivated when they are moved.
You can create notes for individual macros. You use notes to briefly explain the usage of a macro and to provide users with other useful information. You can start the function from the macro screen by using the context menu. An editor appears in which you can edit a text or import unformatted text (*.txt) from a file. When you have finished, choose to save your changes. Choose to return to the Macro Workbench. An icon beside a macro indicates that the macro has an attached note.
Starting the MacroBuilder
You can start the MacroBuilder in a variety of ways.
From the macro book screen area:
· Choose from the toolbar.
· Double-click the macro book anywhere except on the Description or the Changed by columns.
· Choose Start MacroBuilder from the context menu.
From the macro screen area:
· Choose from the toolbar at the top of the screen area.
· Choose Start MacroBuilder from the context menu.
Do not select a macro book.
Choose Where-used list from the toolbar. A dialog box appears. You now select the indicator next to the required option. An input help is available for each option (the Copy fr. field) in which you choose available objects.
For instance, if you want to see the macro books in which the FIX_CALC() function is used, you select the Macro function indicator and choose FIX_CALC() from the input help. When you click FIX_CALC, the function is automatically transferred to the upper line. You can now add text (for example, an argument) for the function.
When you choose , the system finds the macro books that are currently in the macro book work area and that contain the search object. If you now open the macro book and display the macros in the macro workbench, the macros that contain the search object are flagged with a instead of a traffic light. If you then open the MacroBuilder, these macros are also adopted automatically in the processing area.
To return to the previous display in the macro book work area, choose .
Transporting and Copying Macro Books
You use these functions to transport macro books to other systems.
To be able to use macro books in another system, you need to have already exported other objects such as the relevant planning object structures and planning areas to the target system. You do this in Customizing for Demand Planning or Supply Network Planning under Basic Settings ® Maintain Manual Transport Link for DP/SNP. You can also use this activity to transport macro books. If the planning area does not exist in the target system, you can transport the macro book, but you cannot open the macro book or use the macros.
There are two methods of copying entire macro books.
Both of these functions are intended primarily for system administrators. You require the necessary authorizations to execute them.
Using Transport Requests
You can add macro books to a transport request so that they are transported to the target system(s) when the request is released. When you transport a macro book, you must also transport notes. This means that notes must exist for at least one macro in the macro book. (If necessary, create a dummy note.)
To transport a macro book, select the macro book and choose Transport Request or, from the menu, choose Tools ® Transport Macro Books. In the dialog box that appears, enter an existing transport request or create a new one. The transport request determines to which system the macro book is transported. Choose . You transport notes using the RFC connection as described below.
Copy Macro Books Externally
This function uses an RFC connection to copy a selected macro book directly to another SAP APO system.
You must have previously made the necessary settings for the target system. For information about the necessary RFC settings, see Maintaining Remote Destinations.
To transport a macro book via an RFC connection, select one or more macro books and choose Tools ® Copy Macro Book Externally. In the dialog box that appears, enter the name of the system and the target macro book.