Quantcast
Channel: SCN : Blog List - ABAP Development
Viewing all articles
Browse latest Browse all 943

Three ways to achieve conditional break point in your ABAP program

$
0
0

Let's use the simple program below.

 

Line 15 will be executed 1000 times. And we are only interested with a given iteration, for example we want to ONLY stop at line 15 with condition <data> = 22.

clipboard1.png

Approach1 - Source code breakpoint in ABAP debugger

 

Create a new breakpoint in debugger dynamically:

clipboard1.png


Maintain your condition as below:

clipboard2.png

And then you should see this new conditional break point set in line 15:

clipboard3.png

Then F8 to continue, the break point is triggered only once when <data> = 22.

clipboard4.png

Approach2 - Watchpoint

clipboard5.png


clipboard6.png

You should see your created watch point here:

clipboard7.png

Execute program, watch point is triggered:


clipboard8.png

clipboard9.png

Approach3 - ABAP debugger script

 

Create a new debugger script:

clipboard1.png

Click "Script Wizard"->"Variable Value(for Simple Variable)":

clipboard2.png

The wizard will generate code automatically for you ( marked with red ). You can finish the left code to achieve conditional break( marked with blank ). Save your script with a name.

clipboard3.png

Now launch your program, load the saved Script:


clipboard4.png

Then click Start Script:

clipboard5.png

Break point is triggered only once:

clipboard6.png


Viewing all articles
Browse latest Browse all 943

Trending Articles



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