12-01-2015 1:32 PM
Hello Experts,
We have scheduled a Back Ground Job using below FM's
JOB_OPEN,
JOB_SUBMIT,
BP_JOB_READ,
BP_JOB_MODIFY,
JOB_CLOSE
now the issue is,Job is getting created and scheduled successfully, but its not getting released, can some one suggest whether its an Authorization Issue or some other issue in the code and what needs to be done here to resolve it?
Thanks in advance..!!
Regards,
Dilli.
12-01-2015 3:07 PM
Which parameters did you provide to JOB_CLOSE, did you catch every exception raised by FMs?
Hint: Look at SAP provided samples in Background Processing / Programming with the Background Processing System (BC-CCM-BTC) - Scheduling a Job: Full-Control Method.
Regards,
Raymond
12-01-2015 3:07 PM
Which parameters did you provide to JOB_CLOSE, did you catch every exception raised by FMs?
Hint: Look at SAP provided samples in Background Processing / Programming with the Background Processing System (BC-CCM-BTC) - Scheduling a Job: Full-Control Method.
Regards,
Raymond
12-01-2015 3:23 PM
Yes Raymond,
We have caught all the exceptions from every FM, we didnt get any Exceptions for any FM,i mean we got the value of Sy-subrc as 0 for all the FM's.
Below is our code for JOB_CLOSE FM. Job is getting Scheduled, but not getting Released.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = number
jobname = name
strtimmed = 'X'
IMPORTING
JOB_WAS_RELEASED = w_released
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
Kindly help if we need to do some code change to get the JOB released OR
suggest if its an issue with below Authorization Objects ?
S_BTCH_NAM
S_BTCH_ADM
S_BTCH_JOB: Action=RELE
Regards,
Dilli.
12-01-2015 3:38 PM
Can you release any JOB manually via SM36? Check for Authorization issue also via SU53/SU24.
12-01-2015 4:05 PM
12-02-2015 12:53 PM
Did you execute SU53 or a trace of authorization thru ST01?
Hint: Did you 'play' with some user name not equal to actual user or this is the first time this user schedule ajob, in this case check value returned in JOB_WAS_RELEASED, if not equal to 'X' current user isn't allowed and an admin should release the job. (Read documentation of the returned parameter)
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSEIF l_released = space.
MESSAGE s157(oiucm).
ENDIF
For info
We have caught all the exceptions from every FM
A long time ago, an exception was triggerd, CANT_START_IMMEDIATE, exception which has been replaced by the export parameter...
Regards,
Raymond
12-02-2015 12:37 PM
Hello,
why do you do BP_JOB_READ and BP_JOB_MODIFY before JOB_CLOSE?
You should be able to control all job attributes using OPEN,SUBMIT,CLOSE
Maybe whatever you do with MODIFY has something to do with it...
Regards,
Alex
12-02-2015 5:26 PM
Hi Raymond,
Actually USER who is not the main User(user with all authorizations) is an END USER, so the Back ground Job Scheduling authorizations can't be given to this user( confirmed the same with SECURITY team),so we have coded as below.
When calling the Job_Submit FM we are passing USER2(who have all the authorizations) to EXPORTING parameter authcknam as this is the parameter where authorization is checked as below.
CALL FUNCTION JOB_SUBMIT
EXPORTING
authcknam = 'USER2'( who have all the authorizations)
IMPORTING
..........................
EXCEPTIONS
...........................
As you said the JOB_WAS_RELEASED should be 'X; if it gets released, but in our case its coming as blank.
So still the Job is getting scheduled, but not released.
Kindly suggest if any code change need to done to resolve this.
Regards,
Dilli.
12-02-2015 5:32 PM
Hi Alexander,
Earlier JOB was not getting Scheduled at all, JOB_SUBMIT was returning RC8 when executed.
As per the suggestion from below post we have used BP_JOB_READ and BP_JOB_MODIFY before JOB_CLOSE to resolve the issue.
So now we are not getting any issue i.e JOB is getting scheduled, but not getting released.
Please suggest if any change need to be done.
Regards,
Dilli.
12-03-2015 9:55 AM
That would be a security vulnerability, a bug, you should not be able to cheat the system ..
You should create a periodic background job that would release these jobs,
Regards,
Raymond
12-12-2015 7:45 PM
It's an Authorization Issue. Now we secured the required authorizations and the issue was resolved.
Thank you all..!!