Entering content frame

Function documentation Macro Workbench Locate the document in its SAP Library structure

Use

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.

Features

This graphic is explained in the accompanying text

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 macro books with which you want to work, and you then perform the following activities:

     Export the macros

     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).

Macro Groups

You use macro groups to restrict your selections in the macro workbench. You can select macro books either manually or by using filter and sort functions.

Where-Used List

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 This graphic is explained in the accompanying text.  

Activities

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 application 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 select the macro book and choose This graphic is explained in the accompanying text in the application toolbar. A list of the available macros appears with columns that show if the macro has a note (This graphic is explained in the accompanying text), 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.

Copying Macros

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 This graphic is explained in the accompanying text from the toolbar. Both windows are opened together.

       3.      In the source book, you select the macros to be copied. Choose This graphic is explained in the accompanying text or the requisite entry in the context menu. The macros are copied to the clipboard.

       4.      In the target book, choose This graphic is explained in the accompanying text or the requisite entry in the context menu. The macros are copied to the target book.

Note

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.

Moving Macros

Similarly, you can move macros from one macro book to another. You open the two macro screens as described above and use drag and drop to move one or more macros from one macro book to another. As above, the macros are deactivated when they are moved.

Notes Management

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 This graphic is explained in the accompanying text to save your changes. Choose This graphic is explained in the accompanying text to return to the macro workbench. A This graphic is explained in the accompanying text 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:

Select the macro book.

     Choose This graphic is explained in the accompanying text from the application toolbar.

     Double-click the macro book anywhere except for the Changed by column.

     Choose Start MacroBuilder from the context menu.

From the macro screen area:

     Choose This graphic is explained in the accompanying text from the application toolbar at the top of the screen area.

     Choose Start MacroBuilder from the context menu.

Where-Used List

Do not select a macro book.

Choose This graphic is explained in the accompanying text 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 This graphic is explained in the accompanying text, 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 This graphic is explained in the accompanying text instead of a traffic light. If you then open the MacroBuilder, these macros are also copied automatically in the processing area.

To return to the previous display in the macro book work area, choose This graphic is explained in the accompanying text.

Transporting Macro Books

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, the system exports relevant notes directly to the target system. For this, you must specify the relevant RFC destination.

Note

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.

To transport a macro book, select the book and choose Tools ® Transport Macro Books. On the dialog box that appears, enter an existing transport request or create new one. The transport request determines the system to which the macro book is transported. Choose This graphic is explained in the accompanying text.

Exporting Macros

This function uses an RFC connection to copy the macros for selected macro books to an existing macro book in another SAP SCM system. You must have previously made the necessary RFC settings for the target system. For more information, see Structure linkMaintaining Remote Destinations.

If you want to export macros, select one or more macro books and choose Tools ® Export Macros. On the dialog box that appears, enter the RFC connection and the target macro book.

Note

The functions Transporting Macro Book and Exporting Macros are intended primarily for system administrators. You require the necessary authorizations to execute them.

 

Leaving content frame