ABAP how to get Background Job Status Report Code
来源:互联网 发布:电脑维修网站源码 编辑:程序博客网 时间:2024/06/03 14:07
转载自:https://archive.sap.com/discussions/thread/689425
-----------
Problem
-----------
Hi Experts,
My requirement is to Genarate a report that will display the background job Status.
I.e. job cancelled or job abended or job still running like that.
My selection screen will be :
Job Name.
Run Date .
Run time .
Status of Job .
Can any one please send me the report code , i searched in google in many ways but i didnt get suitable report for my above requirement.
Its very urgent ...Help me.
Thank you & Regards,
Vanky.
-----------
Code
-----------
types: begin of gty_jobs, JOBCOUNT type TBTCO-JOBCOUNT, JOBNAME typeTBTCO-JOBNAME, ABORTEDtypeTBTCV-ABORT, FINISHEDtypeTBTCV-FIN, PRELIMINARYtypeTBTCV-PRELIM, READYtypeTBTCV-READY, RUNNINGtypeTBTCV-RUN, SCHEDULEDtypeTBTCV-SCHED, end of gty_jobs. types: gty_t_jobs type table of gty_jobs, data: gt_jobs type gty_t_jobs, gv_subrc type sysubrc, gv_aborted type i, gv_finished type i, gv_total type i. field-symbols: <lfs_jobs> type gty_jobs. * Get the job status loop at gt_jobs assigning <lfs_jobs>. CALL FUNCTION 'SHOW_JOBSTATE' EXPORTING jobcount = <lfs_jobs>-jobcount jobname = <lfs_jobs>-jobname IMPORTING ABORTED = <lfs_jobs>-ABORTED FINISHED = <lfs_jobs>-FINISHED PRELIMINARY = <lfs_jobs>-PRELIMINARY READY = <lfs_jobs>-READY RUNNING = <lfs_jobs>-RUNNING SCHEDULED = <lfs_jobs>-SCHEDULED EXCEPTIONS JOBCOUNT_MISSING = 1 JOBNAME_MISSING = 2 JOB_NOTEX = 3 OTHERS = 4 . endloop. * keep on checking the job status until it is finished or cancelled while gv_subrc eq 0. loop at gt_jobs assigning <lfs_jobs>. if <lfs_jobs>-finished ne 'X' and <lfs_jobs>-aborted ne 'X'. ** reduce the frequency of checking the job status to *reduce the network traffic wait up to 60 seconds. CALL FUNCTION 'SHOW_JOBSTATE' EXPORTING jobcount = <lfs_jobs>-jobcount jobname = <lfs_jobs>-jobname IMPORTING ABORTED = <lfs_jobs>-ABORTED FINISHED = <lfs_jobs>-FINISHED PRELIMINARY = <lfs_jobs>-PRELIMINARY READY = <lfs_jobs>-READY RUNNING = <lfs_jobs>-RUNNING SCHEDULED = <lfs_jobs>-SCHEDULED EXCEPTIONS JOBCOUNT_MISSING = 1 JOBNAME_MISSING = 2 JOB_NOTEX = 3 OTHERS = 4 . IF sy-subrc <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. gv_subrc = 0. exit. else. gv_subrc = 4. endif. endloop. endwhile. * Output job summary write: /55 'J O B S U M M A R Y' color 4. write: / sy-uline(150). skip 2. describe table gt_jobs lines gv_total. * loop at gt_jobs assigning <lfs_jobs> where finished ne 'X'. loop at gt_jobs assigning <lfs_jobs>. if <lfs_jobs>-aborted eq 'X'. add 1 to gv_aborted. write: / 'Jobname :', <lfs_jobs>-jobname, 50 'Job ID :', <lfs_jobs>-jobcount color 6. write: / sy-uline(150). elseif <lfs_jobs>-finished eq 'X'. add 1 to gv_finished. write: / 'Jobname :', <lfs_jobs>-jobname, 50 'Job ID :', <lfs_jobs>-jobcount. write: / sy-uline(150). endif. endloop. write: / 'Jobs Cancelled :', 15 gv_aborted color 6. write: / 'Jobs Finished :', 15 gv_finished. write: / 'Total Jobs :', 15 gv_total. * clear: gv_aborted, gv_finished, gv_total, gt_jobs. clear: gv_aborted, gv_finished, gv_total.
阅读全文
0 0
- ABAP how to get Background Job Status Report Code
- how to debug the background job
- How to trace background job using ST12
- ABAP-Debug background job
- abap--How to debug backgroud job
- How to write software Testing Weekly Status Report
- how to find background job and stop them
- ABAP - REPORT - How to add user-pushbutton in selection screen
- How to get freeBSD/NetBSD Source Code
- How to get source code from APK
- How to get an APK smali code
- How to get Android O source code?
- How to schedule and get the report in SCOM2012
- How to get a job as a programmer
- How to Get Name of Months in ABAP/4
- How to Get Name of Months in ABAP/4
- How to Get Name of Months in ABAP/4
- How to Get Name of Months in ABAP/4
- 技术人如何才能做好绩效管理提升团队绩效?
- gensim中doc2vec调参
- js 使用正则判断某字符在字符串中出现次数
- echarts2 X轴左右滑动
- Java三年经验
- ABAP how to get Background Job Status Report Code
- datagrid 列鼠标悬浮显示全部信息
- XListView上拉加载,下拉刷新
- 知识库规范总结
- Java三年经验
- Tangent Space的基向量计算方法
- 大数据架构思考(三)
- c#委托和事件
- leetcode试手 Reverse Integer