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: 

Programatically releasing a background job by passing authorization.

former_member215563
Active Participant
0 Kudos

Hi Experts,

I have a requirement wherein  the End users will have to run a report in background mode because the amount of data is high.

The issue that im facing here is that the end users can schedule a background job but don't have the authorization to release it,

We also cannot assign the authorization to the end users.

So, Could there be a workaround where I can handle it programatically. i.e. If the end users execute that report in background ,we

can schedule and release the report programatically using some others username who has the access/authorization??

Please provide me your valuable inputs.

Thanks,

Faiz

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

You could create a periodic job that get the list of unreleased jobs and modify/release them depending on your exact requirement (Background Processing, Programming with the Background Processing System (BC-CCM-BTC), Background Processing Function Modules.)

Regards,

Raymond

0 Kudos

Hi Raymond ,

As per your suggetsion Im trying to execute it in backround however Im getting an error : Maximin number of internal session reached.This possible is due to the recursice calling of the program by itself. How do I handle this.

SUBMIT (sy-cprog)

         WITH s_matnr IN s_matnr

         WITH s_attr IN s_attr

         WITH s_date IN s_date

         WITH s_time IN s_time

         WITH s_crby IN s_crby

         WITH s_chdby IN s_chdby

         VIA JOB gv_job NUMBER gv_count AND RETURN

         TO SAP-SPOOL WITHOUT SPOOL DYNPRO

         DESTINATION sy-pdest

         IMMEDIATELY lc_x

         KEEP IN SPOOL lc_x.

         CALL FUNCTION 'JOB_CLOSE'

           EXPORTING


Thanks

Faiz

0 Kudos

Faiz

A simple option can be you define a parameter on selection screen with no-display and when you are scheduling your program via submit simply pass this as X and when you get X just skip this call.

Out of curiosity you are scheduling the same program in background?

Nabheet