What is the difference between macro and subroutine?

Answer Posted / nandy2

1. In a program it is often necessary to repeat the block of code many times.In this situation a macro facility may be useful . Macro instruction are singal line abbreviations for a block of instruction.
We can say that the function which is used in c,c++ and java is macro.
On the other hand subroutine is called whenever necessary i.e, the control of execution is transferred to the subroutine appears only once in the complete progaram.
We can say that the Header files attached in c and c++ and libraries are are subroutine.
2.Macro not utilize the service of stack.But the subroutine utilize the service of stack.
3. Subroutine requires less memory space for execution than that using macro.
4.Macro requires less time for execution than that using subroutine.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are dml commands in abap?

650


Fallback class

1748


What is the significance of technical settings (specified while creating a table in the data dictionary) ?

588


How can we handle table control in bdc? : abap bdc

598


When the get cursor command used in interactive lists?

600






In sap script how to print bar code in vertical manner

2634


What are the different types of laws. What are they?

600


I created a field and entered the field type, when I double clicked the field type to define the domain; it is asking for an ACCESS KEY, I am not changing any SAP defined tables, working on a user defined table.

1357


What are local objects? : abap data dictionary

611


What are conditional chain statement?

751


What are the steps in creating screen ?

1469


What is the difference between leave transaction and call transaction?

615


What abap statement will trigger list generation?

627


Why do we use logical blocks in abap program?

1453


What is the difference between commit-work and rollback-work tasks?

659