Start of Content Area

Procedure documentation Creating Macros  Locate the document in its SAP Library structure

Use

Characteristics are mapped from one level to the next using macros.

Macros can be used at all points in the PPM as part of the means of propagating characteristics. Macros for planning parameters, however, can only be used with the relevant component.

Procedure

  1. Double-click the entry field in the Macro column in the row with the required characteristic.

The Display – Define Parameters screen appears.

  1. Choose the characteristics to be used as parameters in a macro:
  1. Choose Macro.
  2. The Display – Macro screen appears. The interface definition for the macro is displayed in the top part of the screen. On the lower part of the screen, create the macro core.

  3. At the bottom of the screen, enter the required mapping function in a few lines of ABAP code.

Use the parameters listed at the top of the screen to do so. The USING parameters should provide values for all of the CHANGING and TABLES parameters.

The following ABAP data types are used for the parameters:

Data element /SAPAPO/MC01CHAR_VAL_NUMERIC, DEC with 15 digits, 3 decimal places

Data element /SAPAPO/MC01_CHAR08, (similar data types are defined for character strings with lengths of 16, 24, and 30)

TYPES macro_numeric_tab_type
TYPE STANDARD TABLE OF /SAPAPO/MC01CHAR_VAL_NUMERIC.

TYPES macro_char08_tab_type
TYPE STANDARD TABLE OF /SAPAPO/MC01_CHAR08.

This means CHAR with 8 characters; lower-case letters are permitted, there is no check for lower case, value tables, fixed values or conversion routines against the technical settings of the characteristics used as a basis (similar data types are defined for character strings with lengths of 16, 24, and 30).

TYPES BEGIN OF macro_numeric_rng_type,
lower TYPE /SAPAPO/MC01CHAR_VAL_NUMERIC,
val_null_lower TYPE /SAPAPO/BOOLEAN,
upper TYPE /SAPAPO/MC01CHAR_VAL_NUMERIC,
val_null_upper TYPE /SAPAPO/BOOLEAN,
END OF macro_numeric_rng_type.
The indicators val_null_lower and val_null_upper assume the values ' ' and 'X'.

Note that a simplified type assignment is used for alphanumeric parameters: A character string that is at least as long as the alphanumeric characteristic is used instead of the exact technical settings of the associated characteristic.

Result

When the plan is exploded, the macro determines the values for the characteristics and requirements to be set, based on the values of the parameters to be used.

 

 

 

End of Content Area