Skip to Content
Author's profile photo Former Member

How to debug Workflow

Workflow debug is not easy. Breakpoints do not work. There is only one effective way to debug Workflow.

You will need access to transaction SM50 – Work Process Overview.

You will need authorization to “Debug Process”.

You will need authorisation to “Change values during debug”.

Once you have checked you have all the authorisations, you have to create a FM or Method to wait.

The best practice is to create the following “Workflow debug” Table for control.

This way you can have a number of “breakpoints” and you can activate and deactivate them.

EVENT_NAME     Event name

ACTIV                  Event activ or not

WAIT_TIME          Time to wait in seconds

Your FM or Methode should be called from the BOR or Class method.

For example

CALL METHOD zcl_workflow_help=>debug_wait( x_event = ‘FIND_CUSTOMER’ ).

The Method can be for example:


  lv_wait_until TYPE tims,

  ls_workflow_debug TYPE zworkflow_debug.

SELECT SINGLE * FROM zworkflow_debug INTO ls_workflow_debug

  WHERE event_name = x_event.

IF ls_workflow_debug IS NOT INITIAL.

  lv_wait_until = sy-uzeit + ls_workflow_debug-wait_time.



    IF ls_workflow_debug-activ IS INITIAL OR lv_wait_time LE sy-uzeit.





In the table Workflow Debug you can set debug ON and OFF.

Once you have set it ON you need to run your workflow.

The workflow will wait for as many seconds as you have set.

During this time you need to start transaction SM50.

You find the waiting workflow task.

You debug the program.

In debug mode you set “Activ” off.

Than your program continues and you can debug it.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Jonathan Bourne
      Jonathan Bourne

      You could also use the existing SAP function modules to perform the same activity as are used in HCM Processes & Forms.

      Call function K_PLAN_WAIT_FOR_DEBUGGING in your bespoke code. Parameter ID_DEBUG_ID and ID_DEBUG_LEVEL can be set as you wish, for example, debug ID "ZTEST" and Debug Level "WF_TASK_1".

      Then use function module K_PLAN_WAIT_FOR_DEBUGGING_CTRL to activate or deactivate the loop functionality specifying the debug ID and level specified in the bespoke code and the username (typically WF-BATCH or leave blank for all users). Set parameter ID_INSERT to "X" to activate the debugging or blank to deactivate. The current state of any active debugging can be viewed in table T811FLAGS.

      When the workflow runs the background step will enter a loop for 15 minutes after which processing will continue. During this time you can debug the process using transaction SM50.



      Author's profile photo Former Member
      Former Member

      hi jonathan bourne,

               first of all thanks for the method your specified

      I have tried it out what I want to ask is 'is it possible to see the value of workflow containers in the debugging mode as the way you specified'

      please help me I can't see the values of workflow container.


      Medoyi C

      Author's profile photo Jerry Wang
      Jerry Wang

      Hi József,

      thank you very much for your share! I like it. However, I guess this approach does not work if you want to debug a standard workflow whose code is not allowed to change, right?

      Best regards,


      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Jerry,

      You need to change the SAP standard code in order to debug SAP standard Workflows. There is no other way. You need to unlock it with an access key what the basis can provide.



      Author's profile photo Fouad Sadik
      Fouad Sadik

      Hello József,

      Rather than creating your own Z code to debug this, you can follow the instructions in NOTE 1782731 to debug the standard workflows. Same steps work for Z workflows.

      This will enable you to debug background LUW processes and investigate any issues even with the standard code.



      Author's profile photo S D
      S D

      Hi Sadik,

      can you please explain how to debuf RFC LUW in SM58 is not clear to me.I will be thankful for explaining this step in detail.When i executed SM58 EDIT-LUW DEBUG, control didint stopped on break-point in my code.

      Author's profile photo Pavel Astashonok
      Pavel Astashonok

      The approach from the note only works for background WF steps, not for foreground.