Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem With Background Job

Former Member
0 Kudos

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.

3 REPLIES 3

nirajgadre
Active Contributor
0 Kudos

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.

former_member195402
Active Contributor
0 Kudos

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

former_member628395
Active Participant
0 Kudos

Hi,

Please check my reply to the post [JOB IN BACKGROUND - HELP |; .

Hope it helps.

Regards,

Sagar