*&---------------------------------------------------------------------*
*& Form F_SET_JOB
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form f_set_job .
data:lt_item like table of zsdt017item_t,
ls_item like zsdt017item_t.
data:lt_tbtco like table of tbtco with header line.
data:lv_jobing type i,
lv_jobs type i,
lv_p type i,
lv_i type i. select * from zfit139 into table gt_zfit139.
sort gt_zfit139 by zpara.
***从配置表里读取出job信息
read table gt_zfit139 into gs_zfit139 with key zpara = '1072JO' binary search.
if sy-subrc = .
lv_jobs = gs_zfit139-zchar.
else.
lv_jobs = ''.
endif.
clear: gs_zfit139.
read table gt_zfit139 into gs_zfit139 with key zpara = '1072NU' binary search.
if sy-subrc = .
lv_p = gs_zfit139-zchar.
else.
lv_p = .
endif.
clear: gs_zfit139. clear: lv_i.
**处理取到的数据
do.
if gt_item is initial.
exit.
endif.
lv_i = lv_i + ."分JOB数
clear: lt_item,r_itemid[].
append lines of gt_item from to lv_p to lt_item.
*****V1.0DELETE BY 88392028 FOR AT 20181113 BEGIN*****
* r_itemid(3) = 'IEQ'.
* LOOP AT lt_item INTO ls_item.
* r_itemid-low = ls_item-order_item_id.
* APPEND r_itemid.
* ENDLOOP.
* CLEAR:r_itemid.
*****V1.0DELETE BY 88392028 FOR AT 20181113 E N D***** clear: r_no[].
r_no() = 'IEQ'.
loop at lt_item into ls_item.
concatenate ls_item-order_item_id ls_item-order_status into r_no-low separated by '|'.
append r_no.
endloop.
clear:r_no. delete gt_item from to lv_p.
do.
clear: lv_jobing.
refresh: lt_tbtco.
select *
into corresponding fields of table lt_tbtco
from tbtco
where jobname like 'ZDQFI_1072SO%'
and status = 'R'."运行中
lv_jobing = lines( lt_tbtco ).
if lv_jobing >= lv_jobs.
wait up to seconds.
else.
exit.
endif.
enddo. *G_INDEXC = SY-INDEX.
g_index = lv_i.
concatenate g_name1 '_' g_index into g_name.
perform f_job_open.
if sy-subrc = .
submit zdqfi_1072 with s_itemid in r_itemid
with s_flag in s_flag
with s_no in r_no
to sap-spool
spool parameters g_print_parameters
without spool dynpro
via job g_name number g_number
and return.
if sy-subrc = .
perform f_job_close.
if sy-subrc <> .
write :/ 'CLOSE JOB FAIL!'.
leave program.
endif.
endif.
else.
write:/ 'CREATE JOB FAIL!'.
leave program.
endif.
enddo.
write :/ 'SUBMIT ZDQFI_1072','JOBNUM',g_number,'TOTAL:',lv_i.
refresh: lt_item,r_itemid[]. endform. " F_SET_JOB
*&---------------------------------------------------------------------*
*& Form F_JOB_OPEN
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form f_job_open .
call function 'JOB_OPEN'
exporting
jobname = g_name
importing
jobcount = g_number
exceptions
cant_create_job =
invalid_job_data =
jobname_missing =
others = .
endform. " F_JOB_OPEN
*&---------------------------------------------------------------------*
*& Form F_JOB_CLOSE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form f_job_close .
call function 'JOB_CLOSE'
exporting
jobcount = g_number
jobname = g_name
strtimmed = 'X'
exceptions
cant_start_immediate =
invalid_startdate =
jobname_missing =
job_close_failed =
job_nosteps =
job_notex =
lock_failed =
others = .
endform. " F_JOB_CLOSE

最新文章

  1. Badboy使用数据源Excel进行脚本参数化
  2. centos7 开机画面定制
  3. 夺命雷公狗---DEDECMS----3快速入门之隐藏
  4. python 练习 19
  5. coffeeScript 语法总结
  6. 002--VS C++ 获取鼠标坐标并显示在窗口上
  7. Handlebars模板引擎中的each嵌套及源码浅读
  8. 两个div之间有空隙
  9. linux 学习之九、Linux 磁盘与文件系统管理(2)
  10. 如何删除Oracle数据库
  11. hadoop默认3个核心配置文件说明
  12. ubuntu svn下载代码出错
  13. 青年之锋文学网(&amp;nbsp;www.xcqnzf…
  14. new malloc 区别
  15. Hadoop 尝试
  16. hammer.js方法总结(只做了一个简单的demo)
  17. android-DNS服务找不到
  18. Codeforces Beta Round #14 (Div. 2) B. Young Photographer 水题
  19. Stored Properties 与 Computed Properties
  20. CF1097D Makoto and a Blackboard(期望)

热门文章

  1. 远程连接服务器数据库报错:Host ‘XXXXXX’ is blocked because of many connection errors
  2. [USACO07MAR]面对正确的方式Face The Right Way
  3. 出现 “java”不是内部或外部命令,也不是可运行程序或批处理文件的问题
  4. Oracle中统计block空闲情况的一个SQL语句
  5. rugarch包与R语言中的garch族模型
  6. c语言1博客作业05
  7. java后台表单字符串长度验证
  8. 自己实现sizeof+大小端测试
  9. IMEI手机串码和serialno
  10. [2019HDU多校第二场][HDU 6591][A. Another Chess Problem]