Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 2 of 6

Business components for SAP

17 min

Listen to this lesson

0:00 / 5:52

A business component is a reusable action named in the language of the business process: Create Sales Order, Post Goods Receipt, Release Purchase Order, Create Billing Document. It takes business inputs, performs the action through whatever interface is appropriate, and returns business outputs such as the document number. Components are where SAP knowledge lives in a framework, and designing them well is the single biggest lever on maintenance cost.

Anatomy of a component

  1. InputsBusiness data only: sales area 1710 / 10 / 00, sold-to Great Lakes Fleet Services, material CMC-ALT-100, quantity 50.
  2. PreconditionsWhat must be true: customer not blocked, material available in plant 1710. Checked or documented.
  3. ActionPerformed through an adapter: the Fiori app, SAP GUI, or a released API.
  4. OutputsBusiness results: sales order number, net value, status, messages.
  5. PostconditionsWhat is now true and can be asserted by the test or the next component.
The contract of an SAP business component.
The Sign-Off Table · thesignofftable.com/academy/sap-tau-301

The ISTQB syllabus describes the design patterns behind this. The facade pattern hides implementation details and exposes only what testers need. The page object model keeps locators for a screen in one class, so a UI change is fixed in one place. The flow model adds a facade over page objects that holds the user actions, so steps can be reused across scripts. A business component is essentially a flow-level facade: it orchestrates page objects or API calls into one business action.

Granularity

Too coarse, and components cannot be combined: "Run Order to Cash" is a test, not a component. Too fine, and the test reads like a recording: "Click Create, Enter Sold-To, Press Enter". The right size is one business transaction that a process owner would recognize and that leaves the system in a consistent state.

GranularityExampleProblem or benefit
Too fineEnter Sold-To Party; Press Enter; Click SaveTests become recordings; UI detail leaks into tests
Right sizeCreate Sales Order; Create Outbound Delivery; Post Goods Issue; Create Billing DocumentReadable, reusable, one consistent state per action
Too coarseRun Order to Cash End to EndCannot vary steps, insert checks or reuse parts
Choosing component granularity for SAP processes.
The Sign-Off Table · thesignofftable.com/academy/sap-tau-301

Interface independence

A strong component hides how the action is performed. Contoso's Create Sales Order component has two implementations: through the Manage Sales Orders Fiori app, used when the test is about the user path, and through the released Sales Order API, used when an order is only setup data for a later step. The test chooses the mode by intent ("as user Maria" versus "as setup"); the component signature stays the same. When the Fiori app changes, only the UI implementation changes.

One signature, two implementations: the test picks the mode by intent, and a Fiori change touches only the UI implementation.
The Sign-Off Table · thesignofftable.com/academy/sap-tau-301

Return values and assertions

Components return business facts; tests assert on them. A component that both creates the order and asserts "net value equals 12,000.00 USD" mixes two responsibilities and cannot be reused for a test that expects a different value or an error. Let components fail only when the action itself could not be performed, for example the save did not happen, and return messages so the test can assert on expected warnings or errors.

The component reports what happened; the test decides whether that was the expected result.
The Sign-Off Table · thesignofftable.com/academy/sap-tau-301
  • Name components with business verbs and objects, as the process owner would.
  • Document inputs, outputs, preconditions and postconditions in the component itself.
  • Return keys and business values; never hide document numbers.
  • Do not assert business expectations inside components; leave that to tests.
  • Version components with the tests in source control and review changes like code.

What would you do?

A colleague builds a component Create Sales Order And Check Price that asserts the net value is 12,000.00 USD. Another test needs an order for a blocked customer that should be rejected. What should Priya advise?

Key points
  • Business components are reusable SAP actions with business inputs, outputs, preconditions and postconditions.
  • They are flow-level facades over page objects or API calls.
  • Size them as one recognizable business transaction that leaves a consistent state.
  • Hide the interface: the same component can act through the UI or a released API.
  • Components return facts; tests make assertions.

Check your understanding · not graded

Lesson check

  1. 1. Which is the right granularity for an SAP business component?

  2. 2. Which design pattern keeps all locators for one screen in a single class?

  3. 3. Why should business components not contain business assertions?

  4. 4. Contoso's Create Sales Order has a UI and an API implementation. What does this achieve?