‎2015 Aug 20 11:02 AM
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
‎2015 Aug 21 9:07 AM
‎2015 Aug 20 11:30 AM
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
‎2015 Aug 20 11:36 AM
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
‎2015 Aug 20 11:00 PM
Hi Roman,
Apart from the class approach suggested, you can also check for FMs in Function Group SDBG.
Thanking You All..!!
‎2015 Aug 21 2:36 AM
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.
‎2015 Aug 21 7:56 AM
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
‎2015 Aug 21 9:07 AM