2008 Aug 24 7:32 AM
Hi ABAP Gurus,
I m facing a strange problem in scheduling a background job for my report with a selection screen. I have a variant for the report.
I scheduled a job, but it seems to be not doing anything though all the system resources are available. The job overview shows "Acive" for the job. The job is neither stopping anything, it is just sitting there In SM50, the status shows "On Hold".
Any ideas/comments on the problem and how this can be overcome?
Qucik replies and solutions will be highly appreciated as this is a crucial part for a go-live project.
Thanks in advance.
Shivani.
2008 Aug 24 7:42 AM
Hi
Does your report need to any kind of interaction from the user Like do you need to fill any values in teh selection-screen elements or what can you let me know.
Make your JOB PRIORITY as 'A'
and let me know
Regards
Pavan
2008 Aug 24 7:42 AM
Hi
Does your report need to any kind of interaction from the user Like do you need to fill any values in teh selection-screen elements or what can you let me know.
Make your JOB PRIORITY as 'A'
and let me know
Regards
Pavan
2008 Aug 25 9:50 AM
Hi,
Please check in your code, like any indefinite loops are written. Because of that program may runnng without coming out of loop.
Regards,
Ashok
2008 Aug 25 7:43 PM
Yes. My report has a selection-screen which requires user input. But I have created a variant for the report and trying to run it in background using this variant. But facing this problem.
Strange thing is, instead of the usual SM36/SM37 option where we schedule and monitor background jobs, this option does not work for my report.
But I tried through SE38, and from my selection screen I selected "Schedule background job" and "run immediately" option, and this works. Though I still use SM37 to monitor this background job.
I have never faced such a situation before.
Any hints/tips why this happens and how this can be overcome in the future?
Thanks in advance.
Shivani.
2008 Aug 25 7:44 PM
2008 Aug 25 9:14 PM
Hi,
Run the program in foreground and check whether it is giving required output or not. If not, then debug the code step and step. If it run successfully in foreground, then scheduling and running job in background should not show any problem.
The main reason could be some lock used in the code or indefinite loop.
Thanks,
Kartavya
2020 Aug 17 12:48 PM
Hi Shivani, have you found out what was the catch? I have a similar problem with a program with two successive screens, with variants: foreground execution with a variant - no problem. Background execution with the same variant - running indefinitely. (When I briefly jumped into debug, I could see some standard SAP code running on).
2025 Feb 27 3:22 PM
Should anybody stumble into the same issue at some point: I did too, while trying to run a background job for a custom report.
SM50 process monitor continuously showing SAP standard programs being called, without ever coming to a stop.
I aborted the job and jumped into the debugger to get an idea what might goes sideways.
Within the report I used "CALL SELECTION-SCREEN" to call the screen. This appears to be a problem.
You probably want to use:
SUBMIT (zreport) USING SELECTION-SCREEN <scr_no> USING SELECTION-SET sy-slset AND RETURN.
sy-slset should contain the name of your variant.
I called it after START-OF-SELECTION. This (for some reason I still havent understood) ran into and endless loop. The report did what it was supposed to, but the job never ended and just repeated itself over and over.
Since it has been repeated within the same session, I just declared a global variable to mark "already been here, exit now".
I doubt that's the way it supposed to be handled, so feel free to complement this topic with constructive criticism but at least it works.
It's probably simpler to just use FM JOB_OPEN, SUBMIT and JOB_CLOSE to handle the Job interaction.