cancel
Showing results for 
Search instead for 
Did you mean: 

Determine the number of the aprovers required to approve in NStep BADI

Former Member
0 Kudos

I am sending the workitem to 5 approvers in the BADI:BBP_WFL_APPROV_BADI.

with approval index 1.

And my requirement is that the workflow should be approved, if any 2 can approve from the 5 approvers.

How do i determine that,Please suggest.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kittu,

You could make it a two-step approval. IN the first step you send the approval to 5 users. If one approves, the workitem dissappears for all approvers, and step 2 is started in which you send the approval to the remaining 4. If step two is also approved, the workflow is finished and the document is approved.

Regards,

Sjoerd.

Former Member
0 Kudos

Thank you Sjoerd Santegoets

How do i identify who approved and the remaining approvers in the BADI,to code for second level of approvals.Please suggest.

Edited by: kittu reddy on Aug 13, 2010 10:59 AM

Former Member
0 Kudos

Hi,

You can derive the approvers for the seconds step in the same way as you determined the approvers for the first step. You can determine who approved in the first step in the APPROVAL_HISTORY_TABLE which you have available in the BADI.

Regards,

Sjoerd.

Former Member
0 Kudos

Thank you Sjoerd Santegoets

Former Member
0 Kudos

Hi Sjoerd Santegoets

The approval_history table is always unassigned.

I have checked this even in production.it still remains initial,even after the approvals

Please suggest.

Thank you

Former Member
0 Kudos

Hi,

How did you check this? The table is not filled directly from the WF container. I have never had problems with the APPROVAL_HISTORY_TABLE yet.

Regards,

Sjoerd.

Former Member
0 Kudos

sorry Sjoerd Santegoets

I find that assigned but i have this issue.

If the approval branch(index) has 5 approvers and If any one of them is approving the APPROVAL_HISTORY_TABLE has all the 5 approvers of that index.

USER1 is one of the 5 users.

When he is approving,the approval table has all the 5 approvers and no where the actual approver of that index is captured.

Can we capture the actual approver based on Sy-Uname?or can u please suggest any other solution.

Edited by: kittu reddy on Aug 16, 2010 5:38 PM

Former Member
0 Kudos

Hi,

You could try to read the agents from the workflow. You could do this by directly querying the tables. In SWWWIHEAD you will find all workitems with the actual agent in field WI_AAGENT. You could also try to read the info using a function like BBP_WFL_DIN_APPR_WORKFLOW_GET, or BBP_WFL_DIN_APPR_CONTAINER_GET. You do need the main workitem for this. You can read this using function BBP_PDH_WFL_WI_FROM_OBJECT_GET.

Regards,

Sjoerd.

Former Member
0 Kudos

HI Sjoerd Santegoets

I have explored these options already,But they dint work.

I need to capture the agent in BADI when he is actually approving the WI.

so that i can avoid him for the next step.

but the agent is captured in database and FMs only after the BADI is executed.

The FM BBP_WFL_DIN_APPR_WORKFLOW_GET also returns all the agents that belong to that approval index rather than the person who is actually approving it.

example: Approval index 1 has user1,user2 and user3.

when user1 is approving the WI, the database and as well as the FM's have all the 3 users info .

but i need only user1 to avoid it in the next step..so that in the next step i can send only to user2 and User3.

I only need to capture the User information who is actually approving it only at the time of approval as this is when the next step of approvers would be determined in the BADI.After he approves the WI will immedeately route to the next step of approvers,so i need to capture it only when approving.

As of now i am using Sy-uname to capture the actual user approving..Please let me know if this could have any limitations.

Answers (0)