How to achieve conditional break point in your ABAP program

简介: Background

有不同的同事问我这个问题:例如LOOP要执行1000次,我只对其中的某一次比如第501次循环感兴趣,我肯定不可能按500次F5.或者我只对 LOOP里某个变量为某一个具体值的那一次循环感兴趣。如果避免重复按F5, 而是让断点直接停在我想停的condition上面?

image.png

其实有三种方法实现。

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 = 22.

其实有三种方法实现。

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 = 22.

image.png

Maintain your condition as below:

image.png

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

image.png

Approach2 - Watchpoint

image.png

image.png

Then:

image.png

Approach3 - ABAP debugger script

Create a new debugger script:


image.png

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

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


image.png

Now launch your program, load the saved Script:

image.png

Then click Start Script:

image.png

Break point is triggered only once:


image.png

相关文章
|
1月前
|
存储 数据处理 开发者
ABAP 如何把 unicode 代码点转换成字符
ABAP 如何把 unicode 代码点转换成字符
19 0
|
6月前
|
存储 语音技术 UED
如何用 ABAP 代码进行文本转语音的输出工作
如何用 ABAP 代码进行文本转语音的输出工作
36 0
|
17天前
|
存储
使用 ABAP 代码打印出 SAP CRM 系统里所有维护了 Sales Area 的 business partner id
使用 ABAP 代码打印出 SAP CRM 系统里所有维护了 Sales Area 的 business partner id
19 0
|
2月前
|
SQL 数据库
小技巧:如何让 ABAP OPEN SQL 代码具有自解释性(Self-Explained)
小技巧:如何让 ABAP OPEN SQL 代码具有自解释性(Self-Explained)
25 0
|
1月前
|
BI
工具分享 - 将一个 ABAP Function Group 内所有 Function Module 按照代码行数从高到低排序并显示试读版
工具分享 - 将一个 ABAP Function Group 内所有 Function Module 按照代码行数从高到低排序并显示试读版
15 0
|
1月前
|
存储
ABAP 代码从十进制转二进制的方法
ABAP 代码从十进制转二进制的方法
21 0
|
2月前
|
XML 持续交付 开发工具
SAPGUI 里 ABAP 代码导出成 PDF 格式的隐藏小技巧
SAPGUI 里 ABAP 代码导出成 PDF 格式的隐藏小技巧
27 0
|
2月前
|
XML 数据格式
使用 ABAP 代码将 Word 文档设置成只读
使用 ABAP 代码将 Word 文档设置成只读
22 0
|
3月前
小技巧分享:如何使用动态断点快速找到成对的 ABAP 内存 IMPORT 和 EXPORT 的代码位置
小技巧分享:如何使用动态断点快速找到成对的 ABAP 内存 IMPORT 和 EXPORT 的代码位置
23 0
|
3月前
答知识星球朋友疑问:执行 ABAP 代码出现超时的原因,背后的理论和解决方案试读版
答知识星球朋友疑问:执行 ABAP 代码出现超时的原因,背后的理论和解决方案试读版
17 0