cancel
Showing results for 
Search instead for 
Did you mean: 

Get list of possible agents for a task

Former Member
0 Kudos

Hello.

I'm looking for a way in ABAP to create a list of users as a result of what's entered in Agent Assignment for a task group.

The only things I've found is dynpros displaying a list like that (SWU_WF_TASK_DISPATCH).

I need something like SWD_API_POSSIBLE_AGENTS_GET and RH_AGENTS_OF_TASK_GET but couldn't figure out how to use it.

If there is no way to read the assignments of a task group, then I think it would work to read what users belongs to a role.

Same thing there. I can only find BAPIs to read what role a user have, not the other way around.

Any hints would be great!

/Mikael

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mikael,

You can use these function modules in a rule to get the required agents for a task. And then specify that rule in agent assignment category.

Regards,

Guddan

Former Member
0 Kudos

To create a rule, you can use T-Code PFAC.

Former Member
0 Kudos

Thanks for the quick reply.

I can see the TaskGroup in tx PFTC and also get a list with corresponding users.

The thing is that I'm trying to build a FM that return possible agents from a TaskGroup. I don't want to change the assignment to the task.

I'd rather use a TaskGroup as inputparameter and to get a list of users to choose from.

This is because the list will be avalible for the end users to select from, and the selection will be used by the workflow to assign next agent in the workflow.

So the agent assignment will actually be done by the user, and then set in coding in the workflow.

To avoid the use of un-selectable agents, I'd like to create a list (or f4-help) for the user.

Do you have any coding-examples? I can't get it to work with the FM's above.

Perhaps an easy error. However I only get the currently assigned agent, or an empty list.

Former Member
0 Kudos

Hello again.

I managed to do this in coding by first calling RH_PBUILD_WORKFLOW with eval_path 'SAP_TAGT' and then call FM RH_BRANCH_GET (using WEGID = EV_MOD_EV from RH_PBUILD_WORKFLOW).

So this call gives me a list with all possible users to a taskgroup, however the call takes a lot of time (allmost 4 minutes).

Is there a trick to speed things up a bit?

code listing:


DATA: lv_evaluation_path LIKE  GDSTR-WEGID.
lv_evaluation_path = 'SAP_TAGT'.
     CALL FUNCTION 'RH_PBUILD_WORKFLOW'
      EXPORTING
        IV_EVALUATION_PATH       = lv_evaluation_path
*        IT_EVAL_PATH             =
      IMPORTING
        EV_MOD_EV                = lv_evaluation_path
*        EV_IS_INTERNAL           =
               .

CALL FUNCTION 'RH_BRANCH_GET'
  EXPORTING
    root_plvar             = root_plvar
    root_otype             = root_otype
    root_objid             = root_objid
    ACT_WEGID              = lv_evaluation_path
   ACT_INT_WEGID          = 'X'
*   ACT_LEVEL              = 1
*   ACT_SVECT              = '1'
   ACT_TDEPTH             = ACT_TDEPTH
*   ACT_BEGDA              = SY-DATUM
*   ACT_ENDDA              = '99991231'
*   ROOT_IN_NODE_TAB       =
*   ACT_ACTIV              =
*   TEXT_BUFFER_FILL       =
*   GIVEN_GDSTR            =
*   USE_GIVEN_GDSTR        =
  tables
    node_tab               = node_tab
          .

Former Member
0 Kudos

Eventually I figured I'll create a Shared Object to read the list.

So the list would be created once with a scheduled report, and then shared to all consumers when reading the list.

Thanks.

former_member185167
Active Contributor
0 Kudos

Thank you for the follow-up and for providing your solution. It will help others.

Answers (0)