04-15-2011 7:21 AM
Hi ,
I am facing problem with background scheduling a program . i have program ZTEST and in that i am submitting another program ZTEST1 for background..
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = NAME_JOB
IMPORTING
JOBCOUNT = NUMBER
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
SUBMIT ZTEST1 TO SAP-SPOOL "DESTINATION l_dest
"LINE-SIZE l_linsz
"IMMEDIATELY 'X'
"KEEP IN SPOOL 'X'
SPOOL PARAMETERS PRINPAR
"WITHOUT SPOOL DYNPRO
WITH scheme1 = scheme1
WITH descript = descript
WITH p_bukrs = p_bukrs
WITH r1 = r1
WITH offline = OFFLINE
WITH ex = EX
WITH py = PY
WITH bj = BJ
WITH IM = IM
WITH schno = schno
WITH spart1 = spart1
WITH spart = spart
WITH date1 = date1
VIA JOB NAME_JOB NUMBER NUMBER AND RETURN.
Job is getting scheduled but the problem is no spool number is geneated for this job .
Moreover , if run ZTEST1 normally it is running perfectly fine and updating the database , but if i run it through SUBMIT command
it is not working fine and not updating the DB.
Thanks.
04-15-2011 7:51 AM
Hi,
it may be because of the paramters which you are passing to ZTEST1 druing submit is different than when you are executing in forgound. check the parametrs. also use function module JOB_CLOSE to close the job.
04-15-2011 7:55 AM
Hi,
if you pass SELECT-OPTIONS, do not pass them with
WITH ... = ...
but with
WITH ... IN ...
If you have matching PARAMETERS and SELECT-OPTIONS, use "=" for PARAMETERS and "IN" for SELECT-OPTIONS!
Regards,
Klaus
Edited by: Klaus Babl on Apr 15, 2011 8:56 AM
04-20-2011 8:56 AM