cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging background jobs.

PrasadRaghavan
Employee
Employee
0 Kudos

Hi

Consider this piece of code.

SUBMIT zcall_function

USER sy-uname VIA JOB jobname NUMBER jobcount

WITH fun_name = 'ZMYFUNC'

AND RETURN.

The submitted job then further calls function ZMFYFUNC in background.

However, I need to debug this function module ZMYFUNC.

Can anyone help me in this situation.

It is also not possible to replace the above code by a simple call to function module ZMYFUNC due to certain requirements.

If I have to debug from the work-process level, how would I know, which app server this work-process has been sent to ?

Any other tips would be appreciated.

I would be glad, if someone can help me at the earliest.

Thanks

Prasad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

As already mentioned, you can debug the program from SM37. Another way to debug is via SM50. Select the process executing your program and go to menu Program/Session -> Program -> Debugging.

It is helpful to put a loop based on a variable which will keep executing untill you go into debug mode and change the value of the variable. This way you can ensure that you are able to debug the job exactly where you want to debug.

Hope this helps.

Raj

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Prasad,

use SM51 instead of SM50!

Viktor

PrasadRaghavan
Employee
Employee
0 Kudos

Hi Peter

Thanks for your help. Your approach worked.

Rajendra, tks to you too. However, i was not able to track the bkgnd work process from sm50 as I do not know to which app server it was sent to.

Thanks again. My problem is solved.

Prasad

former_member374
Active Contributor
0 Kudos

Hi Prasad,

Thanks for marking the answer as solved the problem.

Best, Mark.

Message was edited by: Mark Finnern

Peter_Inotai
Active Contributor
0 Kudos

You can debug batch jobs by going to 'SM37', select the active job and type in 'JDBG' in the command line ( no '/' )

Peter

Former Member
0 Kudos

hi peter,

indeed an interesting tip. thanks for sharing.

cheers,

Kelvin