10-10-2007 2:36 PM
Hi Guys,
Can anyone let me know how to debug the background job in ABAP.
Thanks in advance
peter
10-21-2013 11:36 PM
Follow the steps
Hope this helps.
10-10-2007 2:43 PM
In the code put
data l.
while L <> '1'.
endwhile.
at transaction sm50, you will see the process , select it and go to program / mode - > program ->debug.
10-10-2007 2:44 PM
Hi Peter,
the process would be vague but I used to do this for debugging any Background Jobs. You can create a Temporary Table. then you can update or insert values from the program to this table and varous location where you feel to check for values. once the proces is completed go to the table and check if the values entered there are correct if not you'll know the position where it has ended up with error so you can then fix it up.
Thanks,
Prashanth
10-10-2007 2:46 PM
Hi,
Goto SM37 and see the log if any is there and based on that you can check the code.
you can't debug background job.
Create a Variant for the Program and
Schedule JOB in background:
Go to SM36 create a Job
enter Program and Variant for that program in STEP..
click on Start Condition
Click on DATE and TIME enter date scheduled Start and END times
click on Period Values
Click on HOURLY/WEEKLY etc
CLick on RESTRICTIONS also to use further criteria.
so your job will be scheduled and run as per your requirement.
and in SM37 Transaction check the status of that JOB
Check this link for scheduling jobs..
http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm
Check this
http://jplamontre.free.fr/SAP/Debug%20background%20process.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/abap+debugger&;
Regards,
Padmam.
10-10-2007 2:50 PM
Guys,
Thanks for the quick replies.
We however are facing a problem. as wen fetching data into BI system trhough RFC call. BI logs into R/3 using ALEREMOTE and starts a job in background.
we tried endless while loop and debug the code through SM50 it didnt get into debugging. surprisingly system let me debug all dialog programs through SM50.
apart from writing values in table, is there any better way?
Thanks
Murali
10-10-2007 3:41 PM
The best way to do it is SM66, then click on "Debugging", this works for the various process thread types.
It usually depends if the program is at a point where it will support debugging (ie if it's spending minutes waiting for a return from the database, then the debugger has to wait as well)
Give that a try
10-21-2013 11:36 PM
Follow the steps
Hope this helps.
10-22-2013 3:23 AM
Hi Bog Peter,
if you want debug the background job then you have to create infinite loop in your programme.
Regards,
Rajesh
09-12-2019 7:26 AM
SAP has standard F'tn C160_HOLD_FOR_DEBUG which you can use in combination with Parameter ESN to create endless loop. If you set the User-Parameter ESN = 'X' (EHS: (developers only) = 'X': activate INC14Z_HOLD_FOR_DEBUG) then endless loop starts and via TRx SM50 you can get the process in debugging mode.
09-12-2019 7:47 AM
Hello,
As suggest by all above reach out to the required Job first.
Place the cursor on the Job and type JDBG in the command Bar.
Now once the Debugger screen triggers you will not find the relevant program for the Job. You have to pass through the initial Debugger screen by pressing F7 (Nearly 7-10 Times you have to press F7). The initial debugger screens are part of standard execution. keep pressing the F7 until you reach the desired program.
Cheers!!!
Satish
09-12-2019 1:09 PM
If you give the same answer as someone else, but maybe you want to add something constructive, probably it's better to just "comment" on the existing answer so that to complete it?