Skip to Content
0
Aug 20, 2010 at 06:18 AM

Workflow not terminating after error.

65 Views

Hi Experts, I am facing an issue with a workflow and its task.

This workflow has only one step, in which it calls a task to execute in background.

In the method called in this task, we call a function module and when sy-subrc is not Zero, we call EXIT_CONTROL like below:

BEGIN METHOD CHECK_ITEM.
...
CALL FUNCTION ZCHECK
....
EXCEPTIONS
NOT_ELIGIBLE  = 1
OTHERS = 2.

IF SY_SUBRC <> 0.
    CASE SY-SUBRC.
       WHEN 1.
           EXIT_RETURN 9001 'Not eligible'  space space space.
       WHEN 2. 
           EXIT_RETURN 9001 'Unknown error'. space space space.  
   ENDCASE.
ENDIF.

END METHOD CHECK_ITEM.

Now, if Sy-subrc = 0, the WF completes and ends.

If it is encountering the EXIT_RETURN, it doesn't complete. Instead the status remains 'IN PROCESS'.

The message is available in the WORKITEM and in the PARENT, I get the message: 'Processing Interupted'. 611.

Later, maybe hours later, I see the Workitem in error : 'Work item set to error following 03 failed attempt'.

Experts, any clue as to why this does not go into Error immediately and terminate instead of remaining in status IN PROCESS?