Wrong Agent Determination in Shopping cart Workflow

Hi All,
I am having problem in shopping cart workflow.
If we create shopping cart with 15 or more line items then Approval is going to wrong line item cost object owner. However if we create shopping cart with 14 line items then it showing correct financial Approver. Even we raised one more shopping cart with value similar to 15 line items shopping cart and it also going to correct Approver.

After 2 days of debugging i found where is the problem. I am explaing this below.
First i created 2 Shopping cart. First one has 14 Line item which shows correct Agent.
                                              2nd one has 15 Line item which shows wrong Agent.
        CALL METHOD l_o_pdo_sc->get_item_detail
          EXPORTING
            iv_item_guid = l_r_item_guid->guid
          IMPORTING
            et_item      = l_i_item_i
            et_account   = l_i_account_i
*MOD-002:Begin
            et_limit     =   l_i_limit_i.
        APPEND LINES OF: l_i_limit_i TO l_i_limit.
        APPEND LINES OF: l_i_item_i TO l_i_item,
                                       l_i_account_i TO l_i_account.
Case for First SC.
l_i_account_i  has value of Line Items. First line item suppose 1L.
After appending the l_i_account(2nd itab) has also first .line item 1L.
Case for 2nd one.
l_i_account has value of Line Items. First line item 1L.
But after appending the l_i_account has no first line item 1L.
Please give some solution to this problem.

