‎2005 Sep 19 10:55 PM
Hi,
i need to run a program in batch mode and security for it need to be added to the batch id.could come one let me know how to do that with some sample code.
Your help would be appreciated.
Thanks,
ravi.
‎2005 Sep 19 11:50 PM
Hi
you can use a code like this:
Open job:
VA_JOBNAME = .......
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = VA_JOBNAME
IMPORTING
JOBCOUNT = VN_JOBCOUNT
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
Call program
SUBMIT <REPORT>
USER SY-UNAME
VIA JOB VA_JOBNAME NUMBER VN_JOBCOUNT
WITH ...
WITH ....
WITH ..... AND RETURN.
Close job
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = VN_JOBCOUNT
JOBNAME = VA_JOBNAME
STRTIMMED = 'X' " start immediatly
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.
But you can also do it by trx SM36
Max
‎2005 Sep 20 1:51 AM
Max,
Thanks for your response.
if i want to use this code in the same program which i need to submit in background, what changes do i need to make.
Thanks,
ravi.
‎2005 Sep 20 2:25 AM
Hi
If you want to add security to a program you may use
AUTHORITY-CHECK statement with a particular object .
But the BATCH ID user should have authorization for the object you choose . Other users may not have authorization. Depends on what level of security you want to Add. So you will have to identify an authorization object and an activity .