Entering content frame

Function documentation Using Macro Elements Locate the document in its SAP Library structure

Use

To define macros, use macro elements in combination with macro tools (see Using Macro Tools) and drag&drop techniques (see Definition of Macros in the MacroBuilder).

Features

Icon

Element

Description

This graphic is explained in the accompanying text

Macro

Used in Demand Planning or Supply Network Planning (SNP) to carry out complex or frequent planning tasks quickly and easily. You can execute a macro in interactive planning or as part of mass processing.

This graphic is explained in the accompanying text

BAdI/User Exit Macro

A complex macro used in Demand Planning or SNP and that you implement in ABAP yourself. You can use this Business Add-In (BAdI) in a collective macro.

This graphic is explained in the accompanying text

Step

A macro step consists of one or more macro calculations or macro activities. For each macro step, you define how many iterations of the macro calculations or macro activities are to be performed; that is, the area of the table to which the macro calculations/activities apply.

The sequence of the macro calculations/activities in a step is not significant; that is, a calculation/activity cannot use the results of another calculation/activity within the same iteration.

This graphic is explained in the accompanying text

Control statement

Used together with a condition (see below) to control macro steps and calculations.

This graphic is explained in the accompanying text

Condition

Used for the definition of a logical condition that, together with a control instruction, is used for macro steps and calculations.

This graphic is explained in the accompanying text

Row

Row in the table. You can assign the results of a calculation to a row (a results row). A row can be used as an argument in a calculation. A row can also be an argument in a logical condition (an argument row). The calculation is repeated for all the cells that lie within the period defined for the step.

This graphic is explained in the accompanying text

Column

Column in the table. You can assign the results of a calculation to a column (a results column). A column can be used as an argument in a calculation. A column can also be an argument in a logical condition (an argument column). As for rows, calculations are repeated for all the cells in the column.

This graphic is explained in the accompanying text

Cell

Cell in the table. You can assign the results of a calculation to a cell (a results cell). A cell can be used as an argument in a calculation. A cell can also be an argument in a logical condition (an argument cell).

This graphic is explained in the accompanying text

Area

Several adjacent cells in the table. You can assign the results of a calculation to an area. Use an area if the function of a macro step changes several cells in one iteration. For example, the function CPY copies values from one area to another area, such as to the auxiliary table. In the "copy to" area, you select only the top left cell of the area before pasting. Another use of areas is in mathematical operations, for example where a sum is formed over a range of cells or a maximum value is found.

This graphic is explained in the accompanying text

Auxiliary table

Holds data that is used subsequently as part of the macro execution. Use the auxiliary table to retain intermediary results for subsequent calculations, or to collect data for calculations.

The same elements are available in the auxiliary table as in the planning book table.

The system differentiates between a local auxiliary table and a global auxiliary table. A global auxiliary table is available in every macro book. If you do not set the Do Not Initialize Auxiliary Table indicator, the system uses a local auxiliary table for this macro and you cannot access the global auxiliary table. You can use the global auxiliary table if you set the indicator Do Not Initialize Auxiliary Table.

Values in an auxiliary table cannot be saved. To save them, you must assign the values to elements in the planning book table.

This graphic is explained in the accompanying text

Operator/function

Symbolizes:

·         Comparative operators such as < or >

·         Arithmetic operators such as + or -

·         A wide range of complex functions that enable you to manipulate data in your planning book. These functions include several useful DP and SNP tools.

See also Operators and Functions in Macros.

This graphic is explained in the accompanying text

Function

You define functions for a rectangular section of the table. The section borders either are fixed or move with each iteration.

If an "$" appears next to a function in the macro tree, this means that the coordinates of the section are fixed and are not relative to the iterations.

This graphic is explained in the accompanying text

Alert/status

You can use this element to send an alert to the Alert Monitor: For example, you can define an alert that is triggered if a specific condition is met (such as demand > 1,000 boxes).

A status alert displays the status after the execution of the macro. Any previous statuses are deleted from the Alert Monitor. If you run a macro twice, you see only the latest alert.

A message alert displays the current status after the execution of the macro, and also any previous statuses. If you run a macro twice, you see two alerts.

You assign one of the following priorities to an alert:

·         Error

·         Warning

·         Information

You also assign a text to an alert. This is the text that appears in the Alert Monitor; for example, MAPE is too big: &. In the Alert Monitor, the actual value of MAPE appears in place of the &.

You can assign the alerts that are generated in a planning book/ data view to another planning book/data view.  This is particularly useful when working with background jobs.

This graphic is explained in the accompanying text

Process message

Using this element, you can have the system issue a message. You define the message text yourself. In interactive forecasting, an information message appears in a dialog box, while warning, success and error messages appear at the bottom of the screen. In mass processing, the messages are shown in the job log.

Note that if the system issues a procedural message with type ‘Warning’ or ‘Error’, it also terminates the macro. The background job is not terminated. Any changes that the macro has already made are revoked.

This graphic is explained in the accompanying text

Action box

Use an action box if a macro function does not return a result or if you do not want to assign the result of a macro function to an element of the planning table or auxiliary table. Always use the following functions in an action box:

·         HELPTAB_CLEAR

·         OUTPUT_POPUP()

·         REPORT_SUBMIT()

This graphic is explained in the accompanying text

Document

Using this element, you can have the system send an email. The recipients can be a single internal user, a distribution list, or an external user. There are options for sending to Internet addresses, for sending regular or express mails, and for including the demand planning table as an attachment to the email.

If you do not enter a recipient, a dialog box requesting the details appears when the macro is run.

You can also use a variable to create the address at runtime. Enter LAYOUTVARIABLE( ‘variable name’) in the recipient field.

 

 

Leaving content frame