Debug code executed in update task with infinite loop.

Debug code executed in update task with infinite loop.

Even with an external break-point, it is not always possible to trigger the debugger for update task.

The tip is to use infinite loop in your code executed in update task, to prevent the code to be debugged from execution, and then, trigger the debugger from SM50.

Infinite loop :

  " ==========================================================
  " Infinite LOOP to retrieve debug in SM50 (background tasks)
  " ----------------------------------------------------------
  DATA lw_x TYPE char1.
  IF sy-uname = 'USERNAME'. " <== Not not lock everybody
  " ==========================================================



Execute your code, then launch SM50, (you may have to choose your server if several are available).

You should see your program/function in the list. Select the line, In the menu : Program/session -> Program -> Debugging.


In debug mode, change the value of LW_X or use functionnality GO TO STATEMENT to exit the loop. And debug your code as usually.

About the author

fjourneau administrator

Hi, I'm Florian Journeau, SAP ABAP R3 Freelance, based in Toulouse, France. You want to know more about me, have a look on my CV :

Leave a Reply