Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to debug macro

Former Member
0 Kudos

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.

4 REPLIES 4

Former Member
0 Kudos

Hi,

debugging macro is not possible.

rgds,

bharat.

Former Member
0 Kudos

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>

Former Member
0 Kudos

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

Former Member
0 Kudos

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'.