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

Former Member
0 Kudos

Hello,

i have written a singleton class for measuring the runtime of different parts of our programs.

It gets timestamps before and after some routines, calculates the runtimes and logs the results in a DB table.

My problem is: if someone would debug these parts of coding, the calculated runtime would be by far way longer then the real runtime, since the program has to wait for the developer.

Now i would need a way to find out if the DEBUG mode is on, so i can avoid these wrong results to be loged.

I already tried using the structure 'ABDBG', using it like shown in the following piece of code:

TABLES: abdbg.

IF abdbg-syrepid IS NOT INITIAL.

     " DEBUG mode is on !
ENDIF.

Unfortunately this doesn't work for me because of 2 reasons:

- the "TABLES" declaration cannot be used in classes

- even if i use this coding in a Test-Report, the structure 'ABDBG' is existent but INITIAL.

Anyone can give me some ideas for solving this problem?

Thank you in advance for any hints.

With best regards

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Did you try good old TH_GET_DEBUG_INFO (many system functions are available thru the FM of the TH* name range)

Regards,

Raymond

6 REPLIES 6

Former Member
0 Kudos

HI

The breakpoints set in the program can be determined with the help of the class CL_ABAP_DEBUGGER.

Kindly check whether the read methods are helpful.

Regards,

Vasanth

former_member216168
Active Participant
0 Kudos

Hello

It's initial because TABLES statement it's same as declare a work-area, but with table name.

Try to check this link:

reading and saving break points programatically - Code Gallery - SCN Wiki

Former Member
0 Kudos

Hi Roman,

Apart from the class approach suggested, you can also check for FMs in Function Group SDBG.

Thanking You All..!!

raphael_almeida
Active Contributor
0 Kudos

Hi Roman,


I've been reviewing your case here and thought about the case of creating events in this class, if triggered, it would interrupt the count.


Have you tried to use it?


Warm regards,


Raphael Pacheco.

Former Member
0 Kudos

Hello everyone,

thank you so far for your answers. I'll take a closer look on each hint in the next days!

With best regards

raymond_giuseppi
Active Contributor
0 Kudos

Did you try good old TH_GET_DEBUG_INFO (many system functions are available thru the FM of the TH* name range)

Regards,

Raymond