0% found this document useful (0 votes)
51 views2 pages

DEFINE - ... End-Of-Definition

Macros allow programmers to reuse blocks of code by defining them with a name and syntax. A macro must be defined before it is used in a program using the DEFINE and END-OF-DEFINITION keywords. Macros can accept up to nine placeholders for parameters that are passed when the macro is called.

Uploaded by

Vikram Bigamudre
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views2 pages

DEFINE - ... End-Of-Definition

Macros allow programmers to reuse blocks of code by defining them with a name and syntax. A macro must be defined before it is used in a program using the DEFINE and END-OF-DEFINITION keywords. Macros can accept up to nine placeholders for parameters that are passed when the macro is called.

Uploaded by

Vikram Bigamudre
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

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.

Output

We can pass up to 9 placeholders to Macros.


*Macro definition DEFINE print. write:/ 'Hello', &1, &2. END-OF-DEFINITION. WRITE:/ 'Before Using Macro'. print 'ABAP' 'Macros'.

Output

You might also like