If we want to reuse the same set of statements more than once in a program, we can include them in a macro. We can only use a macro within the program in which it is defined. Macro definition should occur before the macro is used in the program.

We can use the following syntax  to define a macro.
 
DEFINE <macro name>.
...
END-OF-DEFINITION.
Demo program using Macro.
*Macro definition
DEFINE print.
  write:/ 'Hello Macro'.
END-OF-DEFINITION.

WRITE:/ 'Before Using Macro'.
print.
 
 
 
 
Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP S/4 HANA Logistics Consultant
Contact : serkurumsal@yandex.com