ERPClimb logoERPClimb
Workflow
ABAP Developmentbeginner 9 min read

Workflow Part 1: SAP Business Workflow Architecture

Free sample lesson · open to everyone

Key takeaway

Understand SAP Business Workflow: workflow templates, single-step tasks, business objects (BOR, SWO1) and workflow-enabled classes (IF WORKFLOW), events and event linkage, the workflow container, agent determination with organizational management, work items in SBWP / Fiori My Inbox, and where Flexible Workflow fits in S/4HANA.

In this lessonShow sections

Visual overview

Workflow Part 1: SAP Business Workflow Architecture — learning sheetFlow: SWU3: check that workflow customizing is complete (green) in a test system → SWO1: display BUS2012 and look at its events and methods → SWDD: open a standard workflow template (e.g. for PO release) and look at its steps. Key ideas: WHAT WORKFLOW SOLVES; BUILDING BLOCKS; RUNTIME FLOW; ORGANIZATIONAL MANAGEMENT. Watch out: Most production issues (wrong agent, stuck work item, empty data) trace back to one layer — event linkage, binding, agent rule or organizational data — so know the architecture first.ERPClimb.com / ABAP / LESSON 1/5 / LEARNING SHEETWorkflow Part 1: SAP Business Workflow Architecture1 · HOW IT FLOWS1SWU3check that workflow customizing iscomplete (green) in a test system2SWO1display BUS2012 and look at itsevents and methods3SWDDopen a standard workflow template(e.g. for PO release) and look at…2 · KEY IDEAS EXPLAINEDWhat Workflow SolvesMulti-step processes with people: PO/PR approvals,invoice release, leave requests, master dataapprovals — instead of emails and paper, with…Building BlocksWorkflow template (WS…): the process definitionbuilt in the Workflow Builder (SWDD) — steps,conditions, forks, loops.Standard/single-step task (TS…): one unit of work,calling a method of a business object or class(PFTC).Runtime Flow1. Application raises an event (e.g. throughchange documents, status management or code:SAP_WAPI_CREATE_EVENT).Organizational ManagementAgents are resolved via org units, positions, jobs(PPOME) or rules — not hard-coded users — so rolechanges don't require workflow changes.3 · REMEMBER · WATCH OUTRememberSAP Business Workflow routes work items (approvals, tasks) to theright agents automatically, with a full log of who did what and when.Building blocks: workflow template (SWDD), single-step tasks (PFTC),business objects (BOR, SWO1) or classes implementing IF_WORKFLOW…At runtime, an event (e.g. purchase requisition released) starts aworkflow instance; agent determination creates work items in the…!Watch outMost production issues (wrong agent,stuck work item, empty data) traceback to one layer — event linkage,binding, agent rule ororganizational data — so know thearchitecture first.4 · IN A REAL PROJECTA company built approval routing by email with custom Z tables. Approvals got lost, audits failed andescalations were manual. Replacing it with a workflow started from the PO release event gave every approver awork item, with deadlines and a complete log. When the purchasing organisation changed, only the org model in…Original ERPClimb learning sheet • Verify against your SAP release and edition

Expert visual walkthrough

ABAP DEVELOPMENT ACADEMY · Component relationshipsERPClimb.com

SAP Business Workflow Architecture

Workflow · Chapter-specific technical teaching map

Component relationships

1Central concept

Business event

2Connected capability

Workflow template

3Connected capability

Work item

4Connected capability

Agent determination

Tutor's chapter takeaway

Understand SAP Business Workflow: workflow templates, single-step tasks, business objects (BOR, SWO1) and workflow-enabled classes (IF_WORKFLOW), events and event linkage, the workflow container, agent determination with organizational management, work items in SBWP /…

In a real project

A company built approval routing by email with custom Z tables. Approvals got lost, audits failed and escalations were manual. Replacing it with a workflow started from the PO release event gave every approver a work item…

Watch out for

• Hard-coding user IDs as agents. • Building custom templates when Flexible Workflow covers the scenario. • Incomplete SWU3 customizing. • Events raised without commit. • Not using the workflow log for analysis.

Conceptual study map, not an SAP configuration screenshot or a guaranteed runtime sequence. Consult the lesson for implementation prerequisites and exceptions.

The situation: a real project scenario

A company built approval routing by email with custom Z tables. Approvals got lost, audits failed and escalations were manual. Replacing it with a workflow started from the PO release event gave every approver a work item, with deadlines and a complete log.
When the purchasing organisation changed, only the org model in PPOME was updated — the workflow itself stayed untouched because agents were resolved via positions, not user IDs.

Explanation

This lesson opens a five-part series on SAP Business Workflow, starting with its architecture. The series continues with building templates — steps, containers and binding — in Part 2, agent determination and rule-based assignment in Part 3, workflow at scale, covering governance, Flexible Workflow and clean core, in Part 4, and errors, restart and escalation in Part 5.

SAP Business Workflow exists to solve multi-step processes that involve people: purchase order and purchase requisition approvals, invoice release, leave requests, master data approvals — processes that would otherwise run on emails and paper, but which workflow gives deadlines and a full audit trail. SAP Business Workflow routes work items (approvals, tasks) to the right agents automatically, with a full log of who did what and when.

Several building blocks make this work together. A workflow template, named with a WS… prefix, is the process definition itself, built in the Workflow Builder (SWDD), with its steps, conditions, forks and loops. A standard or single-step task, named TS…, represents one unit of work, calling a method of a business object or class, and is maintained in PFTC.

A business object — defined in the Business Object Repository and viewed in SWO1, for example BUS2012 for a purchase order — or alternatively an ABAP class implementing IF_WORKFLOW, provides the attributes, methods and events the workflow acts on.

