Application Development and Automation 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: 
Read only

Do something extra when debugging

rosenberg_eitan
Active Contributor
0 Likes
1,639

Let assume that we want to do something extra in case of debugging.

I found out that I can use cl_abap_debugger:

DATA: it_breakpoints_complete TYPE breakpoints_complete .

  cl_abap_debugger=>read_breakpoints( IMPORTING  breakpoints_complete = it_breakpoints_complete ) .

  IF it_breakpoints_complete IS NOT INITIAL . 

  * do something extra.....

  ENDIF .

I just add a break point to the program and it is working .

Is there a better way of doing this ?

Thank for any feed back .

8 REPLIES 8
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,604

As IF SY-DEBUG IS NOT INITIAL ?

Regards,

Raymond

Read only

0 Likes
1,604

Thanks .

I will check.

Regards.

Read only

0 Likes
1,604

Hi,

What needs to be done so the system will put something in SY-DEBUG ?

Regards.

Read only

0 Likes
1,604

DEBUG is internal use, can`t be read in ABAP program. I like your solution.

Regards,
Archer

Read only

0 Likes
1,604

Thanks.

I found about it only this morning and I like to know if someone has tried it in production system .

I want to reduce the chance of potential problems if I can.

Regards.

Read only

Clemenss
Active Contributor
0 Likes
1,604

Hi,

will it find hard-coded or 'soft' session break points?

Regards,

Clemens

Read only

0 Likes
1,604

Hi,

This is my only  test :

Regards.

Code:

*&---------------------------------------------------------------------*

REPORT z_r_eitan_test_30_01.

INITIALIZATION.

  PERFORM at_initialization .

*----------------------------------------------------------------------*

FORM at_initialization .

  DATA: it_breakpoints_complete TYPE breakpoints_complete .

  cl_abap_debugger=>read_breakpoints( IMPORTING  breakpoints_complete = it_breakpoints_complete ) .

  IF it_breakpoints_complete IS NOT INITIAL .

  ENDIF .

ENDFORM .

*----------------------------------------------------------------------*

Read only

Former Member
0 Likes
1,604

both will return value from that method. i just test it.

regards,

Archer