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?
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.