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

Lesson 2 of 6

Preconditions and data references

7 min

Listen to this lesson

0:00 / 18:53

The most common reason an SAP test case fails on its second outing has nothing to do with the system under test. The case pointed at data that no longer exists, or assumed a setup that nobody wrote down. This lesson covers the two parts of a test case that carry it from one cycle to the next: preconditions and test data. A precondition is anything that must already be true before step 1. Write each one as a statement the tester can confirm in a minute, and agree with the test lead that a missing precondition produces a blocked result instead of a misleading fail. That distinction matters at sign-off: a fail says the system is wrong, a block says the test could not be run fairly. For SAP, preconditions usually fall into a handful of groups.

  1. Is every precondition confirmed true?Yes → run the steps · No → record blocked, not failed, and tell the data owner
  2. Did each step produce its expected result?Yes → passed · No → continue
  3. Was the cause the system, not the setup?Yes → failed, log a defect · No → blocked; fix the setup and rerun
A missing precondition gives a blocked result, so a fail at sign-off always means the system is wrong.
The Sign-Off Table · thesignofftable.com/academy/sap-tst-202
GroupWeak wordingCheckable wording
System and clientUse the test systemQAS, client 100, with the transport level for cycle SIT-2 imported
User and roleLog on as a sales userTest user holds the business role for sales order processing in sales area 1710 / 10 / 00
Master dataCustomer is set upCustomer in data set DS-O2C-01 exists with sales area data for 1710 / 10 / 00 and no credit block
Stock and supplyMaterial is availableUnrestricted stock of at least 50 pieces of the product in plant 1710, storage location 171A
Finance settingsPeriods are openPosting period for today is open for company code 1710
Upstream resultsRun the pricing test firstTC-MD-004 has passed in this cycle, so the customer price record is in place

Turning vague preconditions into checkable ones.

Why hard-coded data breaks

A script that says "display sales order 1000457" or "use customer 17100001" works exactly once in exactly one system. SAP test data is fragile in predictable ways:

  • Refreshes and copies: when QAS is refreshed from production or rebuilt for a new cycle, documents created during testing are gone and number ranges restart from wherever the source left them.
  • Consumption: a sales order that has been fully delivered and billed cannot be delivered again; stock that was issued is no longer there; an invoice that was paid cannot be paid twice.
  • Collisions: two testers using the same order or the same stock in parallel change each other's results.
  • Landscape differences: the same customer may carry a different number in the training client, the sandbox and QAS.
  • Time: price records and contracts have validity dates, posting periods close, and a delivery date that was in the future during cycle 1 is in the past by cycle 3.
CauseWhat breaksFix in the test case
Refresh or copyOrder 1000457 no longer exists in QASCreate the order in step 1 and pass ORDER_NO forward
ConsumptionA billed order cannot be delivered again; issued stock is gonePostcondition note and a replenishment case before each cycle
CollisionsTwo testers change the same order or stockSeparate data rows per tester in the data set
Landscape differencesCustomer number differs between clientsData sheet marked valid for one system, client and cycle
TimePrice records expire; posting periods closeData owner checks validity before marking the sheet ready
Hard-coded data fails in five predictable ways, and each has a fix that belongs in the test case design.
The Sign-Off Table · thesignofftable.com/academy/sap-tst-202

The fix is to separate what the test does from which data it does it with. Steps refer to roles in the data ("the customer in the data set", "the product in the data set"), and a separate data sheet holds the actual values for this cycle and this system. When the system is refreshed, you update one data sheet instead of 200 scripts. The data sheet also becomes a planning tool: before each cycle, the data owner checks every row against the refreshed system, creates what is missing, and marks the sheet ready. Testers who find a sheet not marked ready know to stop before they waste a morning on false failures.

Test case (stable)Objective, steps and expected-result rules. Changes only when the process changes.
Data set and variants (per cycle)DS-O2C-01: customer, product, plant, quantity, expected price. Variant A domestic fleet, variant B tax-exempt, variant C partial delivery.
Environment (per system)System, client, transport level, users and roles.
Runtime values (per run)Document numbers created during execution and passed to later steps.
Four layers of a reusable test case. Only the top layer lives in the script itself.
The Sign-Off Table · thesignofftable.com/academy/sap-tst-202

A variant is one row of data for the same steps. Contoso's order-to-cash case runs with variant A (Great Lakes Fleet Services buying 50 alternators CMC-ALT-100 from plant 1710), variant B (a tax-exempt customer) and variant C (a partial delivery of 30 then 20). One set of steps, three outcomes, and three expected-result rows in the data sheet. Give every data set an owner, usually the key user for the process, and a "valid for" line naming the system, client and cycle, so a tester can tell at a glance whether the sheet is current. Documents created during the run are runtime values. Write them as placeholders and tell the tester to record them: "Create the delivery for the order created in step 2 (record as ORDER_NO)". Later steps then say "for ORDER_NO". The execution record holds the real numbers, which also gives a reviewer the evidence trail.

Variant AVariant BVariant C
DataGreat Lakes Fleet Services, 50 CMC-ALT-100, plant 1710Tax-exempt customerOrder delivered as 30 then 20
StepsSame stepsSame stepsSame steps
Expected result rowFull delivery, normal taxNo tax on the invoiceTwo deliveries; order completely processed after the second
Runtime valuesORDER_NO, DELIVERY_NO, BILLING_NO recorded during the runSame placeholdersTwo delivery numbers recorded
One set of steps runs three variants of data, each with its own expected-result row in the data sheet.
The Sign-Off Table · thesignofftable.com/academy/sap-tst-202

SAP's own test automation follows the same principle. In eCATT, a test configuration combines a script with variants of data, and SAP's documentation describes referencing a test data container as the preferred method over typing values into the configuration, so values can be changed in one place for every test that uses them. A manual script that already keeps its data in a referenced sheet is far easier to convert later, because the separation of steps and data has been done. If your project uses SAP Cloud ALM, keep the data sheet next to the test case (as an attachment or a linked document, depending on what your tenant supports) so the two travel together.

What would you do?

Two days after QAS is refreshed for the second test cycle, Contoso's testers report that 60 order-to-cash scripts fail at step 1 with "sales order does not exist". Each script starts by displaying a specific order number. Maria, the order-to-cash key user, asks what to do. What is the best response?

Key points
  • Write preconditions as statements a tester can confirm quickly; an unmet precondition means blocked, not failed.
  • Hard-coded document and master data numbers break after refreshes, consumption, collisions and landscape changes.
  • Keep steps stable and put values in a referenced data set with variants; capture created documents as runtime values.
  • Data that runs use up needs a postcondition note and a refill plan.

Check your understanding · not graded

Lesson check

  1. 1. A precondition is not met when the tester starts. What should the result be?

  2. 2. Which precondition is written in a checkable way?

  3. 3. What is a runtime value in a test script?

  4. 4. In eCATT, where does SAP recommend keeping reusable test data?