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: 

Enqueing of Report Failed

Former Member
0 Kudos

Hi, I have a requirement in which simultaneous runs of the same Report should not allowed. For this, I have enqued the report using 'ENQUEUE_EWA_REPID'. When i run the report in background and wait till the spool icon appears, after which run another instance of the report, it runs. The first job is still active but the lock entry from sm12 is cleared. Can anyone please suggest the reasons for this or any other methods which can be used to avoid simultaneous runs.

1 ACCEPTED SOLUTION

koolspy_ultimate
Active Contributor
0 Kudos

Hi,

Check this out [Click here|;

Regards,

koolspy.

9 REPLIES 9

Former Member
0 Kudos

Hi,

If you are using the FM JOB_CLOSE in the report to start the BG job, then you can make use of the import parameters

PRED_JOBCOUNT or PRED_JOBNAME to avoid simultaneous runs.

0 Kudos

Hi Srikanth,

Thanks for the reply. The report is not using the function module as the job is not scheduled in the report. User does it manually. Is there any other way to lock the report?

0 Kudos

Hi,

You can control this while specifying the start condition of a background job in SM36. SM36->Start Condition-> After Job -> Give the Job after which this job should start and check the checkbox 'Start- status dependent'...hope this satisfies your requirement.

koolspy_ultimate
Active Contributor
0 Kudos

Hi,

Check this out [Click here|;

Regards,

koolspy.

0 Kudos

Hi Koolspy,

Thanks for the reply. I am currently enqueing a z table as well as the report at the beginning of the report. But in background run once the spool icon appears(job is still active), both the locks are cleared and duplicate runs are happening.

0 Kudos

But in background run once the spool icon appears(job is still active), both the locks are cleared

Can you specify what is the [_SCOPE|http://help.sap.com/abapdocu_702/en/abensap_lock.htm] param you've used while locking?

BR,

Suhas

0 Kudos

Hi Suhas,

I have not supplied any value for that parameter. So, for enque:2 and deque:3 are taken as default. Will any other value of _scope resolve the issue?

0 Kudos

Hello Varsha,

As you've mentioned that locks are getting released automatically after the spool is generated, i've a feeling that some implict COMMIT is being triggered. Read the SAP documentation on the _SCOPE param to understand it's significance

Cheers,

Suhas

0 Kudos

Thanks Suhas.. That solved the problem! I set the _scope as 1