Similar Messages

  • Use HR Structure for Agent Determination in Shopping Cart Workflow SRM7.0

    We are implementing a Shopping Cart Approval Workflow in SRM 7.0. The process is that the Requester creates a Shopping Cart and an approval process will take effect.
    The approvers will come from an HR structure wherein the direct superior (or supervisor) is the first approver. The second approver is the direct superior of the first approver; and so on, until the Shopping Cart is approved. A maximum of 7 approvals can be done in a Shopping Cart document.
    I would like to ask the following:
    1. How can I achieve this in our WF? I tried to implement BADI /SAPSRM/BD_WF_RESP_RESOLVER but I was not able to activate it (there are other active implementations for this in Shopping Cart).
    2. If there are other suggestions on how to accomplish this, please let me know.
    Thanks in advance for your help.

    Thanks Masa.
    We created 2 custom expression for our requirement and copied FM /SAPSRM/WF_BRF_0EXP001 to put values on those expressions. Then, on our BRF we compared these 2 expressions. After putting the Eval. ID on the process level configurations, we were able to see in SLG1 that the fields are populated correctly. However, we just put constant values on the custom expressions so we can proceed with testing.
    There is one problem in terms of populating the other custom expression. This expression is for the Level of the Manager. I understand that this custom expression is populated before RR_MANAGER_OF_MANAGER. I would like to understand how to get the next approver in the copy of FM /SAPSRM/WF_BRF_0EXP001. In this way, I can get the Manager Level from table HRP5581 and use this to compare with the Release Strategy. If this will not work, is there a way to get the work item ID for the WF so I could get the previous approver then get the superior of the that previous approver and then get the Manager Level from there?
    Currently, only the GUID and Object Type is populated in the FM. Can I reuse some of the fields from other expressions so I can achieve my requirement?
    Thank you very much for your help.

  • Shopping Cart Workflow Problem is not able to determine agents

    Hi Experts,
    We are facing a problem in SRM 5.0 shopping cart workflow. Normal flow is as follows: -
    Create SC > Goes for Approval to level 1 approver > Item appears in Approver's list > L1 approver approves it > Follow - on Document is created.
    Currently while creating shopping cart, we are able to see name of approver in approval preview. Still that item doesn't appear in approver's list. We checked in workflow log, it is getting stuck in task which is supposed to determine next level approver.
    Currently approval is done using workflow template WS14000133 and BADI BBP_WFL_APPROV_BADI. In this BADI we are able to find approver perfectly but that is not getting filled in the container of workflow. The Approver List of workflow container is appearing blank.
    Any pointers to this issue will be helpful
    Thanks
    Siddarth

    Hi Ricardo,
    In BBP_WF_APPROV_BADI we have implemented Method GET_REMAING_APPROVERS. The code snippet of method is as follows: -
    CALL METHOD EXITINTF->GET_REMAING_APPROVERS
      EXPORTING
        IN_UPDATE = IN_UPDATE
        DELETE_REJECTED_ITEMS = DELETE_REJECTED_ITEMS
        ITEM_DEDUCT_RESET = ITEM_DEDUCT_RESET
        ITEM_APPROVAL_HISTORY_TABLE = ITEM_APPROVAL_HISTORY_TABLE
        APPROVAL_HISTORY_TABLE = APPROVAL_HISTORY_TABLE
        ACTUAL_APPROVAL_INDEX = ACTUAL_APPROVAL_INDEX
        GUID = GUID
        OBJECT_TYPE = OBJECT_TYPE
        OBJECT_ID = OBJECT_ID
      IMPORTING
        APPROVAL_TABLE = APPROVAL_TABLE
        APPROVAL_ADMINISTRATORS = APPROVAL_ADMINISTRATORS
        ITEM_APPROVAL_TABLE = ITEM_APPROVAL_TABLE
        NO_FURTHER_APPROVAL_NEEDED = NO_FURTHER_APPROVAL_NEEDED
      CHANGING
        ITEM_APPROVAL_OBJ = ITEM_APPROVAL_OBJ.
    Now can you please tell me which variable I am suppose to look at?
    Thanks
    Siddarth

  • Agent determination issue in a workflow

    Greetings everyone!
    I'm configuring some business scenario with the help of a business workflow in SAP CRM 7.0 I'm using activity step and want to determine agents using standard SAP rule 10000162 ("Employees for responsible org. unit"). I've tested the rule outside of the workflow and it's working fine, but  in workflow it fails to determine an agent.
    In a log I see following errors:
    Agent determination for step '0000000023' failed;
    Result of agent resolution does not agree with agents of task;
    I've made some tests depending on what assignment task has:
    1. When it is a general task, work item was created for a workflow initiator even though rule failed to determine an agent.
    2. When it is a task with general forwarding with assigned position(s), which rule will never determine, work item was created for holder(s) of that position(s).
    3. When it is a task with general forwarding with no assignments, workflow could not determine an agent as expected.
    I've also debugged functional module for that rule and it determines appropriate agent but then do some check with the help of RH_TASK_AGENT_CHECK function and returns an error.
    Can someone help me with this problem? Is it some standard expected behavior or not?
    Maybe something wrong with the org. plan?
    All answers are appreciated.
    Thanks in advance,
    Alex.

    Hello Rick and Eddie.
    I've tried to assign user directly instead of position to a task with no help. I get the same result.
    I've tried to set a task as a general task and made the rule to fail if there is no resolution and it fails.
    I've tried to assign position or user directly to activity in a workflow and it does work but that's not what I need in my scenario.
    As I said earlier I've tried to debug that rule invoked from a workflow. I will post some screenshots for you.
    I set a task as a general task and assigned rule 10000162 (ABBR="PARTNER_1", Name="Employees for responsible org. unit") to activity step in a workflow and here is what I get:
    1. Function CRM_ORGMAN_ORGOBJECTS_FIND_2 gets called by the rule and resp. sales org. unit is passed there ([screenshot1|http://www.picdrop.net/?v=debug1.png])
    2. Next function CRM_ORGUNIT_GETEMPLOYEES gets called passing id of a resp. sales org.unit without a type.
    3. Next RH_STRUC_GET gets called and returns result table with position and central person for that position ([screenshot2|http://www.picdrop.net/?v=debug2.png])
    4. In the end of CRM_ORGMAN_ORGOBJECTS_FIND_2 function only central person in inserted to the actor_tab ([screenshot3|http://www.picdrop.net/?v=debug3.png])
    5. After CRM_ORGMAN_ORGOBJECTS_FIND_2 ends we appear in a RH_GET_ACTORS function where we can see that agent check is performed if act_task is not initial. I assume that check is not performed if we do a simulation of a rule ([screenshot4|http://www.picdrop.net/?v=debug4.png])
    6. Then RH_TASK_AGENT_CHECK function gets called for every record in a actor_tab. In out particular case it's one record. ([screenshot5|http://www.picdrop.net/?v=debug5.png])
    7. Inside that function checks act_wi_id (activity work item id?) if it's initial and get exluded agents. It is initial in my case ([screenshot6|http://www.picdrop.net/?v=debug6.png])
    8. Then function tries to read table with keys equal to type and id of found agent and errors there, perhaps because there is no record in that table ([screenshot7|http://www.picdrop.net/?v=debug7.png])
    That error results in overall agent determination failure.
    Hope this screenshots will help to identify a problem.
    Why read table results in an error and because of that all rule fails?
    Regards,
    Alex.

  • Moving the Shopping Cart workflow forward in a approver Rejects a line item

    Hi Friends,
       We a facing an issue while Shopping Cart Approval process.
    We have designed our SC Workflow , with Schema and 4 Process levels. Currently the Approvals are happening fine.
    Issue is happening when a Line Item is Rejected by a Single Approver. The Approval process does not move forward.
    We need need to move the SC process forward.
    Ex: SC: 1000000032
    Approval Flow:
    ITEM1:  APP01 -> APP02
    ITEM2:  APP05 -> APP07
    Scenario:01 :
    Once APP01 & APP05 approves in first level.  Then APP02 & APP07 approves . Then the process completes.
    Scenario:02:
    Once APP01 Rejects & APP05 Approves in first level. Then the SC WF does not move forward.
    How can I move the WF process forward once a approver rejects.
    Need your inputs.
    Regards,
    Jagan

    Hello Markus,
    what you describe does not correspond to condition standard determination to know if decision has to be checked or not.
    Indeed, this evaluation is done by /SAPSRM/IF_WF_PROCESS_SBWF~IS_DECISION_ACCEPT_REQUIRED method from /SAPSRM/CL_WF_PROCESS_SBWF class.
    Inside this method, the default behavior is based on decision of current process level:
    - If it is not "rejected" or not "approved" (this means, if it is "inquired"), there is an interaction
    - else, there is no interaction.
    Then, for "rejected" or "approved" decision, a Business Rule evaluation is done in order to check if the document responsible need to accept the current decision.
    If evaluation ID is true, acceptance by Contact Person is required.
    I am currently not able to check workflow behaviour for partial rejection when no acceptance by contact person is customized.
    I will see this next week.
    Regards.
    Laurent.

  • Shopping Cart workflow retrigger for changes done to SC already created

    Hi all,
    A shopping cart is created and later on in "Check Status" when the shopping cart is opened in change mode and any changes are made to the shopping cart either header or item level, the whole approval workflow is retriggered and the approvers are determined again.
    We have a scenario where for a particular account assignment category the approvers are added manually - ad hoc approvers through the "Add Approver" in "Approval Preview". For these shopping carts with manual approvers when in "Check Status" any changes are done to header or items of the shopping cart, the whole approval workflow is retriggered and the manual approvers previously added are refreshed as per standard SAP.
    I have to put a check in DOC_CHECK badi for the existence of approvers. If no approvers found an error message has to be thrown for adding the approvers manually. I am doing this by reading the approvers from the container for a cart created already. But when changes are made and the workflow is retriggered, the workflow container contains only the previous approvers and not the refreshed ones. So this is not captured in DOC_CHECK badi.
    Is there any way to capture the retriggering of workflow in DOC_CHECK badi, so that the check for approvers works fine even after a change being done to a shopping cart which is already created.
    Thanks and Regards,
    Asha

    Try this FM BBP_PDH_WFL_APPROVAL_SIMULATE
    Regards, IA

  • AD-hoc approver n step item level shopping cart workflow

    Hi
    We are on latest version of SRM and using n step item level SC approval workflow.
    The scenario goes like this:
    -     Requester creates shopping cart and workflow goes for two step approval.
    -     In the approval preview the requester is able to see both levels of approvers, which is correct.
    -     Requester now selects second level approver and replaces him with a ad-hoc approver. WE DO NOT WANT THIS.  Requester should NOT be able to replace an approver determined by approval badi. However should be able to extend approval step with ad-hoc approver say third level approver a ad-hoc approver. Also he should be able to change AD-HOC approvers ONLY.
    Thanks
    Joe

    Jo,
      You may be able to achieve it in the BADI BBP_WFL_SECUR_BADI .
    You can use the Business Add-In (BAdI) BBP_WFL_SECUR_BADI to determine whether
    A shopping cart can be changed during the approval process
    The approval workflow restarts when changes are made to the document
    A reviewer/approver can be added or changedThese are the call scenarios (see import parameter SCENARIO).
    Regards,
    Suren

  • Agent determination in price variance workflow

    Hi all,
    I am facing some problem in workflow, can any one help me.
    for determing the agent in case of price variance in invoice we are using the rule 009000010(object type T024 is assigned). Can any one tell me how this determines the agent based on purchase group?
    now we have a requirement to change the behavior of determining the agent. If the Purchase order is crated by the temporary user(we have some temporary users), the agent determination should be like standard (like 009000010 rule), and for all other users we have to assign the agent name as same as user name.
    now for solving this i am planning to create a new rule of type "F"(Agent determination :function to be executed) and assigning a new function module.
    Function module will have two import parameters "puthcase group" "purchase order number". Using the purchase order number i will get the user, after that i will find the user type. If the user is temprory i have to determine the agent like standard way (like rule 009000010(object typeT024). Can any one please tell me how the rule 009000010 will determine the agent for the purchase group.
    Thanks & Regards,
    Raghu

    That rule is not available in the sandbox system I have access to, so it can't be a basic rule. Either it is customer-specific, or it belongs to some industry solution or add-on package.
    Generic advice: why don't you simply investigate how this rule solves its task? You can even copy it as a starting point for your own rule.

  • Agent determination failed in Standard Workflow.

    Hi Experts,
    I am new to workflow and we are trying to implement the standard HCM process of Transfer.
    The worflow is giving this error.
    Error when processing node "000000032"
    which further says Agent determination failed for step "000000032"
    Pls help and guide what can be done to resolve it.
    We have checked the Org Structure.
    Regards,
    SV

    Hi,
    Thank you for your reply,
    Which std workflow you are using ?
    We are using the WF WS17900427.
    Are you using portal to trigger the workflow and webdynpro screen for approval or adobe form for approval ?
    Yes
    If the agend resolution is getting failed. What role number ?
    Rule ID 17900012.
    Have your tested individually from PFAC t-code. Is it giving the correct agent from there. check from there.
    Testing individually (onclick of Stimulate rule resolution).
    Runtime Error MOVE_CAST_ERROR
    Exception     CX_SY_MOVE_CAST_ERROR
    Regards,
    Sanjyoti.

  • Shopping Cart Workflow - "Wait for change event" not firing?

    Hi there,
    I have a scenario where if I create a shopping cart above my spending limit it will go into the approver's inbox, that is fine.
    Now if I change the total value of the shopping cart to be within my spending limit the original workflow should be "logically deleted" and a "no step approval workflow" should be triggered.
    I see when the SC workflow triggers it also branches with a "wait for events", so that if it changes etc it will get caught here.
    When I change the SC it does not do anything, the value of the cart changes but it still sits in the approvers inbox and the "no step approval workflow" does not trigger.
    We are busy upgrading to SRM 5.0, it worked perfectly in the SRM 3.0 system we had.
    Any ideas what would cause the "change event" not to fire?
    Thanks for the help
    Lynton

    Hey Masa,
    You are the man!! That solved it.....I have implemented the BBP_WFL_SECUR_BADI and for whatever reason I set the security level to 4 when it should have been 2.
    4     "High" (workflow is never restarted when changes are made)
    3     "Medium" (WF restarted conditionally when changes are made)
    2     "Low" (workflow is always restarted when changes are made)
    1     "None" (changes to the object are not allowed)
    0     "Not defined"
    Thanks for the help
    Lynton

  • Free Text Shopping cart WorkFlow

    Hi,
    I have to know if a shopping cart was created from a Free text item or from catalog before the WF starts (in a check funtion module).
    Is there any way to know if the shopping cart was created from free text or catalog?
    Thanks

    Hi,
    As per my understanding, you want to make decision, if it is Free text you need to start one work flow, else another workflow.
    This check you can do it in Starting conditions of the workflow. SWB_COND (Transaction).
    Go to SWB_COND, choose business object BUS2121, it will display all work flows which are event linkage activated.
    Now go to specific workflow which you need to start if it is Free text Shopping cart, if the condition is true workflow will start.
    If starting conditions are complex, suggest you to create new attribute and use the same in starting conditions.
    Hope this will be helpful, all the best.
    Regards,
    Mohan Vamsi

  • Change Shopping Cart Workflow

    Trying to figure out a way to route the shopping cart back to the requestor at all points during the approval process. There are customizations made to the workflow such as a finance reviewer, a commodity approver, manager (org hierarchy) and a financial approver (for $50K+). Client wants shopping cart to come back to approver at any point. Any suggestions?
    Thanks in advance.

    Basically, what we want to do is to route the shopping cart back to the requestor at any point in the approval process. Commodity Approval is based on material group, Manager Approval is based on shopping cart amount and org hierarchy, CFO approval is based on shopping cart amounts over $500k.Approval amounts are nased on a Z-Table. Using workflow WS14000133 n-step approval of shopping cart (BADI)
    Thanks for the response so far! Let me know if you need any additional info MJ!

  • Purchasing group determination in Shopping cart

    Hi All,
    when I am creating Shopping cart and choose Free Text  Describe what you want  and then I find that Purchasing group filed at item data tab is not available.
    But when I am selecting select goods/service and choose Product Id then shopping cart  is determining back end purchasing group and purchasing group field is shown at Item data tab.
    why SC is not showing Purchasing group field for free text items.
    Can any one has this similar issue in your system.
    I am on SRM7.01 Extended classic scenario.
    Abdul Raheem

    Hi Nikhil,
    If I choose the one material for the same product category in SC , it is picking back end purchasing group.
    But If i am choosing free text item and selects the same product category , Purchasing group field, it self is not showing in SC.
    I wonder, if I create a Local purchase group, and create a  free Text SC for the same product categoy, it is picking local Purchaing group.
    Abdul Raheem

  • Shopping Cart workflow error

    Hi,
    We have just started with the setting up of the SRM 5.0 system. Scenario is Classic. we have activated the Shopping Cart without approval WF, however, when a SHC is created the system shows the status of SHC in Approval. Dont know what i have missed.
    Full points will be awarded.
    Thanks in advance,
    Amit

    Hi,
    Sorry guys, i guess this was a false alarm. I had not completed the settings for SWU3. Issue seems to be resolved.
    Thanks
    Amit

  • How to find Shopping Cart Workflow?

    Hi Experts,
    I want to find which work flow is triggered when I create a shopping cart. Can you please tell me the way to find this?
    Thanks
    Siddarth

    Hi Masa,
    List of message are as follows: -
    02/02/2010  05:04:48  20  Level  00000000000000088721
    @5D\QWarning@     Event 0EV_SC_001 get description error
    @5B\QInformation@     10 Execute event 0EV_SC_001 Check Existence of Free Text Item (Shopping Cart). 02/02/2010 03:04:48
    @5D\QWarning@     Expression 0B_SC_XSTFRTXTLNTM get description error
    @5B\QInformation@     41 Execute expression 0B_SC_XSTFRTXTLNTM An item exists from a free entry; result is empty
    @5D\QWarning@     Expression 0C_C1_C_FWFSCRLCNTNT get description error
    @5B\QInformation@     51 Execute expression 0C_C1_C_FWFSCRLCNTNT Class: /SAPSRM/CL_WF_RULE_CONTXT_SC; result /SAPSRM/CL_WF_RULE_CONTXT_SC
    @5D\QWarning@     Expression 0C_C2_C_GET_PROPERTY get description error
    @5B\QInformation@     51 Execute expression 0C_C2_C_GET_PROPERTY Method - Get Atrribute Value; result GET_PROPERTY
    @5D\QWarning@     Expression 0C_C3_C_XSTFRTXTLNTM get description error
    @5B\QInformation@     51 Execute expression 0C_C3_C_XSTFRTXTLNTM An item exists from a free entry; result EXISTFREETEXTLINEITEM
    @5D\QWarning@     Expression ZCHECK_FREE get description error
    @5B\QInformation@     41 Execute expression ZCHECK_FREE ; result is: =blank
    @5D\QWarning@     Expression ZR_FREETEXT get description error
    @5B\QInformation@     51 Execute expression ZR_FREETEXT ; result FREE
    @5D\QWarning@     Expression 0C_C1_C_FWFSCRLCNTNT get description error
    @5B\QInformation@     63 Execute expression 0C_C1_C_FWFSCRLCNTNT Class: /SAPSRM/CL_WF_RULE_CONTXT_SC; result /SAPSRM/CL_WF_RULE_CONTXT_SC
    @5D\QWarning@     Expression ZCHECK_PRICE get description error
    @5B\QInformation@     51 Execute expression ZCHECK_PRICE ; result G
    @5D\QWarning@     Expression 0C_C1_C_FWFSCRLCNTNT get description error
    @5B\QInformation@     63 Execute expression 0C_C1_C_FWFSCRLCNTNT Class: /SAPSRM/CL_WF_RULE_CONTXT_SC; result /SAPSRM/CL_WF_RULE_CONTXT_SC
    02/02/2010  05:04:48  8  Level 00000000000000088723
    @5D\QWarning@     Event 1EV002 get description error
    @5B\QInformation@     10 Execute event 1EV002 SRM WF BO-SC Approval Step 1. 02/02/2010 03:04:48
    @5D\QWarning@     Expression 1B_SC_GEN_APPROVAL1 get description error
    @5B\QInformation@     42 Execute expression 1B_SC_GEN_APPROVAL1 SRM WF BO-SC Generated Formula for Approval Step 1; result is: =blank
    @5D\QWarning@     Expression ZR_COSTCNTR get description error
    @5B\QInformation@     52 Execute expression ZR_COSTCNTR COST CENTER OUTPUT; result is empty
    @5D\QWarning@     Expression 0C_C1_C_FWFSCRLCNTNT get description error
    @5B\QInformation@     63 Execute expression 0C_C1_C_FWFSCRLCNTNT Class: /SAPSRM/CL_WF_RULE_CONTXT_SC; result /SAPSRM/CL_WF_RULE_CONTXT_SC
    Please check
    Thanks
    Siddarth

Maybe you are looking for