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: 

Debug Long running job ?

0 Kudos

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 ?

9 REPLIES 9

former_member259807
Active Participant
0 Kudos

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....

0 Kudos

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.

yassine_nejmy2
Explorer
0 Kudos

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

0 Kudos

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.!

0 Kudos

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.

Sandra_Rossi
Active Contributor
0 Kudos

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.

YorRombaut
Participant
0 Kudos

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

former_member220028
Active Contributor

SM50 -> Debugging of running Job

You can Close Debugger any time and Programm continues

and you can reenter Debugger as you wish.

regards Stefan

BaerbelWinkler
Active Contributor

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