Macro Modules

Definition

An module that can be called within an ABAP program.

Use

Like subprograms and function modules, macro modules are a means of presenting programs in modular form. Macro modules (macros) are used often in the Human Resources application component (HR).

Defining and Calling Modules

Two options are provided:

  • Macros can be defined in reports or includes using the ABAP command DEFINE. A macro can be used within a report or within an include. If a macro is used in a report, and the macro is defined in an include with the DEFINE command, the include must be integrated.

Note Note

Macros have the following advantages:

If a macro is changed, each report using this macro is automatically regenerated when it is executed.

End of the note.
  • Macros can also be defined as RMAC macros. The source code of these modules is stored in the function section of the control table TRMAC (Macros in ABAP Programs). The coding is grouped under a specific name in the table key.

    According to conventions, the first two letters of the name must stand for the application. The rest of the name is freely definable.

Recommendation Recommendation

Customer-specific RMAC modules should begin with a special character.

The macros defined in the control table TRMAC can be used by all reports.

When you change a RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.

End of the recommendation.

The following section includes a list of programming utilities for the logical databases PNP and PAP .