Differences between Macros & Subroutines:-
Macros Subroutines
1. In macro definition should be the
first & the calling should be the next.
2. The definition of the macro as
well as the calling of the macro in
the same program.
3. Macros can take up to 9 place
holders.
4. We can place any executable
statements after the definition of the
macro.
5. Macros are used in HR ABAP.
1. In subroutine calling should be the
first & definition should be the next.
2. The definition of the subroutine as
well as the calling of the subroutine
may or may not be in the same
program.
3. Subroutines can take any number
of place holders.
4. We can‘t place any executable
statements after the definition of the
macro.
5. Subroutines are used in both
ABAP & HR ABAP.
Global data:-
Subroutines can access the global declarations in which they are
defined.
When ever the changes occurred in the subroutine those changes will be reflected
to global declarations.
Note:-
LOCAL is the keyword to avoid the changes in subroutines.Differences between Macros & Subroutines:-
Macros Subroutines
1. In macro definition should be the
first & the calling should be the next.
2. The definition of the macro as
well as the calling of the macro in
the same program.
3. Macros can take up to 9 place
holders.
4. We can place any executable
statements after the definition of the
macro.
5. Macros are used in HR ABAP.
1. In subroutine calling should be the
first & definition should be the next.
2. The definition of the subroutine as
well as the calling of the subroutine
may or may not be in the same
program.
3. Subroutines can take any number
of place holders.
4. We can‘t place any executable
statements after the definition of the
macro.
5. Subroutines are used in both
ABAP & HR ABAP.
Global data:-
Subroutines can access the global declarations in which they are
defined.
When ever the changes occurred in the subroutine those changes will be reflected
to global declarations.
Note:-
LOCAL is the keyword to avoid the changes in subroutines.