Using Function Modules to Define Roles

Prerequisites

Function modules are an extremely powerful tool you can use to return a list of agents for a task in workflow. Use function modules to define roles if you require very complex selection criteria for finding agents, that is, if you cannot model agent selection using responsibilities.

First create and name a standard role. Then decide what you require the workflow to do. Depending on that, decide whether you are going to use a standard function module delivered by SAP or one you have created to suit your own requirements. To avoid having to view the coding of the function module during the procedure, make sure you know in advance which container elements the function module requires. However, if you do decide you need to check the coding of the function module, choose Goto -> Function module.

Procedure

On the Create Standard Role screen:

  1. Choose Function to be executed.
  2. Enter the name of the function module. For example, if you wish to use a function module that evaluates your organizational structure, you could choose RH_GET_STRUCTURE.
  3. Save the role.
  4. Depending on the function module you have selected, the field Evaluation Path appears.

  5. Enter the appropriate evaluation path and save.
  6. Choose Container Definition.
  7. The Standard Role: Edit Container screen appears.

  8. Choose Create. The Create Element dialog box appears.
  9. If you wish to use Data Dictionary fields, select Yes.
  10. The Create with Data Dictionary field Proposals dialog box appears.

  11. Enter the table from which you intend to select fields and choose Continue.
  12. The table appears.

  13. Select the fields you wish to appear in the container definition. Make sure these are the elements needed by the function module.
  14. The system prompts you to confirm the names of these container elements.

  15. Choose Back.

The Create Standard Role screen appears.

Result

Workflow runs the function module, and, depending on the data in the container, returns a list of possible agents.