Change Agents determination

Hi Everyone,
I've copied a standard workflow to a custom one and now I have to change how the approvals will be determined.
I'm trying to do that changing the workflow container through a programmed bindind. I know that it's also possible to change the container using a Program Exit implementing an ABAP class.
I would like to know which of the mentioned alternatives would be the best one. And also if is there any other alternative to do that?
In case of programmed binding, I could not find how specify the class that I want to use for the binding. I only see the Function Module options in the combo box.
Thanks in advance,
Best regards.
Martin

What is your requirement you do not need to do so much complex deveopment only to achieve different agent assignment. Use Rules to determine your user according to your determining factor.
Thanks
Arghadip

Similar Messages

  • Agent determination issue

    Hello Experts,
      We have developed one custom workflow a year back and last two months we are seeing the issue with Agent Determination randomly.  We created a position with 3 users and assigned the Position to the Agent Assignment.  Some times the work item sent to other users other than 3 users assigned to the position.  We are not able to trace it, why it's behaving like this.  Any help would be appreciated.
    with best regards
    K. Mohan Reddy

    If this happens randomely then we can only assume
    Please check the wflow log from SWIA whether someone has forwarded the workitem?
    There can be also change in Position assignment, Substitute getting maintained.
    Also check whether the users are maintained in the Task level if it is General forwarding Not allowed task from the task attribute.
    Thanks
    Arghadip

  • Agent determination problem

    I have a workflow that has been in production for almost a year.  We are in the middle of integration testing for another rollout and I'm getting agent determination errors in this workflow.  There are three steps involved.  The first two use the exact same rule.  The first of these two works fine.  When it tries to run the rule again for the second step, it gets no agent found.  If I test the rule it works.  If I restart the workflow, it works.  When it moves on to the third work item using a different rule, it errors out no agent found.  When I test this rule, it works.  When I restart at this step, it also works.
    This is a new integration client that was copied from production.  I've performed the standard workflow customization like I always do.  I've run several other workflows and only notice the agent determination problems in this one.  The workflow hasn't changed in months although there have been some user security changes...I'm not sure how that could really affect the agent determination during the creation of work items. 
    One thing that might be important...userA created the first workitem and the agent determination resolves to userB.  When userB executes the first work item and completes, the second work item should also resolve to userB using the exact same rule.  This fails.  I restarted it using my account and it resolves to userB.  UserB executes work item #2 and work item #3 should resolve to userC but the agent determation fails again.  I don't know whether the work item agent is "used" to perform the creation of the next workitem or not but this is the only difference between the first two work items and one works while the other does not.
    It's almost like userA can perform the agent determination but userB cannot.  I can't manually execute the agent determination as userB so I ran se37 as myself in debug and changed SYST-UNAME to userB and it worked fine and returned userB as the agent.  That would seem to eliminate security as an issue with the agent determination.

    Hi,
    Are you absolutely sure that it is not an authorisation issue? Can you give SAP_ALL (and the possible structural authorisations) to all the users that are involved in the process? (I don't think that changing sy-uname in debug mode to another user really is a correct way to try to prove whether this is an authorisation issue.)
    The agent determination of the following step is executed by the previous WF agent, if there is no background steps between. So if the previous agent doesn't have enought authorisations, the agent determination will fail.
    Regards,
    Karri

  • Agent determination best practices

    Hi, workflow dev team!
    Another question about workflow best practices.
    I build a workflow, the first step of each workflow, at least as I see it, is to determine agents for all steps in the workflow and store it in multiline WF-container. After that, to use this WF-container data to execute a step inside of workflow.
    The questions are:
    1. Suppose, I filled a WF-container with a list of all possible agents and their position (in order to supply more user-friendly approve/decline notifications) for the different steps inside of this workflow (username & position). As I understand, I can access to specific line of multiline container with &AGENTS[&INDEX&]& inside of EXPRESSION field (not via ABAP-code in method of class), but how can I access specific column of the WF-container? E.g. &AGENTS[1]& will return «USJOHN — Junior Manager», is it possible to retrieve username and position from multi line and pass it to the task as two separate container elements?
    2. Is it possible to query specific line of multiline container element according to some logical condition inside of EXPRESSION field (not via ABAP-code in method of class) or in order to do this I have to implement that logic inside of ABAP class method?
    And the last question, probably, less connected to the questions asked above.
    3. If I need to define agents for the task, what is the best approach to do that:
    — define the task as General Task and insert the relevant agents as multiline container element via EXPRESSION field;
    — to play with Agent Assignment (try to implement agent determination logic there) and not to define the task as general one.
    Thanks.

    Ronen already had great input, but here are some additional points:
    -In general I would try to avoid some kind of "Let's get all the agents at the beginning of the workflow into a multiline container, and try to pick up the correct ones for the individual steps" approach. Of course if your aim is just to display the list of agents somewhere (task description etc.,), then this might be OK approach.
    -Rules are better than expressions in agent determination (at least in most cases). If the approvers change during the process, you can (as an WF admin) just click the "Execute agent rule again" functionality, and the system will find the correct new approver for the work item. Otherwise you need to go to manipulate the container element(s) (and first figure out that who is the approver).
    Answer for 3: You don't need to use only expressions/container elements. Try to check if you can use rules. In some rare cases you might consider of using the tasks' agent assignment (the same place where you set the task as general task). Let's say that you want to send the work item to all users that have certain authorization role. Now you can set the role as a "restricting entity" at the task level (=same place where you set the general task). This will mean that only the users who have the role are the possible agents for the task. And now if you leave the agent determination part at the workflow template empty (no expressions, no rules etc), you are done!
    Regards,
    Karri

  • Agent determination error

    Hi all
    I am trying to configure a workflow for PO release , the Business object am using is BUS2012 in ECC6.0
    Whenever a PO is rejected i need to send the work item to the user(Workflow initiator)  who created the PO .
    I created a standard task and i am using it in the work flow, where the agent is determined using expression (WF initiator) . The standard task is set to general task.
    But the worflow fails at this step due to this error "Agent determination for step failed" and details say "Result of agent resolution does not agree with agents of task" which is SWF_RUN 544
    I did refresh the worflow buffer using tcode SWU_OBUF and also refreshed organizational settings in SBWP.
    Is there something which is still missing.
    appreciate your help.. Thanks
    Nataraju

    Hi Nataraju,
    Select the WF initiator from agent dropdown in standard task as shown in screenshot below
    Make sure you activate the WF template and Use transaction SWU_OBUF before you trigger the WF.
    It is good to execute Transaction SWU_OBUF after you make changes and activate the WF
    Regards
    Sandy
    Message was edited by: Sandy Singh

  • 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 in Workflow

    Hi,
    I am implementing a workflow for change in basic pay, the problem is i am not clear how to go about agent determination,  i need to follow my organizational structure but not completely like its not like the complete hierarchy. I need ideas, and some what how to go about it.
    Thanks.
    Khusro Habib

    Hi,
    Do you know who should be notified of the change in Basic Pay? is it the Employee's supervisor? If it is the Supervisor.. create a method.. In the method start off with the Employee's PERNR.. Grab the position from infotype 0001.. look up HRP1001 subty B002 to see who this position reports to.. you will now have the supervisor's position in HRP1001-SOBID.. do another look up on HRP1001 SUBTY A008 to get the pernr of the supervisor in HRP1001-SOBID.. got infotype 0105 SUBTY 0001 to obtain the User id of the supervisor.. notify the supervisor of the chnage in Basic Pay...
    Hope this helps..
    Suresh Datti

  • Agent determination for SRM WF

    Hi All,
    I have developed a custom WF i.e. copy of 2 step Invoice approval WF.
    For agent determination, I have put in logic for Adhoc agent, which is working fine.
    My query is that I can have multiple agents for a particular step, which I am able to see when referring to approval preview.
    However when i try to change one of the entries for agent , system replaces <i>all entries</i> with changed entry for an agent.It does not change the one particular agent out of these multiple agents.
    Wanted to know is it the std behaviour that at the time of changing the agent, evenif we have multiple agents , it will be chaged to only one agent - which is being replaced ?
    Awaiting your inputs.
    Regds,
    Akshay

    Hello Abraham,
    To understand what's happened, you will need to debug /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_AREA_TO_ITEM_MAP and /SAPSRM/IF_EX_WF_RESP_RESOLVER~GET_APPROVERS_BY_AREA_GUID methods from /SAPSRM/CL_IM_WF_RR_PGRP_SC implementing class (interface for BAdI definition /SAPSRM/BD_WF_RESP_RESOLVER from enhancement spot /SAPSRM/BD_WF_AGENTS )
    If mapping between area and item is correct, see why purchasers from purchasing group(s) are not correctly found by debbuging /SAPSRM/IF_WF_AREA~GET_RESPONSIBLE_APPROVERS method from implementation /SAPSRM/CL_WF_AREA_PURCH_GRP.
    Regards.
    Laurent.

  • Agent Determination Rule using Function Module

    Hi all,
    I am trying to create a custom agent determination rule using function module. But my rule is not getting invoked when the workflow is executed.
    I created a custom rule and linked my function module (with proper signature).
    FUNCTION 'ZRULEXXX''
    ""Local Interface:
    *"  TABLES
    *"      AC_CONTAINER STRUCTURE  SWCONT
    *"      ACTOR_TAB STRUCTURE  SWHACTOR
    *"  EXCEPTIONS
    *"      NOBODY_FOUND
    And I am hard coding some values into table ACTOR_TAB
    REFRESH ACTOR_TAB.
    CLEAR ACTOR_TAB.
    IF SY-SUBRC NE 0.
        RAISE NOBODY_FOUND.
      ELSE.
        ACTOR_TAB-OTYPE = 'US'.
        ACTOR_TAB-OBJID = 'XXXX'.
        APPEND ACTOR_TAB.
        ACTOR_TAB-OTYPE = 'US'.
        ACTOR_TAB-OBJID = 'XXXXXX'.
        APPEND ACTOR_TAB.
      ENDIF.
    But a worklist item is not being created for the users appended to ACTOR_TAB.
    Is there anything am missing. Please let me know.
    Thanks in advance
    Regards
    Raju

    Hi,
    Change it to following code. It will work.
    REFRESH ACTOR_TAB.
    CLEAR ACTOR_TAB.
    *IF SY-SUBRC NE 0.
    *RAISE NOBODY_FOUND.
    *ELSE.
    ACTOR_TAB-OTYPE = 'US'.
    ACTOR_TAB-OBJID = 'XXXX'.
    APPEND ACTOR_TAB.
    ACTOR_TAB-OTYPE = 'US'.
    ACTOR_TAB-OBJID = 'XXXXXX'.
    APPEND ACTOR_TAB.
    *ENDIF.
    Regards,
    Vaishali.

  • Agent Determination Rule Not Working

    I have created an new agent determination rule in PFAC.
    The category I used is "Agent Determination: Responsibilities".
    I have also selected the "Terminate if Rule Resolution has no Result" option.
    The container has one element in it which is NOT mandatory called "Clinic".
    I have set up the responsibilities, where there is only one which catches all - In other words, I created a responsibility for Clinic "*". I have also assigned a position as a responsible agent. The position is linked to a person number, and the person has a user-name assigned - All are in the valid period.
    If I test the rule, and do not enter anything for the Clinic, and click the test button, it returns my one agent, which is correct.
    The problem is that in my workflow I have assigned the rule as a responsible agent. At runtime, the workflow falls over saying that the agent determination has failed. This does not make sense, since I have not passed anything in binding to the rule. As mentioned earlier, when testing it works fine. I have tried using the rule with and without binding but it wont work. If I change the step in the workflow to rather use  position, it works.
    Please let me know if you have any ideas - I am really battling with this strange problem.

    I tried deselecting "Terminate if Rule Resolution has no Result" in the rule definition.
    Having done that, the workflow now works correctly - It actually DOES find an agent and the workflow goes on as expected.
    This is really weird, because if the terminate option is selected, it falls over saying that no person was found. Now with the terminate option not selected, it finds the agent - Is this a bug, or am I misunderstanding something???

  • Runtime Agent Determination

    Hi
    Still having problems with my workflows.
    I need to get agents from a Ztable at runtime. I have gone through this blog entry :/people/ravishankar.rajan/blog/2006/12/26/agent-determination-in-workflow-using-custom-table
    I have ztable with user names and their managers.
    I have attached this workflow to the customer Master. Created an entry related to DEBI ni change documents
    I have created a copy of the zsystem and made a method- Get agent-
    This is my code for the method
    begin_method get_manager changing container.
    data:
          actuallyprocby type wfsyst-act_agent,
          appl type zagents-applt,
          mngr type zagents-manager.
      swc_get_element container 'ActuallyProcBy' actuallyprocby.
      swc_get_element container 'Appl' appl.
    clear mngr.
    select single manager from zagents into mngr
    where agent = actuallyprocby and applt = appl.
    concatenate 'US' mngr into mngr.
      swc_set_element container 'Mngr' mngr.
    end_method.
    In the container of the task i have placed the import parameters- actuallyprocby and appl
    these are passed during the binding
    according to the tutorial, i can pass parameters that way, create the parameters in the method and use it to retrieve the manager of a user.
    finally i set the element in the container to the returned value -
    the breakpoint i use doesnt get activated
    and finally---
    the workflow stops at this task with the status ready and with no agent assigned.
    How to pass the parameters properly and resolve this issue
    Thank you all very much
    Points will be rewarded
    Regards.
    Edited by: Zeeshan Shah on Apr 14, 2008 4:03 PM
    I have checked the tech details for the workflow in my outbox
    ---error
    Result of agent resolution does not agree with agents of task
    This error goes on the first activity-- i have used expression: initiator at it--

    Hi Zeeshan,
    I think the question is still not solved.
    I have implemnetd a scenario exatcly like this but there I have implemented a RULE.
    The method that you have created is exactly correct.
    But there is a simple thing that you need to implement more.
    As per the method,
    begin_method get_manager changing container.
    data:
    actuallyprocby type wfsyst-act_agent,
    appl type zagents-applt,
    mngr type zagents-manager.
    swc_get_element container 'ActuallyProcBy' actuallyprocby.
    swc_get_element container 'Appl' appl.
    clear mngr.
    select single manager from zagents into mngr
    where agent = actuallyprocby and applt = appl.
    concatenate 'US' mngr into mngr.
    swc_set_element container 'Mngr' mngr.
    end_method.
    When you are passing the workflow initiator here, the workflow initiator will have the value like USADAPTARY. Here you have to seperate the US value. So from here you have to remove the value of US from the actuallyprocby and appl variables. Then only the select will work. Here I am assming that the table does not contain the US with the agent ID.
    After that you have to call the method into a task with a custome task container element like that of the Workflow initiator. The value that the method would return map it to the custom variable of the task container.
    Now, in the workflow container also, create another element with the same type like that of the workflow initiator. Get the task within an activity with background properties and in the Misc. Priority as 1.
    That activity will get the name of the ActuallyProcBy and Appl and give the name of the agent with the word US added into the custom variable like that of the workflow initiator.
    Pass that variable in the activity that you like to do, with the agent assignment properly for that activity and for the agent assignment choos the User and the variable name of the workflow container like that of the workflow initiator.
    Please reply if this does not work.
    Rewards points if found useful.
    Regards.
    Abhijit.

  • SWI1_RULE - Agent Determination

    Hi Everyone,
    I have a problem where a workitem is not finding an Approver. After I run SWI1_RULE for the workitem then it is routed to the correct approver, which is fine. However I keep having to run SWI1_RULE each time for the same workflow problem to push the workitem through to the approver.
    Everything in the system is set up fine in terms of Org Data and the buffers are being refreshed fine - we've started refreshing after all changes and can rule the buffer out as a problem. The WF-BATCH user authorisations are all fine too.
    I'd be interested to know what you think of this problem and maybe you have an idea about the workflow cannot send the workitem to the approver and thus I keep needing to use SWI1_RULE each and every time.
    Many thanks for your time
    Kind Regards
    DK

    Hi,
    Is this problem happening for new workflow instance also?
    it looks like, you might be checking with old workitems ( which were created before any change to rule definition), because SW1_RULE is nothing but reexecuting the agent determination rule again, there should not be any difference when it is executed by Workflow runtime or by using SWI1_RULE.
    Regards
    Krishna Mohan

  • Regarding Approver agent determination

    Hi,
            I am new to SRM and i have a requirement to change the Workflow which is trigerred whenever a shopping cart is created and mail is sent to the approver for approval of the same.
           Here on creation of shopping cart i need to do some changes while determining the approver and i dont know exactly in where is this approver determined. Business object BUS2121 has been customised.
           Can any one please let me know the place exactly where this Approver Agent is determined, i need the method and the business object.
    Regards,
    Ravi G

    Hi,
    Whcih Workflow are you using for the Shopping cart approval?Based on the workflow used,teh agent determination varies e.g. for the Std 1step  ,2 step approval workflow,agent assignement is done at the task level but for N step approval workflow the agent determination is done thorugh the BADI "BBP_WFL_APPROV_BADI".
    See teh foll link for more details:
    SRM Business Workflow
    http://help.sap.com/saphelp_srm50/helpdata/en/8b/4fa9585db211d2b404006094b92d37/frameset.htm
    Setting Up SAP Business Workflow
    http://help.sap.com/saphelp_srm50/helpdata/en/ee/277e3c281f1817e10000000a114084/frameset.htm
    Related links ->
    Re: SRM workflow doubts....
    Triggering SRM workflow from a  web-based form (HTML)
    Workflow debugging
    Re: Triggering an alert
    Depending on the Approval Workflow, you are using, there are Binding Events under the Triggering Events tab of the Workflow inside the Workflow Builder (Transactions - SWDM / PFTC ).
    There the event can be defined, depending on the Business Object Type methods avaiable in SWO1 Transaction for BUS2121 in our case. (SAVED => Reqt cov. request Shop. cart created )
    Refer to this link for more details.
    http://help.sap.com/saphelp_srm50/helpdata/en/2c/e68d406b305537e10000000a1550b0/frameset.htm
    BR,
    Disha.
    <b>Pls reward points for useful answers.</b>

  • PR Overall Release Workflow - Agents Determination Failed

    Dear All WF Experts,
    I have used the standard workflow WS20000077 for PR Overall Release. I have assigned the agents to the task TS20000159 by position maintained in the Workflow Organizational Management Structure. The agents' names are showing correctly in the task's agent settings.
    However,  when I execute the workflow, the error 'Agent Determination Failed' for that step (TS20000159). I have checked the agent settings in workflow and SPRO, they look fine. Could anyone please kindly give me advices how to solve this error? Thank you so much.

    Hi, to all the experts who have helped me all these while,
    Thank you very much for spending time helping me to go through this issue.
    Yesterday, I ran through the coding for the function module for the rule AC20000026 again. I found out that there is one part of the coding which is causing the failure of determining an agent. The code disregard the company code for overall release of Purchase Requisition while the business requirement involves company codes in every PR created. Thus, by changing that code, the problem is solved.
    The snippet of code of function module (ME_REL_GET_RESPONSIBLE):
       CASE t16fc-frgwf.
    * keine Ermittlung
          WHEN space.
            RAISE nobody_found.
    * Ermittlung ¨¹ber T16fW
          WHEN '1'.
            IF eban-gsfrg EQ space.
    *     Einzelpositionsfreigabe Banf
              SELECT SINGLE * FROM t16fw WHERE frggr = eban-frggr
                                           AND frgco = rm06b-frgab
                                           AND werks = eban-werks.
            ELSE.
    *     Gesamtfreigabe Banf
              SELECT SINGLE * FROM t16fw WHERE frggr = eban-frggr
                                           AND frgco = rm06b-frgab
                                           AND werks = space.
    There is always a value in werks in my business scenario...
    SELECT SINGLE * FROM t16fw WHERE frggr = eban-frggr
                                           AND frgco = rm06b-frgab
                                           AND werks = space.
    So, by changing it to
    AND werks = eban-werks
    it will work, however, I think it's better to just remove the If statement
    IF eban-gsfrg EQ space.
    , since it has no effect anymore.
    I hope this would give a hint to all the rest who might be facing the same problem as well.
    Thank you very much,
    YL

  • Error in resolution of rule ... for step - Agent determination for failed

    Dear Experts,
    in SRM 7.0 CS, i have come accross the following workflow error:
    I have extended my existing organizational plan for a new site (new CoCo, Plant, Purch Org and Purch Gr). But when i use my test users with this site, i receive a workflow error, that has the following wording in SWI2_DIAG:
    Error handling for work item 000000055347
    No links corresponding to the specified data could be determined
    Error in resolution of rule 'AC40000138' for step '0000000293'
    Agent determination for step '0000000293' failed
    Error during result processing of work item 000000055357
    Error when processing node '0000000293' (ParForEach index 000000)
    Error when creating a component of type 'Step'
    Error when creating a work item
    Error when processing node '0000000293' (ParForEach index 000000)
    Work item 000000055356: Object FLOWITEM method EXECUTE cannot be executed
    Error handling for work item 000000055355
    Can you maybe help me understand, what this error means and how to resolve it?
    Thank you very much!
    P.S. my test users work fine if i drag them to another location in my organizational plan. And also if i take other test user from locations where everything works fine and drag them to this "problem" location, than the same workflow error occures.

    Remove the user from the PPOMA node and add him again.. Sometimes this will solve the issue..
    Thanks!!
    Bharath

Maybe you are looking for