cancel
Showing results for 
Search instead for 
Did you mean: 

Last Approver determination

Former Member
0 Kudos

Dear All,

I am working in PCW for Contract.

We are getting the process level based on the approval limit of the user.

1. While creating a Contract , in the approval tab, there is 3 approver as per the approval limit and the value of contract.

But when we assign the subsitute for Approval 3 as Approval 2, when the approver 2 , approves 2 times then the approval limit is recalulated and

go to next approver 4.

Actually it should not go to approver 4. as per the contract value and approval limit.

we use the /SAPSRM/CL_WF_RULE_CONTEXT-PREV_APPROVAL_LIMIT method to get the approval limit of previous approver. It is getting problem, when we subsitute or Forward the workitem to previous approver.

Kindly help to overcome this issue/


Accepted Solutions (0)

Answers (1)

Answers (1)

SandySingh
Active Contributor
0 Kudos

Hi Tamil

As per your requirement you want to put a approval limit check while forwarding or substituting the approval workitem.

You will have to create a implicit enhancement in FM 'SAP_WAPI_FORWARD_WORKITEM' to check the approval limit.

There is a BADI WF_SUBSTITUTE . You will have to implement this BADI. It has 3 methods; you can use the "Restrict....something" method to validate the approval limit..

Check note : Note 977069 - Substitute API: Providing the BAdI WF_SUBSTITUTE



Hope it helps



Regards

Sandy

Former Member
0 Kudos

Dear Sandy,

Thanks for the repsonse.

But the information you have porvided will not suit my scenario.

My issues, The approvers are deteremined based on SLAPPROVER Atrribute in org.structure with Approval limit of each user maintained in attribute are checked with the total value.

We have defined the logic that it will check the preciovs approver limit value with the current approval limt and total value. The below logic is defined in 3, 4 and 5 level of Process levels.

 

( Approval Limit of Processor of Contract > Check Approval limit of previous processor ) AND ( Total value > Check Approval limit of previous processor ).

So, what happens at the runtime, if we assign the substitute or forward the workitem back to the prevoius approver, then the determination for process level happens and moving to next level.

(e.g. only 3 level of approval needed for this contract. We assign the substitute for approver 3 as approver 2).

when the approver 2 approves the workitem of approver3. then based on the above logic determines on process level, it is moving to approver 4. but it should not happen.

So i need to restrict in such a way that it should not go to next level approval.


SandySingh
Active Contributor
0 Kudos

Hi Tamil,

Looks like you will have to store the actual agent determined initially when a process level is evaluated. You can add extra custom field "ACTUAL_AGTS"  in the Shopping Cart header and fill it with the actual agents determined via BADI.

Now if the approval item is forwarded or substituted (say to current agents) then this custom field still has the reference of actual agents. In your process level evaluation code, you can check if the previous approver (actual agents) is same as current then dont trigger the level.

To check Substitution of current user, you can query table HRUS_D2 for validation.

Hope it helps

Regards

Sandy