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
What are field groups?
How can cluster table be created?
Explain different types of attributes of function module?
what is the transaction transaction for setting parameters rdisp/buffermode
When was the sap abap being created?
What are the different types of operators in the sap abap?
What are the components in sap application server?
Difference between user exit and badis?
what is leave to TRANSACTION?
What is a report?
What is lock objects? : sap abap data dictionary
What is a table cluster? : abap data dictionary
Do you know any other patterns if yes.. explain
Explain what are the events in screen programming?
How to debug rfc function module?