‎2006 Sep 08 7:49 AM
Hi Masters,
Please help me solving this urgent issue.
Issue Description:
____________________
I want to schedule my program in background means..
My main selection screen is having a single parameter it appears as..
Last Changed On ________SY-DATUM_________
Now every night at 12.00 clock night the program should take current date.
And would do the required processing which I have done in my Zprogram....
Here m not getting how to schedule this Zprogram as
in background...
M waiting for positive responses....!!
-=Virendra=-
‎2006 Sep 08 8:14 AM
You can follow one of the following 2 ways:
1)GO to SM36 to schedule your program in background but to make date as current date, do as follows:
Add the following 3 lines of code to your Program:
Let's name the field "Last Changed on" as w_date.
if SY-BATCH = 'X'.
W_date = sy-datum.
endif.
2.
Create a new driver program for your program
and in the driver program , call the following FMs:
CALL FUNCTION 'JOB_OPEN'
CALL FUNCTION 'JOB_SUBMIT'
CALL FUNCTION 'JOB_CLOSE'
To create/ set a dynamic variant for JOB_SUBMIT,
use FM 'RS_CHANGE_CREATED_VARIANT'/'RS_CREATE_VARIANT'
Hope it solves your problem.
Regards
Message was edited by: Akriti
Message was edited by: Akriti
‎2006 Sep 08 7:51 AM
Hi Virendra,
u have to create a job in SM36 and schedule it.In SM36 give ur zprogram name .
Regards,
nagaraj
‎2006 Sep 08 7:52 AM
u can create a abckground job in sm36 by giving ur prog name tehre
‎2006 Sep 08 7:54 AM
Go to SM36, Create a new job name
give the program name
Click on date/time and give the time values
Click on period values and give daily.
‎2006 Sep 08 7:57 AM
USE TCODE SM36
GIVE DATE AND TIME TO SCHEDULE IT ON 12:00 AT NIGHT.
AND CHECK THE BOX PERIODIC JOB.
CHEERS
-
SACHIN
‎2006 Sep 08 8:05 AM
Hi
Adding to the suggestions given above, you use the System Date(SY-DATUM) in your program. As a background job cannot take any input through selection-screen...
So, as you schedule it periodically, it takes the value from <b>SY-DATUM</b> system variable.
Remove Selection-screen and populate the sy-datum value in <b>Initialization</b> section.
Regards,
Raj
Message was edited by: Rajasekhar Dinavahi
‎2006 Sep 08 8:14 AM
You can follow one of the following 2 ways:
1)GO to SM36 to schedule your program in background but to make date as current date, do as follows:
Add the following 3 lines of code to your Program:
Let's name the field "Last Changed on" as w_date.
if SY-BATCH = 'X'.
W_date = sy-datum.
endif.
2.
Create a new driver program for your program
and in the driver program , call the following FMs:
CALL FUNCTION 'JOB_OPEN'
CALL FUNCTION 'JOB_SUBMIT'
CALL FUNCTION 'JOB_CLOSE'
To create/ set a dynamic variant for JOB_SUBMIT,
use FM 'RS_CHANGE_CREATED_VARIANT'/'RS_CREATE_VARIANT'
Hope it solves your problem.
Regards
Message was edited by: Akriti
Message was edited by: Akriti
‎2006 Sep 08 10:22 AM
Thank you all you people for such a quick replies..!!!
Dear Akriti,
could you please clear me this point..
How this sy-batch would work ?
I mean, i saw in syst structure showing "system field filled if program is running in Background".
When this sy-batch would filled-up in respect of my program because i am not using built in "excute in background" option which is given in Menu ?
if i dont put this "Last Changed On" parameter on my selection screen and wish to run this program in background automatically at 12 o clock..then..
Please show some light ....
‎2006 Sep 08 10:33 AM
if the values of the parameter "last changed on" is going to be sy-datum always, why do u want to have it a parameter. use the variable sy-datum inside the program directly. Then for scheduling joibs u go to the transaction SM36, in the appl tool bar, one wizard option is there. u go by that, the steps and very simple and self explanatory
Thanks,
Dinu
‎2006 Sep 08 10:35 AM
Hi virendra,
1. while declaring the parameter,
give DEFAULT SY-DATUM.
2. For running in background,
use sm36 to schedule in background,
everyday,
at the desired time 12:00 clock.
regards,
amit m.
‎2006 Sep 08 11:33 AM
Thanks to you all.
Such a nice group to inquire about..!!
-=Virendra Soni=-