Skip to Content
0

Workflow workitem generates twice

Apr 09 at 04:23 AM

51

avatar image

Dear All,

I am working on purchase order release workflow. Here I have mentioned rule and from rule am getting agents. For example, once agent XYZ approves that work item then it has to go agent ABC for next level. That is working fine. The problem here is agent XYZ again getting the workitem. Workflow generates workitems for ABC as well XYZ. But XYZ already approved the work item. If XYZ tries to approve it system shows - "Release outside field of responsibility " which is correct. But XYZ should not get the same work item.

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

2 Answers

Mike Pokraka Apr 09 at 06:11 AM
1

"I am fetching the agents based on logic"

--> Correct your logic.

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

I think my logic is fine. When a po is created 1st level is XYZ second level is ABC, 3rd level is ZZZ. If i pass the po to the rule function module then it is giving XYZ when no one approved, after 1st level approval it giving ABC. So no problem with rule function module. Below I have mentioned the logic used in function module.

1.Get po number from swc_get_element ac_container 'PONUMBER' v_pono.

2.Get Release group,Release Strategy from ekko

3.Get number levels exist for that Release group + Release Strategy combination from Release Strategies table - T16FS

4.From this get the user id for the current level from Assignment of Role to Release Code table - T16FW

5.Get the number of approval levels from ekko-FRGZU Release status. If 2 levels approved then field value will be XX, one level approved then field value X. Three levels approved means field value XXX.

6.Based on internal table operation finding the level which has to get work item.

The above logic is fine to get the single workitem id. and i am passing to one user id only as agent. Now i want to know is there is any agent assignment like generatal task kind of reason for this problem.

0

Have you tested the rule against a failed instance?

0

Yes , for that po number also the rule function module giving the correct user in actor_tab.

0

Could you explain your workflow?

0

It simple po release workflow. Based on releasestep created event I am triggering workflow. Once event raised then from rule I am populating the agents based on

1.Get Release group, Release Strategy from ekko

2.Get number levels exist for that Release group + Release Strategy combination from Release Strategies table - T16FS

3.From this get the user id for the current level from Assignment of Role to Release Code table - T16FW

4.Get the number of approval levels from ekko-FRGZU Release status. If 2 levels approved then field value will be XX, one level approved then field value X. Three levels approved means field value XXX.

5.Based on internal table operation finding the level which has to get work item. Then once the form setp in workflow approved by user checking the po approval levels are completed or not , if yes then closing the loop step. else the loop step will start from point 1 to 5.

Here once approved its triggering for two agents one for next level another one for who approved the workflow.

0

You just repeated what you said earlier.

Please can you explain exactly what your workflow does? More detail than "Simple PO release workflow"

1

It just doesn't work this way, because your Workflow design is not streamlined with the SAP Release strategy logic:

- For each active/open release code, there's a separate .ReleaseStepCreated event.

- The SAP Standard uses then separate (isolated) Workflow instances for each of these release code.

This way, a sequential approval like you have, is walked through with different workflow instances (which is somewhat a weak design - but well, it works very stable and is out-of-box quite useful).

A quick fix - but not solving /every/ problem that you will encounter, is to introduce a check-Filter for the event .ReleaseStepCreated on your workflow using EBAN-FRGZU = space

This way, your workflow will start only for the very first release code, preventing duplicate ones... But there will be problem, when the release becomes reset. But take care about all this one after another :-)

Florin

3

Dear Florin,

Could you share me a standard way to approach a Po release workflow for multiple levels, I accept the approach is not much standard one which I am working., Since its an urgent requirement I have developed this. Here I have used One

1.Event step for PO Releasestepcreated. once triggered

2.Form step - here I have mentioned one rule to get agents, a form is to approve, reject

3.Activity step - to check final level approved or not

4.Loop step - if final level = X then complete else from step 1 it will start.

What is the best approach I can do the same po workflow

0
Himanshu Gupta
Apr 09 at 05:26 AM
0

Hi Nandha,

Create a new Table type field in container that will hold the agents that has been assigned till current task.

Add the user into that table that has been approved it or agents in your level 1 depending upon your requirment.

Assign that table type in the Exclude options in the task . this way XYZ won't get the second level of workitem.

Hope it will help you.

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

Hi Himanshu,

Thaks for reply .I got the approach mentioned by you. But how it is happening like I have mentioned. Because In agent assignment from rules I am fetching the agents based on logic. Purpose of that rule function module is if I give po number as import parameter then the next level agent should give. Once approved by XYZ the function module correctly giving ABC only. But system generates one more work item for XYZ agent also. I want to solve this part only.

0