In this post let us see how we can debug the Background jobs in SAP.
To setup the jobs click here.
first setup the job as mentioned in the above link. Once the job is setup go to SM37. You should see the job that you setup in sm37. See the following screen shot.

Now the job is setup and not released.
Now select the job and enter JDBG in the command center with out /n. See the following screen shot.

Once you click enter press F7 until control goes to your Z code. This is important else you will have some issues.
* Cancelled jobs can also be debugged in this way.
But please keep in mind, this is no simulation. All updates, deletes or whatever else is done in this job will be executed !
Thanks to Sadananda Chinnahalli who provided this information. He is one of the best programmer that I know and very good knowledge in SAP.
in another way also we can debug a program running in back ground.
schedule a job in back ground and go to tcode – sm51 – we can find our respective job running there.
select the line item of our program – and go to main menu – you will find – PROGRAM / SESSION tab – select the same – you can go to DEBUG screen directly or even u can cancel the scheduled job.
regards
SG
Comment by srikanth — July 3, 2009 @ 4:12 am