1 DATA: lv_jobnum TYPE btcjobcnt.
2 DATA: gv_jobname TYPE btcjob VALUE 'ZVBELN_POSTING'. "后台作业名称
3
4 CALL FUNCTION 'JOB_OPEN'
5 EXPORTING
6 jobname = gv_jobname
7 IMPORTING
8 jobcount = lv_jobnum
9 EXCEPTIONS
10 cant_create_job = 1
11 invalid_job_data = 2
12 jobname_missing = 3
13 OTHERS = 4.
14
15 IF sy-subrc = 0 .
16
17 SUBMIT zsxwms_delivery_confirm1 "后台作业运行的程序
18 WITH s_vbeln IN r_vbeln "条件
19 WITH s_type IN r_type
20 WITH s_bwkey IN r_bwkey
21 VIA JOB gv_jobname NUMBER lv_jobnum AND RETURN .
22
23 IF sy-subrc = 0 .
24
25 CALL FUNCTION 'JOB_CLOSE'
26 EXPORTING
27 jobcount = lv_jobnum
28 jobname = gv_jobname
29 strtimmed = 'X' "立即开始
30 EXCEPTIONS
31 cant_start_immediate = 1
32 invalid_startdate = 2
33 jobname_missing = 3
34 job_close_failed = 4
35 job_nosteps = 5
36 job_notex = 6
37 lock_failed = 7
38 OTHERS = 8.
39
40 ENDIF .
41
42 ENDIF .