Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
5,372

SAP workflow monitoring made easy

Cause

We have lots of transaction like PO, PR, Contract, Invoice Etc that gets locked as some user is locking the Transaction and in the same time WF-BATCH is trying to Release or update Transaction.

Standard Solution

Run everyday SWI2_DIAG and find the workflow in error and restart them from the same transaction Code or SWPR.

Disadvantage of Standard Solution 

Business stops unless the Workflow Administrator process error workflow.

We waste a lot of time doing this manual task which can be done automatically by a custom solution

Document which has already been released workflow do not have any insight to stop it

Custom Solution

Build a Custom Program that runs probably 2 times a day that picks up the workflow that are in error due to locking and restart them.

Use the Condition Tab for Complete workitem and check whether the Business document has already been released and if so just put a Process control step to Complete or Cancel the Workflow.

Advantages of Custom solution

Workflow Administrator do not have to restart workflow in error. Less work and less time.

Business do not have to wait for Workflow Administrator to restart workflow to resume the business process

Workflow status will be revised as we only need to check the true error Workflow.

Sample code 

data:it_wi type standard table of swwwihead,

      wa_wi type swwwihead.  

select * into table it_wi from swwwihead

    where wi_rh_task = 'TS90400182'

    and wi_stat = 'ERROR'

        and WI_CD eq sy-datum.

         loop at it_wi into wa_wi.

    CALL FUNCTION 'SWW_WI_ADMIN_ERROR_RESTART'

      EXPORTING

        WI_ID                       = wa_wi-top_wi_id

    IF SY-SUBRC <> 0.

* Implement suitable error handling here

    ENDIF.

    endloop.

6 Comments
Labels in this area