2008 May 14 5:17 AM
Hi experts,
i need ur help to do job scheduling...
i need a functional module or (sample program) to do job scheduling for every first sunday of the month... so that the program retrieves the data of the previous month..
Thanks in advance,
Regards,
Priya.
Hi experts,
i need ur help to do job scheduling...
i need a functional module or (sample program) to do job scheduling for every first sunday of the month... so that the program retrieves the data of the previous month..
Thanks in advance,
Regards,
Priya.
2008 May 14 5:19 AM
Hi Priya
Hope it will help you.
Reward pts if help.
Create a Variant for the Program and
Schedule JOB in background:
Go to SM36 create a Job
enter Program and Variant for that program in STEP..
click on Start Condition
Click on DATE and TIME enter date scheduled Start and END times
click on Period Values
Click on HOURLY/WEEKLY etc
CLick on RESTRICTIONS also to use further criteria.
so your job will be scheduled and run as per your requirement.
and in SM37 Transaction check the status of that JOB
Check this link for scheduling jobs..
http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm
Pls reward if help.
2008 May 14 5:20 AM
Check this sample code which I got from this forum and kindly reward points if it helps.
report zrich_0004 .
data: sdate type sy-datum,
stime type sy-uzeit,
l_valid,
ls_params like pri_params,
l_jobcount like tbtcjob-jobcount,
l_jobname like tbtcjob-jobname.
start-of-selection.
Get Print Parameters
call function 'GET_PRINT_PARAMETERS'
exporting
no_dialog = 'X'
importing
valid = l_valid
out_parameters = ls_params.
Open Job
l_jobname = 'ZRICH_0005'.
call function 'JOB_OPEN'
exporting
jobname = l_jobname
importing
jobcount = l_jobcount.
*Submit report to job
submit zrich_0005
via job l_jobname
number l_jobcount
to sap-spool without spool dynpro
spool parameters ls_params
and return.
*Kick job off 30 seconds from now.
sdate = sy-datum.
stime = sy-uzeit + 30.
*Schedule and close job.
call function 'JOB_CLOSE'
exporting
jobcount = l_jobcount
jobname = l_jobname
sdlstrtdt = sdate
sdlstrttm = stime
*strtimmed = 'X'
.
Regards
Abhishek