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: 

Detect DEBUG mode in ABAP code

Former Member
0 Kudos

Hi all,

Is there a way to detect that we are in DEBUGGING mode in ABAP code.

I need to determine this, because we have function modules that will be runned in a separate process in the background. If i could detect DEBUG mode, i could choose not to run these modules in the background, making debugging them possible.

Regards,

Rob.

1 ACCEPTED SOLUTION

andreas_mann3
Active Contributor
0 Kudos

Hi Rob,

use fm SYSTEM_DEBUG_BREAKPOINTS with your prog. (sy-repid)

regards Andreas

5 REPLIES 5

andreas_mann3
Active Contributor
0 Kudos

Hi Rob,

use fm SYSTEM_DEBUG_BREAKPOINTS with your prog. (sy-repid)

regards Andreas

0 Kudos

Hi Rob,

here's another (better as my 1st) possibility:

use structure ABDBG and have a look to that link:

<a href="http://www.abapforum.com/forum/viewtopic.php?t=97&highlight=debug+mode">debug mode</a>

regards Andreas

Former Member
0 Kudos

Hi Rob,

If you are in debug mode, then you will be doing an online execution of the program, isn't it? In that case, you can very well use the <b>sy-batch</b> variable.

I don't think there's a separate variable available to detect the debug mode.

Let me know if I have not addressed your problem sufficiently.

Regards,

Anand Mandalika.

Former Member
0 Kudos

When you debug a program that calls function modules using the IN BACKGROUND TASK addition, they are processed in a background work process (additional internal session). If you set the In background task: Do not process option, the system collects the function calls, but does not start the background work process. The Debugger assigns a transaction ID, which identifies the background work process uniquely. You can now start the Debugger for the background work process using transaction SM58. You can select the function module concerned here, and then execute it via the Edit menu.

http://help.sap.com/saphelp_47x200/helpdata/en/c6/617d0ce68c11d2b2ab080009b43351/frameset.htm

There is a system variable SY-DEBUG, not sure if it works, though.

Regards,

Subramanian V.

Former Member
0 Kudos

Hi all,

Thanx Andreas, your solution is simple and works very fine for me.

Also thanx to Poornanand (SY-BATCH is not usable here, because the actual program is a dialog program, but it will work for background processes)

and thanx to Subramania (SY-DEBUG does not work always, hence my question).

Regards,

Rob