‎2010 Jun 04 11:35 AM
Hi,
I need to submit the background job dynamically from ABAP program with BATCH user id.
I have created new program. Users will execute program in foreground.
Had issue with USER id. If I give my user id then batch job successfully creating. If I give u2018BAICHu2019 id then it is giving the error.
Am I doing any thing wrong here?
Code:
Open Job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = w_jobcount.
SUBMIT zrufilep WITH p_file1 = sourfile
WITH p_file2 = destfile
VIA JOB jobname NUMBER w_jobcount
USER 'BATCH_FI'
AND RETURN.
Schedule and close job.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_jobcount
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit.
Thanks
‎2010 Jun 04 11:41 AM
What is the error you are getting ? Anyways does the user 'BATCH_FI' exist in your system, if yes does it have the reqd. authorizations ?
‎2010 Jun 04 11:48 AM
Yes, ID existed in system.
The SUBMIT statatment returning sy-subrc '8' means 'Error during scheduling, i.e. when accessing JOB_SUBMIT internally'.
I have tried not only with 'BATCH_FI' id, tried with other ids also who have all authroizations.
If i execute the program with BATCH_FI (Login with BATCH_FI) then its working fine.
‎2010 Jun 04 2:57 PM
This could be an authorization issue: To submit jobs for others users a special authorization is required (Batch-Administrator-Authorization). For your own user this authorization is not required, which would explain why you program does work for your own user but not for others ==> Check if you have got the Batch-Administrator-Authorization (S_BTCH_ADM).
‎2010 Jun 04 8:06 PM
Yes,,issue with authorization. I have tested with bsis profile id.
It is working. Thanks for your help.
‎2014 Oct 16 7:09 AM
Can any body tell me if that authorization is given to the user, can he submit any other job from front end?
As you can see if he can, it will conflict security issues of business. So If he is not permitted to execute these kind of statements in any other program, would he be confined to using diff user in this program only?
Or is there any other way-out to confine the user for getting this authorization for a single T-code or such?