2006 Sep 11 9:20 PM
I open a job and submit a program via this job name.I closed this job and run it immediately. But I find that as if this job is scheduled as background job again to run later. I just want it run once (when calling job_close). Who can tell me how I can just run the job once and this job would not be scheduled again? My codes is attached.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
SUBMIT sd70av3a AND RETURN
WITH rg_kschl = output_type
WITH pm_vermo = 2
WITH rg_vbeln = num
TO SAP-SPOOL
SPOOL PARAMETERS ls_params WITHOUT SPOOL DYNPRO
VIA JOB jobname
NUMBER jobcount.
Close job
start it immediately
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
strtimmed = 'X'
targetsystem = host
EXCEPTIONS
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
OTHERS = 99.
check job status
DO.
CALL FUNCTION 'BP_JOB_STATUS_GET'
EXPORTING
jobcount = jobcount
jobname = jobname
IMPORTING
status = job_status
has_child = job_child.
IF job_status = 'F'. "job has finished
EXIT.
ENDIF.
ENDDO.
2006 Sep 11 9:25 PM
I open a job and submit a program via this job name.I closed this job and run it immediately. But I find that as if this job is scheduled as background job again to run later. I just want it run once (when calling job_close). Who can tell me how I can just run the job once and this job would not be scheduled again? My codes is attached.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
SUBMIT sd70av3a AND RETURN
WITH rg_kschl = output_type
WITH pm_vermo = 2
WITH rg_vbeln = num
TO SAP-SPOOL
SPOOL PARAMETERS ls_params WITHOUT SPOOL DYNPRO
VIA JOB jobname
NUMBER jobcount.
Close job
start it immediately
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
strtimmed = 'X'
targetsystem = host
EXCEPTIONS
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
OTHERS = 99.
check job status
DO.
CALL FUNCTION 'BP_JOB_STATUS_GET'
EXPORTING
jobcount = jobcount
jobname = jobname
IMPORTING
status = job_status
has_child = job_child.
IF job_status = 'F'. "job has finished
EXIT.
ENDIF.
ENDDO.
2006 Sep 11 9:25 PM
2006 Sep 11 9:25 PM
Hi Jack,
Please change this (bold).
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
<b>prddays = 0</b>
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
strtimmed = 'X'
targetsystem = host
Regards,
Ferry Lianto
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |