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: 
Read only

Submit batch job daynamically using batch user id

Former Member
0 Likes
3,258

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

5 REPLIES 5
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,680

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 ?

Read only

Former Member
0 Likes
1,680

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.

Read only

adrian_dorn
Advisor
Advisor
0 Likes
1,680

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

Read only

0 Likes
1,680

Yes,,issue with authorization. I have tested with bsis profile id.

It is working. Thanks for your help.

Read only

0 Likes
1,680

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?