‎2007 Nov 01 5:44 AM
hi all,
can anyone give me the sample code for job scheduling.
job scheduling is to be done programitically(not using tcode sm36 and sm37)
and then to display it withouut going to spool. the program to execute at particular date and time and should have a variant.
urgent.
thanks
pankaj
‎2007 Nov 01 5:48 AM
Make use of the FMs' : JOB_CLOSE, JOB_OPEN, JOB_SUBMIT
Regards
Gopi
‎2007 Nov 01 5:50 AM
hi gopi,
can u send me sample code, i m new in apap.
regards
pankaj
‎2007 Nov 01 5:50 AM
Hi,
check this sample code
Check this sample code..
DATA: p_jobcnt LIKE tbtcjob-jobcount,
l_release(1) TYPE c.
Open the job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = 'ZMY_OBJ'
IMPORTING
jobcount = p_jobcnt
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
Submit the job.
SUBMIT ztest_program VIA JOB 'ZMY_OBJ' NUMBER p_jobcnt
TO SAP-SPOOL WITHOUT SPOOL DYNPRO
WITH destination = 'LOCL'
WITH immediately = space
WITH keep_in_spool = 'X' AND RETURN.
Close the job.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = p_jobcnt
jobname = 'ZMY_OBJ'
strtimmed = 'X'
prdmins = 15
IMPORTING
job_was_released = l_release.
Thanks
Naren
‎2007 Nov 01 5:53 AM
hi naren sir,
i do not want to execute program immediately, if my program has sel-screen then i have to create variant how?
thanks
pankaj
‎2007 Nov 01 5:56 AM
Hi,
If you have variant..
Then use the USING SELECTION-SET <variant name> addition to trigger with the variant
Thanks
Naren
‎2007 Nov 01 6:00 AM
‎2007 Nov 01 6:02 AM
Hi,
In the JOB_CLOSE function module pass blank to the parameter strtimmed
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = p_jobcnt
jobname = 'ZMY_OBJ'
<b>strtimmed = ' ' """""Pass blank..</b>
prdmins = 15
IMPORTING
job_was_released = l_release.
Thanks
naren
‎2007 Nov 01 6:11 AM
hi naren sir,
what are these parametrs for: sdltrtdt and sdltrttm in job_close fm
regards
pankaj