05-28-2007 2:31 PM
Hi all,
How to know whether the macro is executing or not. i mean the call fucntion
define lmacro_unlock_current_record.
call function 'MYFUCTION'
exporting
document = ls_document
umber = ls_number.
end-of-definition.
05-28-2007 2:33 PM
05-28-2007 2:35 PM
hi,
this is from help
As a rule, you should use subroutines (FORM, FUNCTION)
instead of macros. This is because subroutines - unlike
macros - are supported by all of the ABAP Workbench tools
<b>(debugging, runtime analysis, runtime error handling, ...).</b>
05-28-2007 2:42 PM
Hi
not possible (Unless you use a perform in your macro)
You cannot debug MACRO's you cannot set any break points in the MACRO and debugger will not go into the MACRO it just treats it as a statement.
USE INCLUDE programs instead you cn set breakpoints in includes.
Regards
Tushar Mundlik
05-28-2007 3:09 PM
Hi priyanka,
Just like ABAP classes, we need to declare objects for the macro.
look at the small macro example.
REPORT ZMACRO.
DATA: RESULT TYPE I,
N1 TYPE I VALUE 5,
N2 TYPE I VALUE 6.
DEFINE OPERATION.
RESULT = &1 &2 &3.
OUTPUT &1 &2 &3 RESULT.
END-OF-DEFINITION.
DEFINE OUTPUT.
WRITE: / 'The result of &1 &2 &3 is', &4.
END-OF-DEFINITION.
OPERATION 4 + 3.
OPERATION 2 ** 7.
OPERATION N2 - N1.
If you set break point at 'operation 4 + 3' line, we can check, how macro is working according to the values passed to macro object. Here 4 is passed to &1, '+' is passed to &2, 3 is passed to &3. Once the processing of statement 'result = &1 &2 &3' is over,result get the value of 7.
The line OUTPUT &1 &2 &3 RESULT itself calls the output macro.In the out put it prints as 'The result of 4 + 3 is 7'.