on 09-06-2017 2:09 PM
Hello,
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)?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.