ERPClimb logoERPClimb
Workflow
ABAP Developmentintermediate 8 min read

Workflow Part 3: Agent Determination and Rule-Based Assignment

Preview · a free account unlocks the full lesson

Key takeaway

Understand how SAP Workflow decides who receives a work item: possible agents (task), responsible agents (step: org objects, expressions, rules), excluded agents, general tasks, rules in PFAC (responsibility and function-module rules), organizational management in PPOME, rule resolution errors, and substitutes.

In this lessonShow sections

Visual overview

Workflow Part 3: Agent Determination and Rule-Based Assignment — learning sheetFlow: PFTC: check the possible agents of your approval task → PFAC: create a function-module rule (code example) and simulate it → Use the rule in the user decision step and set "terminate if rule resolution has no result". Key ideas: THREE AGENT SETS; WAYS TO DEFINE RESPONSIBLE AGENTS; RULE FUNCTION MODULE; SUBSTITUTES AND FORWARDING. Watch out: If no agent is found (and the rule doesn't terminate on error), the work item goes to all possible agents — for a general task that can mean everyone in the company.ERPClimb.com / ABAP / LESSON 3/5 / LEARNING SHEETWorkflow Part 3: Agent Determination and Rule-BasedAssignment1 · HOW IT FLOWS1PFTCcheck the possible agents of yourapproval task2PFACcreate a function-module rule(code example) and simulate it3Use the rule in the userdecision step and set"terminate if rule…2 · KEY IDEAS EXPLAINEDThree Agent SetsPossible agents: assigned to the task (PFTC →agent assignment) — who may ever execute it; or"general task".Responsible agents: defined per step — who shouldexecute it in this case.Ways To Define Responsible AgentsOrganizational object: org unit, position, job,user (PPOME).Expression: container element with an agent (e.g.&Approver& filled by a method).Rule Function ModuleReads criteria from the rule container (e.g. costcenter), determines agents (e.g. from OM or a Ztable), fills ACTOR_TAB with OTYPE 'US' + user or…Raises NOBODY_FOUND if none — combined with"terminate if rule resolution withoutresult", this puts the workflow into error…Substitutes And ForwardingUsers define substitutes (SBWP) for absence;active or passive substitution with substitutionprofiles.Admins can forward work items (SWIA) to otherusers.3 · REMEMBER · WATCH OUTRememberThe actual recipients = responsible agents (from the step) ∩ possibleagents (from the task), minus excluded agents.Responsible agents come from org objects (org unit, position, job),expressions (container elements like the requester's manager) or rules…A task marked "general task" allows all users as possibleagents — convenient, but less controlled.!Watch outIf no agent is found (and the ruledoesn't terminate on error), thework item goes to all possibleagents — for a general task that canmean everyone in the company.4 · IN A REAL PROJECTAfter a reorganisation, a purchase requisition approval work item appeared in the inbox of 4,000 users. Thetask was a general task, and the rule found no approver for a new cost center — without "terminate if noresult", the work item went to all possible agents. The fix: mark the rule to terminate, maintain the new…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 2 built the steps of a workflow template; now each dialog step needs to reach the right people, which is what agent determination is about.

The actual recipients of a work item are the intersection of the responsible agents, defined per step, and the possible agents, assigned to the task itself, with any explicitly excluded agents removed — for example, a requester who must not be allowed to approve their own request.

Responsible agents can come from organizational objects such as an org unit, position, or job; from expressions, where a container element like the requester's manager supplies the agent; or from rules configured in PFAC, either responsibility rules or function-module rules.

A task marked as a "general task" allows all users as possible agents, which is convenient but offers much less control.

One important danger: if no agent can be found, and the rule isn't set to terminate on error, the work item goes out to every possible agent — for a general task, that can mean literally everyone in the company.

There are three agent sets worth keeping straight: possible agents, assigned to the task through PFTC's agent assignment, representing who may ever execute it (or simply "general task" for everyone); responsible agents, defined per step, representing who should execute it in this particular case; and excluded agents, such as the rule that a requester can't approve their own request. The actual recipients are the responsible agents intersected with the possible agents, minus the excluded ones.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.