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: 

how to debug the background job

Former Member
0 Kudos

Hi All,

one zreport is there for that background job is scheduled , now it is in production ......... in production database level the values are not properly stored,

i hope we need to check the validataion .. for that i want to debug the zreport but it is scheduled in backgroud job ..

how to Debug the zreport which is having background job?

14 REPLIES 14

venkateswaran_k
Active Contributor
0 Kudos

Hi

JDBG - Job Debug

This is basically for the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job and sy-batch set to 'X'.

  • Use SM37 to get list of jobs, put the cursor on the job, type JDBG in the command line ( without '/' ), and press ENTER
  • You are in debug mode now.
  • Step through SAP program (press F7 couple of times) until you get to code you need.

Regards,

Venkat

0 Kudos

Thanks Venkat

You just taught me something new as well.

Once again thanks for sharing

Regards

Vic.

0 Kudos

Hi venkateswaran,

Thank u very much, first i execute the job then it is showing the 'CANCEL'  the job? why ? what is the process

0 Kudos

Can you paste teh screen shot..

If you press F7 is it continuing?

0 Kudos

'no job matches the selection criteria'

this message is coming

0 Kudos

In SM37, for listing of jobs, it is based on User Id.

Confirm which user scheduled the job

Secondly, make sure that you selected the job in the checkbox.

Thirdly, make sure JDBG in teh command line and Press Enter.

then Execute..

It shoudl work

Regards,

Venkat

0 Kudos

Hi,

ABAP Program Name :  ?

in this input box , whether it is zreport program name other wise is there any thing else we need to give?

0 Kudos

Hmm

In SM37

-- Type * in the User ID

- Type * in Job Name

Exeture....

It will display all the Jobs....

Select your Job and check the check box

Then JDBG in command line and Enter

Press  Execute Again

0 Kudos

HI,

if i execute the  background job more times is there any problem?

0 Kudos

Dependent on your program checks it might create duplicates...

Former Member
0 Kudos

Hi

Unfortunately as far as I know you cannot debug a background job...Unless the background job fails or has errors then you can take a look at SM35. You can however run the app in foreground and debug it that way, this should give you your error. I would suggest you rather try doing the error tracing in your quality system and not on Production though, of course taking into account that the patch levels are the same on both systems and the quality system has the same version of the program.

If you could maybe give us a bit more info as to your problem that would help as well.

Regards

Vic

Former Member
0 Kudos

Hi

   You can debug Background Job from SE37 after job is finished by using JDBG command...

The same is discussed here:

http://scn.sap.com/thread/185784

Regards

Srinivas

Former Member
0 Kudos

Hi,

To debug a job in background :

Stage 1:

goto sm37-> select job -> press F2 then job details button and check the WP/PID number of job.

Stage2:

Return back to SM37 -> select job -> press F9 -> select the PID number of the processes currently running -> at top select Program/Session -> Program (2 options : Debugging / cancel ) -> select debugging.

It will allow you the debug the program which is running as a background job. This will be similar to how we debug foreground jobs but the control will goto place where the job was already executed.

This is helpful when the job is running which i think is your case.

JDBG works when job is finished.

If you know of the program name and process then you can directly avoid first stage and goto debugging by selecting the correct process.

Hope this helps!!!

matt
Active Contributor
0 Kudos

Frequently Asked Question. Locked.