2007 Sep 17 11:23 AM
Hello,
I want to schedule a daily job using job_open, job_submit & job_close.
This job should run everyday at 22:00 hrs.
What are the parameters I need to set for the FM JOB_CLOSE?
Thanks,
A Pothuneedi
2007 Sep 17 11:26 AM
Look at this sample provided by SAP : <a href="http://help.sap.com/saphelp_sm32/helpdata/en/fa/096d8e543b11d1898e0000e8322d00/content.htm">Sample Program: Start-Time Window with JOB_CLOSE</a>
Sample Program: Start-Time Window with JOB_CLOSE Locate the document in its SAP
<b>Library structure</b>
*
* Submit job: start-time window defined, with periodic repeat and
* with target system upon which the job is to run.
*
* In this case, you must provide start date settings. You can
* have the job started immediately with a JOB_CLOSE parameter,
* set the start date yourself, or ask the user with
* BP_START_DATE_EDITOR.
*
* Example: Provide start-date specifications yourself.
*
STARTDATE = '19970101'.
STARTTIME = '160000'.
LASTSTARTDATE = '19970101'.
LASTSTARTTIME = '180000'.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = JOBNUMBER " Job identification: number
JOBNAME = JOBNAME " and name.
SDLSTRTDT = STARTDATE " Start of start-time...
SDLSTRTTM = STARTTIME " window
LASTSTRTDT = LASTSTARTDATE " Optional: end of...
LASTSTRTTM = LASTSTARTTIME " start-time window
PRDMONTHS = '1' " Restart at intervals of
PRDWEEKS = '1' " the sum of the PRD*
PRDDAYS = '1' " parameters
PRDHOURS = '1'
PRDMINS = '1'
STARTDATE_RESTRICTION = BTC_DONT_PROCESS_ON_HOLIDAY
" Restrict job start to work
" days; don't start job if
" scheduled on holiday.
" Other values:
" BTC_PROCESS_BEFORE_HOLIDAY
" BTC_PROCESS_AFTER_HOLIDAY
CALENDAR_ID = '01' " ID of R/3 factory calendar
" for determining workdays
TARGETSYSTEM = 'hs0011' " Optional: name of the host
" system on which the job is
" to run. Set only if
" absolutely required.
" Example: A required tape
" drive is accessible only
" from a single host system.
IMPORTING
JOB_WAS_RELEASED = JOB_RELEASED " If user has authorization
" to release jobs to run, job
" is automatically released
" when it is scheduled. This
" field is set to 'x' if the
" job has been released.
" Otherwise, the job is sche-
" duled but must be released
" by an administrator before
" it can be started.
EXCEPTIONS
INVALID_STARTDATE = 01
JOBNAME_MISSING = 02
JOB_CLOSE_FAILED = 03
JOB_NOSTEPS = 04
JOB_NOTEX = 05
LOCK_FAILED = 06
OTHERS = 99.
IF SY-SUBRC > 0.
<Error processing>
ENDIF.
Regards