Skip to Content
avatar image
Former Member

how to end a work item exlicitly without executing it?

i want to find out how to end a workitem explicitly without executing it from the business workplace. we have created a dummy workitem and would like to end it when it is not needed.

i have set up the terminating event in the workitem task but even though the event is raised the workitem is not ended and the workitem is still in the inbox. i was expecting that when the event is raised the event will end the workitem and it will move into the outbox.

am i doing something worng? why isnt the workitem getting ended and move to outbox when the terminating event is raised?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 02, 2008 at 03:53 AM

    hi,

    as arghadip has mentioned, you can use the following FMs to terminate the WI.

    SAP_WAPI_WORKITEM_COMPLETE (if it is a dialog activity task)

    SAP_WAPI_DECISION_COMPLETE (if it is a user decision task)

    if you are raising the terminating event in the WF itself then in place of that you can use a "process control" step and set its function as "set WI to obsolete" and specify the step number of the WI.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2008 at 03:12 AM

    Please check whether you are triggering the Terminating Event of the correct key field for which it needs to be triggered. Alternatively you can complete the workitem from SWIA transaction code or programatically you can do this by using FM

    SAP_WAPI_WORKITEM_COMPLETE

    SAP_WAPI_SET_WORKITEM_COMPLETD

    SAP_WAPI_DECISION_COMPLETE

    Thanks

    Arghadip

    Add comment
    10|10000 characters needed characters exceeded

    • Are you sure the event is raised (check the event trace)? If not you forgot the commit work.

      When an event is raised are you sure it is raised for the correct BOR and key?

      Why don't you use the WAPI SAP_WAPI_CREATE_EVENT?

      Regards,

      Martin

  • avatar image
    Former Member
    Sep 02, 2008 at 08:39 AM

    Hi,

    IF all this processess happens in a single workflow, you can include a Process Control step to cancel work item of a step within the workflow, just input the step number, and this step will cancel the work item for the specified step once the flow passess to this step.

    Cheers,

    Add comment
    10|10000 characters needed characters exceeded