source:http://learnabapprogramming.blogspot.com/2011/05/how-to-debug-background-job.html
Usually,the programs which take long time for execution are scheduled for background job.Again,one need not wait for the completion of same.We use to create the background jobs in standard transaction SM36 & can view their status in Standard Transaction SM37 like Scheduled, Released, Ready, Active, Finished and Cancelled.
Background jobs with status "Finished” & “Cancelled" could be debugged. If you are debugging an already completed job, it (a copy of it) will be re-executed and any databases or state changes will again be made to the database. This could be fatal if you are doing in a live environment(Production systems).Another point to be noted is that,the program may not get executed in the same way that it was done last, in case the program runs based on selection status that was altered by last run already.
Now what are ways by which we can debug program while its in background?
Well,there are three options or ways we can tackle this.
1)Select a job in transaction SM37. In addition, set a breakpoint at the point in the source code that you want to analyze when debugging. The debugging could be a hard brak point or a sesssional breakpoint.Now in SM37, enter JDBG in the OK code field, and choose ENTER. The selected job is now started in debug mode, and the debugger initially stops in a system program. Choose F8 to continue the job up to the next breakpoint.This is one of the best options available.
I would like to caution you that,although the job still appears in SM37 in the previous status after debugging, the entire job (or, more specifically, a copy of it) has run during debugging and possible database changes are effective as a result of the job.So make sure you check in that perspective too.
2)You can catch a current background job by using SM37 (Catch active job) or SM50 (Debug program). To do this, you must be logged on to the instance on which the job is running. You need to check the server details of the batchjob and then try this method.The job is then stopped, and you can keep it running in the debugger.This method is really helpful for live batch jobs.
3)Use SM36 to create a job with two steps, step 1 with the BTCLOOP report and step 2 with the report to be debugged. Then, set a breakpoint in the step 2 report and release the job.This is particularly useful when you are dealing with standard reports/programs or if you don't want to touch the code of the program.
You can then debug the job in transaction SM50. To do this, exit the endless loop in the BTCLOOP report by changing the variable i
分享到:
相关推荐
在 "[Advance] How to debug a program (上)" 和 "(下)" 的示例中,我们可以看到如何通过调试工具逐步定位并解决问题的过程。图片可能展示了断点设置、变量值的观察以及问题解决的步骤。 总的来说,高效的调试技能...
这是一篇关于如何找到一份体面的工作的英文作文,里面语法非常丰富,是作者的呕心之作
- 添加"/debug"参数到服务的启动命令行,并指定WinDbg的路径。 **使用服务控制台或注册表编辑器** 1. **服务控制台** - 打开服务控制台(services.msc)。 - 找到目标服务,右键点击,选择“属性”。 - 转到...
How To Write A Dissertation
How to read a book efficiently. Part one The dimensions of reading Part two The third level of reading Part three Approaches to different kinds of reading Part four The ultimate goals of reading
藏经阁-SparkR under the hood How to debug your SparkR code.pdf
VTK 12 How to Write a Process__ Object.pdf VTK 12 How to Write a Process__ Object.pdf VTK 12 How to Write a Process__ Object.pdf
How to Read a Book,学习如何快速读书 科学读书,第一版出版于1940年
The Google Resume is the only book available on how to win a coveted spot at Google, Microsoft, Apple, or other top tech firms. Gayle Laakmann McDowell worked in Google Engineering for three years, ...
This is a document about "How to be a star engineer". Share it to you .
how to read a book ,it teach you reading skills
HOWTO-html<br>News-HOWTO-html<br>News-Leafsite-html<br>Oracle-HOWTO-html<br>Plug-and-Play-HOWTO-html<br>PPP-HOWTO-html<br>Printing-HOWTO-html<br>QT 3.3 中文白皮书.pdf Quota RCS-...
(How to Write a (Lisp) Interpreter (in Python))和(An ((Even Better) Lisp) Interpreter (in Python))的翻译,对解释器实现原理和函数式编程敢兴趣的可以下载看看!
C++ How to Program presents leading-edge computing technologies in a friendly manner appropriate for introductory college course sequences, based on the curriculum recommendations of two key ...
Think Java: How to Think Like a Computer Scientist by Allen B. Downey, Chris Mayfield 2016 | ISBN: 1491929561 Currently used at many colleges, universities, and high schools, this hands-on ...
"How To Listen"是一款专为提升用户听力敏感度和音质辨识能力设计的训练软件,尤其适用于音乐制作人、音频工程师以及任何对声音有高要求的人群。这个名为"How To Listen (Public) 2.0.4 Setup.zip"的压缩包包含了该...
How to write and publish a scientific paper ContentsChapter 1 What Is Scientific Writing? Chapter 2 Origins of Scientific Writing Chapter 3 What Is a Scientific Paper? Chapter 4 How to Prepare the ...
MIT计算机大牛Bill Freeman教授于2014年写的报告,虽然比较久远,但非常有参考意义。How to write a good CVPR submission