Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

macros

Former Member
0 Likes
728

hi to all,

wat is the differences b/w macro and subroutines.pls provide me ans if usefull full points to all.

thanx

lokanadhan.k

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
707

Hi,

Macros can only be used in the program in which they are defined in and only after the definition.

Macros can take max 9 parameters.

Macros are expanded at compilation / generation.

Macros debugging is not possible

Subroutines (FORM) can be called from both the program in which they are defined in and other programs ('perform ' and 'perform in program ').

Subroutines can take any amount of parameters.

Subroutines are 'expanded' at runtime.

Subroutienes debugging is possible

rgds,

bharat.

4 REPLIES 4
Read only

suresh_datti
Active Contributor
0 Likes
707

Macros have placeholders

Macros cannot be debugged

~Suresh

Read only

Former Member
0 Likes
707

one difference is

In subroutines we can pass USING , TABLES and CHANGING parameters

but in macros we cannot use that

Read only

Former Member
0 Likes
708

Hi,

Macros can only be used in the program in which they are defined in and only after the definition.

Macros can take max 9 parameters.

Macros are expanded at compilation / generation.

Macros debugging is not possible

Subroutines (FORM) can be called from both the program in which they are defined in and other programs ('perform ' and 'perform in program ').

Subroutines can take any amount of parameters.

Subroutines are 'expanded' at runtime.

Subroutienes debugging is possible

rgds,

bharat.

Read only

Former Member
0 Likes
707

All the above answers are usefull....... I will go functionality wise.

A macro consists of number of executable statements. Whenever a program gets executed at the place of macro name in the program, the set of exucateble statements get executed and the memory allocated to the macro is released...

In case of subroutines, the control places a call to form routine and wait for its processing... As per the performance it is branching control from perform stmt to form-end perform stmt.....

Hope u have got some idea..

regards......