An event, such as RELEASED, is linked to a workflow through event linkage in SWE2, optionally guarded by start conditions maintained in SWB_COND. The container holds the actual data of a running workflow instance — an object reference, amounts, the approver, and so on.

And agents come in three flavors: possible agents for a task, responsible agents determined by rules or organizational units, and excluded agents. Building blocks: workflow template (SWDD), single-step tasks (PFTC), business objects (BOR, SWO1) or classes implementing IF_WORKFLOW, events and event linkage (SWE2), container, agent rules.

At runtime, the flow goes like this: the application raises an event — through change documents, status management, or directly in code via SAP_WAPI_CREATE_EVENT — and the event linkage starts the matching workflow, with the container filled through binding. Each step in the template then creates a work item, and agent determination figures out which users should see it.

The user executes the work item, either in the Business Workplace (SBWP) or in the Fiori My Inbox app, and the result flows back into the workflow. The workflow then continues until it completes, with a full log available afterward through SWIA, SWI1, or SWI6 by business object.

At runtime, an event (e.g. purchase requisition released) starts a workflow instance; agent determination creates work items in the Business Workplace (SBWP) or Fiori My Inbox.

Organizational Management plays a key role here too: agents are resolved through org units, positions and jobs maintained in PPOME, or through rules, rather than being hard-coded to specific users — so a role change in the organization doesn't require any change to the workflow itself.

Looking toward S/4HANA and beyond: classic Business Workflow still runs in S/4HANA, whether on-premise or private cloud. Flexible Workflow offers pre-delivered scenarios — purchase requisition, purchase order, supplier invoice among them — configured directly in Fiori apps such as "Manage Workflows," and these are worth checking before building a custom template from scratch. For cloud or side-by-side processes, SAP Build Process Automation is the strategic option going forward.

Most production issues — a wrong agent, a stuck work item, empty data — trace back to one of these layers: event linkage, binding, agent rule, or organizational data, so knowing the architecture first makes troubleshooting much faster.

As an exercise, use SWU3 to check that workflow customizing is complete (shown green) in a test system, use SWO1 to display BUS2012 and look at its events and methods, and use SWDD to open a standard workflow template, for example one used for purchase order release, and look through its steps. By the end you should know the building blocks of SAP Workflow and how an instance actually runs.

Code example

ABAP Code
* ===== Raising a workflow event from ABAP (classic API) =====REPORT zwf_raise_event. PARAMETERS p_ebeln TYPE ebeln OBLIGATORY. DATA: lv_objkey TYPE swr_struct-object_key,      lv_retcode TYPE sy-subrc,      lt_cont   TYPE STANDARD TABLE OF swr_cont,      ls_cont   TYPE swr_cont. START-OF-SELECTION.  lv_objkey = p_ebeln.                      " event object key must match the BOR object's key field (here: EBELN) * Optional event container values (read by the workflow via binding)  ls_cont-element = 'Reason'.  ls_cont-value   = 'Manual trigger for test'.  APPEND ls_cont TO lt_cont.   CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'    EXPORTING      object_type     = 'BUS2012'          " purchase order (BOR)      object_key      = lv_objkey      event           = 'ZRELEASED'        " custom event (subtype of BUS2012)      commit_work     = 'X'                " triggers the event immediately; without it the event waits for the next commit    IMPORTING      return_code     = lv_retcode    TABLES      input_container = lt_cont.           " values the workflow can pick up via its start/step binding   IF lv_retcode = 0.    WRITE: / 'Event raised for', p_ebeln.  ELSE.    WRITE: / 'Event could not be raised, RC', lv_retcode.  ENDIF. * ===== Transactions =====* SWU3  workflow customizing check      SWDD  Workflow Builder* PFTC  tasks                           SWO1  BOR objects* SWE2  event linkage                   SWEL  event trace (SWELS to switch on)* SBWP  Business Workplace inbox        SWIA / SWI1 / SWI6  work item analysis

Watch out

Common mistakes

  • Hard-coding user IDs as agents.
  • Building custom templates when Flexible Workflow covers the scenario.
  • Incomplete SWU3 customizing.
  • Events raised without commit.
  • Not using the workflow log for analysis.

Do this

Best practices

  • Check Flexible Workflow/standard templates first.
  • Resolve agents via org model or rules.
  • Keep business logic in objects/classes, flow in the template.
  • Raise events at the right business moment.
  • Use SWIA/SWI1 logs for support.

In the interview

Interview angle

Questions: "What is SAP Business Workflow?", "Explain template, task, business object and event.", "How are agents determined?"
Strong answer: template (SWDD) with steps, single-step tasks (PFTC) calling BOR (SWO1) or IF_WORKFLOW class methods, events with linkage (SWE2) and start conditions, container and binding, agents via org management/rules, work items in SBWP/My Inbox, logs SWIA/SWI1; Flexible Workflow in S/4HANA and SAP Build Process Automation for cloud.

Practice this lesson

Quick check

0 of 3 questions attempted

Question 1 of 3

Which transaction is the Workflow Builder used to create and change workflow templates?

Practise this in an interview

Answer in your own words and get instant feedback, the way an interviewer would judge it.

1Write and explain the ABAP logic you would use inside a workflow method to raise a business event, and describe how the workflow system consumes that event to trigger a new workflow instance.

2Explain the core building blocks of SAP Business Workflow architecture and how they interact to execute a workflow instance.

See it in code

Each example starts from a requirement, shows the design, then the code step by step with a plain-language explanation of every part.

Was this lesson helpful?

Keep exploring

Referenced SAP objects

Reviewed reference pages for the objects this page mentions.

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.