cancel
Showing results for 
Search instead for 
Did you mean: 

how to end a work item exlicitly without executing it?

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (2)

Answers (2)

Former Member
0 Kudos

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,

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Arghadip,

thanks for your inputs. That was really useful but in my case i dont have the workitem ID. Actually here is my process, the system creates a workflow when a invoice is created and it is blocked for payment. When the invoice triggers a workflow it does two things in a FORK. One it sends an email and the second it sends a workitem. The workitem is a dummy workitem. When the user reply's to the email a RFC FM is called from the external system which will release the invoice in SAP. Now once this is done we would like to close the workitem which is lying in the business workplace. So i have implemented the terminating event however i guess that doesnt work. When the RFC FM is called externally it releases the Invoice using a BAPI and once it is done i am calling the FM SWE_EVENT_CREATE to raise the event to terminate the event.

Am i doing something wrong?

martin_nooteboom
Active Contributor
0 Kudos

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