07-31-2007 8:14 AM
Can anyone explain me how to bebug the program when it's been scheduled in background mode.
07-31-2007 8:18 AM
Pleaze try to use command JDBG( Job Debugging). Plenty of help and doc already on SDN. pls reward if useful.
Thanks
Ganesh.S
07-31-2007 8:20 AM
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
07-31-2007 8:24 AM
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
07-31-2007 8:21 AM
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.
07-31-2007 8:24 AM
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
07-31-2007 8:25 AM
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
07-31-2007 8:28 AM
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.