10-21-2019 11:31 AM
How to debug a long running job ? is there any way ? yes. I am aware that we can debug via JDBG command in SM37. My issue is we have a program which runs for an hour or two. We are getting an error message after an hour of job execution.
If i give JDBG and press F8 debugger gets timed out in 10 minutes. I also thought of placing breakpoints in multiple intermediate places so that debugger will not time out, but there are few loops in standard program which takes more than 10 minutes to execute due to huge volume of data.
Is there any suggested way to do this ?
10-21-2019 11:36 AM
is it possible to run this program/job on development? Because then you might insert an endless loop at the point you would like to debug (after these loops you are talking about). The endless loop you can catch in SM50. And do not forget to remove the loop afterwards....
10-21-2019 11:42 AM
b.wallagh Thanks a lot for your response. Issue is in quality system. Process team is not able to replicate the issue in Dev system so we are not able to do this. Kindly let me know if any alternatives are there. Thanks for your time.
10-21-2019 11:50 AM
Hello,
As far as I know there is no other way to avoid long running jobs timeouts than debugging and setting breakpoints. for the long loops you can set intermediate breaks by settnig break point condition for different sy-tabix.
Also if the error is not due to the data size, you can reduce the data size by running the program for smaller scopes untill identifying which scope is triggering the error.
Also you can analyze the error or the dump.
Hope this is help.
Regards,
Yassine
10-22-2019 6:22 AM
Thanks for your response. I understand this. If we do this way, it takes more than an hour to reach the point where i need to debug. Hence, thought of asking the experts for alternate thoughts.!
10-22-2019 2:21 PM
Can you post the ST22 screen shot. As yassine.nejmy2 said you can reduce the size of internal table, may be you can take 10 records from internal table and analyze the issue.
10-21-2019 8:28 PM
SM50 or SM66, select the BGD workprocess corresponding to your job, menu Administration -> Program -> Debugging. Sometimes it doesn't work because in the middle of a database operation, or other reasons.
10-22-2019 2:02 PM
Could you perhaps give some information about the program? What is it processing, also what is the error you receive? Is it a dump in ST22, or is it a message from a message class? Maybe we can help out in that way
10-24-2019 2:49 PM
SM50 -> Debugging of running Job
You can Close Debugger any time and Programm continues
and you can reenter Debugger as you wish.
regards Stefan
10-24-2019 3:19 PM
Here is something else you can try to at least narrow down where the issue happens:
Go to SM50 to make sure that you are looking at the server where your long-running batch-job is getting executed. From there go to transaction SAT (performance analysis) and make use of the "Run in parallel session":
There you can switch on the measurement:
Count to e.g. 10 and switch it off again:
If SAT was able to capture anything during the time it was active, the measurement will be opened straight away and you can check it out.
Note: You have to make sure to be on the server the process is actually running on. One option which usually works for me is to first go to SM50 (possibly via SM51) to find out which server it is and then open a new session for SAT from there. Or, use the "Server Selection" button to find the correct one from within SAT.
To begin with, you shouldn't have the measurement active for more than a few second (hence "counting to 10") as the log can get pretty big very quickly!
If you are not familiar with what all you can do with SAT, please check Olga Dolinskaja's blog series about this very neat transaction:
Next Generation ABAP Runtime Analysis (SAT) Introduction
Hope this helps!
Cheers
Bärbel