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: 

debugging from background mode

Former Member
0 Kudos

Can anyone explain me how to bebug the program when it's been scheduled in background mode.

7 REPLIES 7

Former Member
0 Kudos

Pleaze try to use command JDBG( Job Debugging). Plenty of help and doc already on SDN. pls reward if useful.

Thanks

Ganesh.S

Former Member
0 Kudos

Hi,

It can be if for example a background job is triggered by another program. SO a foreground report triggers an event and a job is scheduled on event so when the event is triggerd the background job runs. This is useful for example in user exits where a commit work is required but not permitted.

To debug you need to capture the job. This is not always possible but if it is a custom program one option is to put a wait statement in temporarily.

Regards,

Sankar

0 Kudos

Hi

(SM37)

To debug an active job, choose Job -> Capture: active job". Only a single selection is allowed. If an active job seems to be running incorrectly (e.g., running for an excessively long time), you can interrupt and analyze it in debugging mode in a background process, and then either release it again or stop it altogether.

Note

You will be able to capture a background job only if you are logged on to the SAP server on which the job is running. To find server information in the Job Overview, select and mark the job, then choose Job ® Job details.

Or try like this

Step 1 : First put breakpoint in report..

Step 2: Goto transaction SM37

Step 3 : Select you job there

Step 4: Put JDBG in command field ( where we enter transaction - top left) and press enter.

Step 5: Now press F8 it will stop at break point which u created in report.

Check this links too

http://help.sap.com/saphelp_47x200/helpdata/EN/c4/3a8009505211d189550000e829fbbd/frameset.htm

http://help.sap.com/saphelp_47x200/helpdata/EN/c4/3a7ed1505211d189550000e829fbbd/frameset.htm

Reward all helpfull answers

Regards

Pavan

Former Member
0 Kudos

When report is executing in background, then you can debugg in SM50.

Just select the report name which is executing in background. Go to Menu Program/Session - > Debugging.

Former Member
0 Kudos

Hi,

Try to create endless loop in your program. go and check in sm50.

it will take you to debugging mode of abap prg.

Reward points. if any doubts plz feel free to ask.

Bohra

Former Member
0 Kudos

Hi,

In transaction SM50, you can choose the background process running this program and cleck the menu item Program/Mode --> Program --> Debugging...

If it is a Z-Program write an endless loop(at the start of the program) with an exit condition(which does not exit normally)...so that the background process will be stuck in this loop...Then choose debugging as mentioned...then change the exit condition correctly in debugging so that you are out of the endless loop...This is for making sure that the by the time you get to SM50 the execution is not over....

Regards,

Srinivas

Former Member
0 Kudos

Hi,

More vaugeness for my ealier ans is like this

.

DATA: c TYPE i VALUE 1.

WHILE c = 1.

  • BREAK-POINT.

ENDWHILE.

BREAK-POINT.

create endlessloop like this and go to sm50.

Dont forget to reward full points.

Regards,

Bohra.