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: 

call the debugger through abap coding

Former Member
0 Kudos

Hi,

Is it possible to call the debugger through abap coding

and pass him a program name (which has to be debugged)

let him stepping through the program code (each line, single step).

Thanks

Alex

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Alexander,

You can put the instuction BREAK-POINT just before the program that you want to debug and then you could use the debugger as usual.

Another way is to set a break-point at the beginning of the program being called and then when you entered in this program the debugger will be launched.

You can also have a look to such FM like RS_SET_BREAKPOINT which can add dynamically breakpoints.

Hope it will help!

Samuel

12 REPLIES 12

Former Member
0 Kudos

Hi Alexander,

You can put the instuction BREAK-POINT just before the program that you want to debug and then you could use the debugger as usual.

Another way is to set a break-point at the beginning of the program being called and then when you entered in this program the debugger will be launched.

You can also have a look to such FM like RS_SET_BREAKPOINT which can add dynamically breakpoints.

Hope it will help!

Samuel

Former Member
0 Kudos

Samuel I must start debugger via abap and pass him a report name. This is what I am needing

0 Kudos

Yes I have understood what you need, but if you put such code :


REPORT z_debug.

START-OF-SELECTION.
  ...
  BREAK-POINT.
  SUBMIT your_other_program.

  ...

it should meet your requirement, except that you start the debugger just before entering in your other program, isn't it?

Samuel

matt
Active Contributor
0 Kudos

>

> Samuel I must start debugger via abap and pass him a report name. This is what I am needing

Perhaps if you explained why you need to do this, you'd get more targetted answers.

matt

AlexanderOv
Participant
0 Kudos

Hi,

try this code

 
SY-DEBUG = 'Y'.
SUBMIT Z_YOUR_REPORT.

Former Member
0 Kudos

hi alexander,

there are many ways to call the debugger

1. goto your program which you want to execute.

before executing write/h on the transaction command box.in this method debugger will be called from start of the program from 1st line

2. in the program put command break-point,where you want your debugger to be started.

3. in the program put the debugger button,those are at the top in application tool bar.

so you can call the debugger in these many ways.now u have to decide whats ur requirement and how u need to call the debugger.hope this will help you.

Thanks

Tanmaya

0 Kudos

hi all,

I guess its more clearly to you.

How can I pass to the programm RSTPDAMAIN any Reportname or Programname.

I've started some experiments, but unfortunately without success.

Regards

Alex

Edited by:

0 Kudos

Hi,

You can try with below FMs.

CALL FUNCTION 'RS_GET_BREAKPOINTS'
    EXPORTING
      program         = po_progname
      http_debugging  = space
    TABLES
      showbreakpoints = i_allbreakpoints.

  CALL FUNCTION 'SYSTEM_DEBUG_SET_BREAKPOINTS'
    EXPORTING
      main_program          = p_prog(40)
*    flag_system_debugging = abap_undefined
*    flag_exception_object = abap_undefined
    TABLES
      breakpoints           = i_breakpoints
    EXCEPTIONS
      too_many_breakpoints  = 1
      generate              = 2
      bp_position_not_found = 3
      c_call_error          = 4
      OTHERS                = 5.

In I_breakpoints you need to pass the program name and line number.

Thanks,

Vinod.

0 Kudos

Vinod thx your reply was very helpful.

Usually when you are debugging you can see on the rightside 4 tabstrips. Variable1 Variable2 Locals Globals.

Do you know a way how can I access the values directly.

DYNP_VARS-WA_GLOBAL-VARNAME and DYNP_VARS-WA_GLOBAL-VARVALUE

The Programname is SAPLSTPDA_TOOL_QUICK_VARS

FunctionPool STPDA_TOOL_QUICK_VARS

Regards

Alex

0 Kudos

Hi,

Recently i have seen similar requirement posted in SCN. Some one has suggested some class to get the run time attributes some thing similar to CL_ABAP_CLASSDESCR. Can you do a search and find out in SCN. Also try to search in SE24 with CLDEBUG.

But during debugging you already have the data in the variables right?

Thanks,

Vinod.

0 Kudos

Hi Vinod

you said:
but during debugging you already have the data in the variables right?

Yes, but I need them because I want to save a text file directly from ABAP program with these

values of variables.

How can I do that ?

Regards

Alex

Former Member
0 Kudos

Thank you for your active help, I will try to achieve the req with these answers