Skip to Content

Workitem getting logically Deleted

Sep 06, 2017 at 01:09 PM


avatar image


I am using FI document park functionality for Finance document.

In overall functinality, there is 1 main workflow and 1 sub-workflow. Sub-workflow is being used to Reject/ Approve Parked document and it is being called in mid of main workflow.

In main workflow, there is an event based wait step which requires REJECTED event to be trigerred. Now when I am using FM SAP_WAPI_WORKITEM_COMPLETE (with _WI_RESULT = 002 and _RESULT = 2 in SIMPLE_CONTAINER, here REJECTED code is 002) to reject parked document programatically it is completing sub-workflow correctly without any issue but when it is returing to main workflow it is marking Event based wait step (for event REJECTED) as Logically Deleted.

If I reject parked document manually then there is no issue and it is marking Event based wait step (for event REJECTED) as COMPLETED. Can you please help on what should be done to REJECT workitem correctly(in COMPLETED status)?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Mike Pokraka Sep 06, 2017 at 04:36 PM

This is correct behavior. The wait is for an external event such as you doing the rejection directly on the document. By using the API you are rejecting it via workflow.

One method cancels (= logically deletes) the other. You will find that rejecting via the document will set the approval step to cancelled.

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Thanks for your reply, so there is no way to complete workflow programatically same as when we Reject it manually from front end?

And as it is logically deleting Rejection Wait step and not completing it, is there any issue in future?


Yes there is, to simulate the same way would be to raise the event programatically. It really depends on the business process what you are trying to achieve.

The workflow does two things: Asks a user to approve/reject, and waits for this to be done outside of WF. If either one of these actions happens, the other is cancelled. Logically deleted is a perfectly normal state for 'unused' workflow steps.

In my opinion, using the API to reject the user's work item is functionally incorrect, because the user isn't doing the rejecting. Better would be to raise the rejected event. But then both alternatives have different follow-on activities, so we're back to: you need to understand the business process and required behavior. Nobody here can answer that part for you.


I have already tried raising 'REJECTED' event programatically and it is rejecting workflow document but as I mentioned that REJECTED wait step is in Main workflow so raising REJECTED event is only completing main workflow and not completing subworkflow. In manual Rejection, it is completing subworkflow as well as REJECTED wait event step.

Anyway thanks for your reply. I was looking for some way to complete workflow process programatically same as it completes during manual approve/ reject workflow process.


What you describe is not possible in normal operations.

A main workflow cannot complete without completing the subworkflows. Please review what is really happening.