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

Is it possible to run host command from SAP environment? How do you run?

608


how to use table control?if suppose i have 6 records and i want more 4 records in sequence.How to handle this scenario?

1570


Explain the types of bdc's?

593


What are differences between at selection-screen and at selection-screen output?

767


Explain the table, which contain the details of all the name of the programs and forms?

511






Setting up a BDC program where you find information from?

655


any one can tell me which is the tables can store in ddic plese dont say db02l,please give me different ways of resideing the tables ?

1978


In sap script how to print bar code in vertical manner

3437


Explain the use of insert and append statement in sap abap?

584


What is going life actually? What is the role of a functional consultant in it? : sap abap hr

546


What is pnp-sw-found ? : abap hr

861


What do you understand by work area and internal tables in abap? Why do we use it?

606


What are internal tables? How to use a specific number occurs statement?

562


identify valid statement when coding a field exit ? a) submit RSCA101X b)MESSAGE E101 C)MESSAGE I101 d)BREASK-POINT

1912


How did you transfer legacy data in the mid of the financial year (us) to the sap system? : sap abap hr

536