‎2008 Jul 31 9:48 AM
Hi all,
i have a requirement where i need to create Background Job for a program when another program is being executed.
Can some one tell me any Function modules for the same along with parameters.
Regards,
AJ
‎2008 Jul 31 10:03 AM
>
> Hi all,
>
> i have a requirement where i need to create Background Job for a program when another program is being executed.
> Can some one tell me any Function modules for the same along with parameters.
>
> Regards,
> AJ
Hi Anurag,
Yes, you can do it.
follow the bellow example
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = 'GCERTS'
IMPORTING
JOBCOUNT = JOBCOUNT
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE E050 WITH TEXT-024.
ENDIF.
SUBMIT RSBDCSUB AND RETURN
USER SY-UNAME
VIA JOB 'GCERTS' NUMBER JOBCOUNT
WITH MAPPE = 'GCERTS'
WITH VON = SY-DATUM
WITH BIS = SY-DATUM
WITH Z_VERARB = 'X'.
CLEAR JOB_RELEASED.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = JOBCOUNT
JOBNAME = 'GCERTS'
STRTIMMED = 'X'
IMPORTING
JOB_WAS_RELEASED = JOB_RELEASED
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.
Here first we need to open the job first and then submit your program through that job to schedule for particular date and time
and after words close job.It will run the Job when it reaches that particular date and time
‎2008 Jul 31 10:03 AM
>
> Hi all,
>
> i have a requirement where i need to create Background Job for a program when another program is being executed.
> Can some one tell me any Function modules for the same along with parameters.
>
> Regards,
> AJ
Hi Anurag,
Yes, you can do it.
follow the bellow example
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = 'GCERTS'
IMPORTING
JOBCOUNT = JOBCOUNT
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE E050 WITH TEXT-024.
ENDIF.
SUBMIT RSBDCSUB AND RETURN
USER SY-UNAME
VIA JOB 'GCERTS' NUMBER JOBCOUNT
WITH MAPPE = 'GCERTS'
WITH VON = SY-DATUM
WITH BIS = SY-DATUM
WITH Z_VERARB = 'X'.
CLEAR JOB_RELEASED.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = JOBCOUNT
JOBNAME = 'GCERTS'
STRTIMMED = 'X'
IMPORTING
JOB_WAS_RELEASED = JOB_RELEASED
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.
Here first we need to open the job first and then submit your program through that job to schedule for particular date and time
and after words close job.It will run the Job when it reaches that particular date and time
‎2008 Sep 15 10:57 AM
Hi Soma,
I have gone through ur reply but in SUBMIT i didnt get the significant of
WITH MAPPE = 'GCERTS'
WITH VON = SY-DATUM
WITH BIS = SY-DATUM
WITH Z_VERARB = 'X'.
Can you please explain ...
Best regards Dev
‎2008 Jul 31 10:09 AM
Hi,
You can use the function module SUBST_SCHEDULE_GENERATOR to schedule a background job.
CALL FUNCTION 'SUBST_SCHEDULE_GENERATOR'
EXPORTING
JOBNAME = 'Z_TEST_JOB'
REPNAME = 'Z_TEST_PROG'
VARNAME = 'Z_VAR1'
* AUTHCKNAM = 'DDIC'
* BATCHHOST = ' '
* LANGUAGE = SY-LANGU
* PRIPARAMS = ' '
* IV_SCHEDEVER = ' '
* PARAM = 0
* SDLSTRTDT = ' '
* SDLSTRTTM = ' '
* STRTIMMED = 'X'
* IMPORTING
* JOBCOUNT =
* RC_START =
* TABLES
* SELTAB = .
This will instantly start the background job for this program. In case you want to give a start date and time, you can mention the same in the parameter SDLSTRTDT and SDLSTRTTM.
Reward points if helpful.
Biswa...
‎2008 Jul 31 1:30 PM
Thnks for the useful response.
Anyways, The FM specified was not working in my case.
Regards,
AJ
‎2008 Aug 01 9:42 AM
Hi,
Use function modules(Job_open,Job_submit and job_close).
Use submit command for scheduling like below.
SUBMIT RSBDCSUB AND RETURN
USER SY-UNAME
VIA JOB 'GCERTS' NUMBER JOBCOUNT
WITH MAPPE = 'GCERTS'
WITH VON = SY-DATUM
WITH BIS = SY-DATUM
WITH Z_VERARB = 'X'.
Regards,
mani