What is the difference between macro and subroutine?

Answer Posted / paramjeet

Macros can only be used in the program the are defined in
and only after the definition are expanded at compilation /
generation. Subroutines (FORM) can be called from both the
program the are defined in and other programs . A MACRO is
more or less an abbreviation for some lines of code that are
used more than once or twice. A FORM is a local subroutine
(which can be called external). A FUNCTION is (more or less)
a subroutine that is called external. Since debugging a
MACRO is not really possible, prevent the use of them (I?ve
never used them, but seen them in action). If the subroutine
is used only local (called internal) use a FORM. If the
subroutine is called external (used by more than one
program) use a FUNCTION.

Is This Answer Correct ?    61 Yes 36 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you use structures in the abap programs?

533


How do you import pay scale data from non sap to sap? : sap abap hr

573


Give few names of pooled tables in sap ?

1498


How to specify a client for database table processing?

613


What is the step-by-step process to create a table in data dictionary? : abap data dictionary

684






Describe data classes? : abap hr

625


Have you processed BDCs ?

624


What does a lock object involve?

660


What are interactive reports?

631


In ALV reporting when u execute your report which event gets triggered.

1628


What are the types of windows in sap script?

605


How to add a column to a table control while using alphanumerical layout editor ?

1782


Explain the difference between a dialog program and a report?

546


What is meant by write lock? : sap abap data dictionary

582


What are the different types of locks? : abap data dictionary

623