Quantcast
Channel: ABAP Development
Viewing all articles
Browse latest Browse all 948

Single step debugging on Macro

$
0
0

Hi Friends,

 

I use a quite simple example to demonstrate:

 

clipboard1.png

 

Execute the report, debugger will stop at line 23.

 

Click this button:

 

clipboard2.png

clipboard3.png

 

The debugger will automatically show tab as below:

 

clipboard4.png

 

then we can execute the macro code one by one by clicking F5:

 

clipboard5.png

 

the line 22 and 23 just represent the ABAP code CHECK strlen(&1) >= 5.

We observed after macro line 22 and 23 are executed, our internal table lt is still empty. This is working as expected, since now the APPEND statement in Macro code is not executed yet.

 

clipboard6.png

 

The internal table is filled after Macro code 27 is executed.

 

clipboard7.png

 

before Macro code line 28 is executed, <first> is not valid, since the respective ABAP code READ TABLE &2 ASSIGNING <first> INDEX 1. in line 14 is not executed yet.

 

clipboard8.png

 

click F5, now <first> is filled.

 

clipboard9.png

 

After Macro code 33~35 is executed, the string concatenation is done.

 

clipboard10.png

 

Although you can debug Macro this way, it does not mean you should not think twice when you use Macro in your code. There are already plenty of discussion in SCN regarding how to use Macro wisely. Hope this blog helps you when you have to debug some complex Macro in legacy code.


Viewing all articles
Browse latest Browse all 948

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>