abap–How to debug backgroud job详解编程语言

最近被一个朋友问起如何调试后台进程(一个abap的面试题),我一时也不知道如何答,他后来告诉我到sdn上找答案,我现在将答案收集供大家参考:
Steps 
1. Create variant called BACKGROUND for program(ZWBTEST) to be debugged. 
2. Execute ZDEBUGBG (pgm code below) in background for immediate processing. 
3. Execute transaction SM50. 
4. Select process that runs ZDEBUGBG. 
5. Goto ‘Program/Session’ ‘Program’ ‘Debugging’. 
A se80 debug session will open. 
6. Change variable W_EXIT to ‘E’. 
7. Step thru (F6) until ZWBTEST comes up. 
*&———————————————————————* 
*& Report ZDEBUGBG * 
*& * 
*&———————————————————————* 
*& * 
*& * 
*&———————————————————————* 

DATA: 
w_exit TYPE c. 
 
FIELD-SYMBOLS <fs> TYPE any. 
 
SELECTION-SCREEN BEGIN OF BLOCK one. 
PARAMETERS: p_repid LIKE trdir-name DEFAULT 'ZWBTEST'. 
SELECTION-SCREEN END OF BLOCK one. 
 
START-OF-SELECTION. 
  PERFORM loop_time. 
  PERFORM submit_time. 
 
END-OF-SELECTION. 
 
*---------------------------------------------------------------------* 
* FORM loop_time * 
*---------------------------------------------------------------------* 
* ........ * 
*---------------------------------------------------------------------* 
FORM loop_time. 
  DO. 
    IF w_exit = 'E'. 
      EXIT. 
    ENDIF. 
  ENDDO. 
ENDFORM.                    "loop_time 
 
*---------------------------------------------------------------------* 
* FORM submit_time * 
*---------------------------------------------------------------------* 
* ........ * 
*---------------------------------------------------------------------* 
FORM submit_time. 
  ASSIGN p_repid TO <fs>. 
  SUBMIT (<fs>)  USING SELECTION-SET 'BACKGROUND'. 
ENDFORM.                    "submit_time

 


url:IT虾米网

原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/18421.html

(0)
上一篇 2021年7月19日
下一篇 2021年7月19日

相关推荐

发表回复

登录后才能评论