Skip to Content
0
Former Member
Mar 09, 2009 at 01:25 PM

problem in creating job via submit

13 Views

sap 4.7

i am opening/scheduling job from other program/job

And from some reason i get two jobs with the same name.

One is working good, and the other one is stay in schedule.

My problem is , why i active two jobs and not only one ?

And why one (that I donu2019t want and need it at all ) is stay as "schedule" ?

this is my code

CONCATENATE EVT_ID JOBCOUNT INTO JOBNAME

SEPARATED BY SPACE.

LCL_TIME = SY-UZEIT + 1000 . " + 15 minute

CALL FUNCTION 'JOB_OPEN'

EXPORTING

JOBNAME = JOBNAME

IMPORTING

JOBCOUNT = JOBCOUNT. " AND RETURN

CALL FUNCTION 'JOB_OPEN'

EXPORTING

JOBNAME = JOBNAME

  • DELANFREP = SPACE

IMPORTING

JOBCOUNT = JOBCOUNT

EXCEPTIONS

CANT_CREATE_JOB = 1

INVALID_JOB_DATA = 2

JOBNAME_MISSING = 3

OTHERS = 4.

if sy-subrc <> 0 .

MESSAGE I099 WITH 'cant craete job' .

endif.

SUBMIT YITF_MOVE_TO_BCKP

VIA JOB JOBNAME NUMBER JOBCOUNT

TO SAP-SPOOL IMMEDIATELY ' '

DESTINATION 'LOCL'

KEEP IN SPOOL 'X'

WITHOUT SPOOL DYNPRO

WITH EVT_PARM = EVT_PARM

AND RETURN.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

JOBCOUNT = JOBCOUNT

JOBNAME = JOBNAME

SDLSTRTDT = SY-DATUM "i_strtdt

SDLSTRTTM = LCL_TIME

  • STRTIMMED = 'X'

this is the status in sm37

YITF_MFHBHY_LOAD 03304501 LEGACY Scheduled

YITF_MFHBHY_LOAD 03304501 LEGACY Complete 04.03.2009 03:49:05

.