cancel
Showing results for 
Search instead for 
Did you mean: 

Use of SAP_WAPI_PUT_BACK_WORKITEM

Former Member
0 Kudos

Hi,

I have a workflow, where many users can access the same task, and often they by mistake reserve a workitem, and forgets about it. I have found the SAP_WAPI_PUT_BACK_WORKITEM, which puts the item back in status ready. My question is, can I implement this in the PAI thus the workitem is never reserved when a user cancels execution of it (F3). I have tried to do it, but I cannot get it to work. Is it because the status of the workitem, cannot be changed like this, or because of incompetence from my side

Is there a better way to obtaine what I want?

Kind regards

Mikkel

Accepted Solutions (1)

Accepted Solutions (1)

ramki_maley
Active Contributor
0 Kudos

Mikkel,

The function to use is SAP_WAPI_ADM_WORKITEM_BACK (admin. replace). I don't think you can implement this in the PAI (btw which PAI?) since the WI is locked until task execution is complete. I have implemented this functionality as a batch job.

Cheers,

Ramki.

Answers (1)

Answers (1)

pokrakam
Active Contributor
0 Kudos

Hi Mikkel,

If your process allows for it, put your step into a loop. If it's a SAP standard method you may need to create your own copy or a wrapper method that intercepts EXIT_CANCELLED and makes it a proper outcome. i.e. one outcome means executed, the other means cancelled and loop around again.

This way backing out completes the item and creates a new one for all users.

Cheers

Mike