Application Development and Automation 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: 

Background processing for ABAP report with selection screen

Former Member
0 Kudos
806

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.

1 ACCEPTED SOLUTION

bpawanchand
Active Contributor
0 Kudos
433

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

7 REPLIES 7

bpawanchand
Active Contributor
0 Kudos
434

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

0 Kudos
433

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

0 Kudos
433

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.

0 Kudos
433

I have no indefinite loops in my program.

Thanks,

Shivani.

Former Member
0 Kudos
433

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

0 Kudos
433

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

Jostp
Newcomer
0 Kudos
116

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.