‎2010 May 11 1:23 PM
Hi Friends,
I need to execute a program using function modules JOB_OPEN, JOB_SUBMIT, JOB_CLOSE when ever i executed
(i.e; similar to Background scheduling immediatly using SM36, sm37)
please help me in the code,
i have written a sample program using JOB_OPEN, JOB_SUBMIT, JOB_CLOSE function modules,
but in SP01, i am able to see many jobs under my user.
How can i avoid multiple Background jobs triggering when i execute a program once using above function modules.
Thanks in Advance,
Ganesh
‎2010 May 11 1:30 PM
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = <JOB NAME>
IMPORTING
jobcount = tbtcjob-jobcount
EXCEPTIONS
OTHERS = 01.
IF sy-subrc = 0.
repid = <REPORT NAME>.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = tbtcjob-authcknam
jobcount = tbtcjob-jobcount
jobname = tbtcjob-jobname
report = repid
variant = raldb-variant
EXCEPTIONS
OTHERS = 01.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobname = tbtcjob-jobname
jobcount = tbtcjob-jobcount
strtimmed = 'X'
EXCEPTIONS
OTHERS = 01.
ENDIF.
ENDIF.
‎2010 May 11 1:30 PM
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = <JOB NAME>
IMPORTING
jobcount = tbtcjob-jobcount
EXCEPTIONS
OTHERS = 01.
IF sy-subrc = 0.
repid = <REPORT NAME>.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = tbtcjob-authcknam
jobcount = tbtcjob-jobcount
jobname = tbtcjob-jobname
report = repid
variant = raldb-variant
EXCEPTIONS
OTHERS = 01.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobname = tbtcjob-jobname
jobcount = tbtcjob-jobcount
strtimmed = 'X'
EXCEPTIONS
OTHERS = 01.
ENDIF.
ENDIF.
‎2010 May 13 5:03 PM
Hi Nilesh,
I worked in the same way but the system has creating multiple BACTH-JOBS
when i opened SP01 many Spools are there, in SM37 I can see many JOBS in Released Status.
where I got complaint from Basis Team
Please help me
Thanks,
Ganesh