cancel
Showing results for 
Search instead for 
Did you mean: 

SHOPPING CART APPROVAL ISSUE

Former Member
0 Kudos

Hi,

I have a requirement where i need to stop the substitute for the approver from approving the shopping cart if he is same as requestor.

Suppose the requestor A has approver set as B and B has active substitute set as A, so in this case if A raises a shopping cart it will come to him for approval also as he is B's Substitute.

I want to stop this scenario.

N-level approval Workflow is used for here.

what I have found till now is that N-level approval calls I BBP_WF

APPROVBADI. which can be coded as per requirement but the mail or approval workitem goes to substitue after this BADI call so substitute cannot be controlled here.

I don't want to use BBP_DOC_CHECK_BADI for 2 reason firstly it wont stop the mail or approval going into inbox of A , it will only give error message which A tries to approve. secondly i want this logic for off- line approval too so in that case this BADI wont be of much use.

Accepted Solutions (0)

Answers (1)

Answers (1)

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

How about excluding the approver B in your N-Step BADI logic if requester A is active substitute of approver B.

I would also implement CHECK_BADI because substitute can be set after workflow is started.

Regards,

Masa

Former Member
0 Kudos

Can you please elaborate.

Presently what happens is that when A raises a shopping cart it goes to B as well as A(as A is substitute). I want that it should only go to B and not to A .

Secondly you said you would have used CHECK_BADI as substitutes can be set even after the the workflow is trigerred , can you please explain this and also let me know how it will work in offline becuase check_badi gets tiggered when approver presses check or approve button but in offline trapping this event is not possible.

please do reply

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

1. My idea was if A is active substitute, B should not be the approver. Exclude B in the N-Step BADI logic.

2. It is no problem because offline approval does not go to A. If you want to check inbound data, you can implement BAdI Customer Enhancement of Offline Approval (BBP_OFFLINE_APP_BADI), method RECIPIENTS_GET CHK_SENDER_IND_SET.

Another possible function is Substitute profile. You can exclude specific task.

http://help.sap.com/saphelp_nw70/helpdata/en/8d/25f558454311d189430000e829fbbd/frameset.htm

Regards,

Masa

Edited by: Masa on Nov 18, 2009 11:29 AM

Former Member
0 Kudos

Hi Masa,

Can you please let me know which task in N-level SRM workflow takes care of this substitute handling

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I think SC approval is TS10008126. Please chek it in PFTC transaction.

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

I wanted to know that is it possible to check in workflow where the substitues are getting assigned and then compare it with the shopping cart requestor and if same then not send workitem to him.

I mean whereever we are send workitem to the substitute if we can check if he is the requestor then maybe we can stop sending the workitem to him.This will solve my problem.But i am not able to figure out where this substitute is getting determined.

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

It is possible that workflow checks substitute but it does not solve your issue.

I think DOC_CHECK BADI solution fits your issue. I think you have already tested the DOC_CHECK BADI solution.

What was test result?

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

The issue with doc_check_badi is that first of all it wont stop from sending workitem to to substitute , it can only be helpful in not to allow him to approve, secondly same logic needs to be implemented for offline approval wherei dont think doc check badi would be triggered .

Regarding workflow do you have any idea where the substitues are checked in workflow , i mean which task .

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

It looks some misunderstanding for the issue and solution.

My comment was for DOC_CHECK_BADI when approving SC.

Here is my understanding:

- workflow never sends workitem to substitute. only approver gets workitem

- substitute is for inbox visibility

- substitute can be changed anytime

- If substitute changed after workitem creation, there is possibility requester to be a substitute.

- so checking substitute when creating workitem does not solve the issue

Issue:

You said substitute can approve own requested SC

Possible solution:

If inbox shows own requested workitems, change the logic for inbox display and exclude own workitems.

When substitute try to approve own shopping cart, DOC_CHECK_BADI can gives error message.

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

What do you mean when you say that substitute is for inbox visibility and the workitem doesnt go to the substitute?.Presently in our case if A raises a shopping cart for approval to B and A is also B's substitute then in the shopping cart is visible in both A and B approval page of SRM and any of A and B can approve.

So there are two solutions

1) even if SCart is in A approval page when he tries to approve it we can restrict him using DOC_CHECK_BADI -


> but the issue with it is it will work fine with online approvals but for offline approvals where suppose mail goes to A and B and A is trying to approve it this badi wont get triggered and so we wont be able to restrict him.

2) We do something to that once SHOPPING CART is created then it doesn't go to A at all(as he is the substitute as well as creator) it only goes to B if we can do something like this then it will handle both online and offline scenario . Issue with this is that in workflow i am unable to figure out where to put this logic where i can check so that the shopping cart doesnt go to A approval page.

I am really grateful to you for your patience but please do help me out in this.

Former Member
0 Kudos

sorry forgot to add that we are on verion 4 so BBP_OFFLINE_APP_BADI is not available to us

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Summary:

Online Approval - OK. DOC_CHANGE_BADI can check it.

Offline Approval - ?? I think this is also OK because SC requestor does not receive offline approval email.

Please confirm offline approval email does not go to A. What was your test result ?

Regards,

Masa

Former Member
0 Kudos

Hi Masa,

Thanks for your input i will check offline scenario i was assuming that for offline also it goes to A. meanwhile what i was trying is this

I have created a rule and i want that the userid which the rule fetches (here the substitute id if he is same otherwise blank)should be in excluded agent .Can anyone please help me in this.

Had it be normal agent then i could have selected Rule from the drop down and given the rule number but how do i do this for excluded agent how do i bind it to workflow.

Former Member
0 Kudos

Hi Masa,

Even in offline scenario the workitem goes to the susbtitute.

Suppose i have rule number 000358 how do i bind it to that excluded agent table of workflow container.

Where do i give this rule number in task container so that i can see it during binding?I am unable to assign it to task container.

see presently i am having AGENT as expression and its value is &ACTUALAGENTS& and excluded agent textbox is blank like TS10008126 .Now with ths setting the workflow is sending workitem to the actual agents now if i substitute this with AC RULE wont this binding get affected and the workflow wont send workitem to &ACTUALAGENTS& as i would be replacing it by rule.

Former Member
0 Kudos

I have removed all my methods and rule just have put wf_initiator as excluded agent but still workitem is goin to him.

Means substitute logic is bypassing the excluded agent logic.