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

Lesson 5 of 5

Testing characteristic derivation

10 min

Listen to this lesson

0:00 / 5:43

Margin analysis reconciles with the general ledger by design, so a test that only compares totals with the income statement will always pass. The real risk is classification: a line with the right amount but the wrong or missing customer, product or district. Testing margin analysis is therefore mostly testing characteristic derivation on every flow.

How characteristics are derived

Sales transactions automatically pass sales organization, distribution channel, division, customer, product, profit center and sales partners. SAP's learning material describes a derivation strategy: a sequence of steps, each of which calculates one or more characteristic values, with conditions, behavior when a step fails, and whether a step may overwrite values. Steps read from master data (customer group from the customer, product group from the material) or apply rules (market channel from distribution channel).

  1. Transaction valuesCustomer, product, sales area from the sales order item
  2. Master data lookupsCustomer group and sales district from the customer; product group from the material
  3. RulesMarket channel Fleet or Aftermarket from the distribution channel
  4. ResultComplete market segment on the journal entry line
A simplified derivation strategy for a Contoso sale.
The Sign-Off Table · thesignofftable.com/academy/sap-co-205

Testing one derivation step in isolation

Before running full order-to-cash flows, test the derivation strategy itself. In Private Edition the strategy is maintained in KEDR (Customizing: Define Characteristic Derivation). It has a test function: you enter the input values a document would bring and see, step by step, which characteristic each step filled, which step found nothing, and which step overwrote a value. That makes a failed rule visible in seconds instead of after a billing run. In Public Edition, derivation rules are maintained in configuration apps rather than KEDR; the test idea is the same.

  1. Open KEDR for Contoso's operating concern in CMQ client 100 and display all steps.
  2. Start the test (F8) and enter the input values of a real case: customer 17100001 Great Lakes Fleet Services, product CMC-ALT-100, sales area 1710 / 10 / 00.
  3. Run the derivation and open the analysis: one line per step, with the field, the value found and a comment when a source field was empty.
  4. Check the result against the flow-by-characteristic matrix: customer group Fleet operators, sales district Midwest, market channel Fleet.
  5. Repeat with an aftermarket customer on distribution channel 20 (illustrative) and with a customer that has no sales district, to see how the step behaves when its source is empty.
  6. After transports, run the consistency report RKEDRCHECK to catch rules that a transport or client copy left inconsistent.
Each derivation step either fills its target, leaves it for a later step, or overwrites it only if allowed; the KEDR test shows which path each step took.
The Sign-Off Table · thesignofftable.com/academy/sap-co-205

Build a flow-by-characteristic matrix

FlowCustomerProductSales districtMarket channel
Goods issue for sales orderFrom orderFrom orderDerived from customerRule
Billing: revenue and deductionsFrom orderFrom orderDerived from customerRule
COGS split linesSame as COGS lineSameSameSame
Production variancesNot availableFrom orderNot availableNot available
Marketing order settlementPer settlement rulePer rulePer rulePer rule
Manual adjustment (journal entry)Entered by userEnteredDerivedDerived

Expected characteristic sources by flow (Contoso extract). "Not available" is a design decision, not a defect.

Write the expected value for each cell before testing, including where a characteristic is expected to be blank, such as customer on production variances. Then execute each flow for a fleet customer and an aftermarket customer and read every line.

Manual adjustments

Controllers sometimes post adjustments directly to market segments, for example a rebate accrual for a distributor. These journal entries need a market segment entered by the user and then completed by derivation. Test that the posting app lets the user enter the market segment, that derivation fills the rest, and that a posting without the required characteristics is handled the way the design says.

A manual adjustment to a market segment needs the user's entries plus derivation, and a test must cover both the happy path and the missing-characteristic case.
The Sign-Off Table · thesignofftable.com/academy/sap-co-205
  1. Do margin totals equal revenue and COGS in the G/L for the test period?Yes → next question · No → a flow is posting outside the expected accounts; investigate
  2. Is every characteristic filled where the matrix expects a value?Yes → next question · No → derivation defect for that flow
  3. Do test sales show the expected margin per customer and channel?Yes → derivation signed off · No → check COGS split and pricing
Evaluating a margin analysis test cycle.
The Sign-Off Table · thesignofftable.com/academy/sap-co-205

Evidence

  • A reconciliation: billing revenue and COGS for the test period equal the margin report totals.
  • The flow-by-characteristic matrix with document numbers and pass or fail per cell.
  • A "not assigned" check per characteristic with every value explained.
  • For two test customers, a margin calculated by hand (quantity × price, quantity × standard split) that equals the report.

What would you do?

Priya's margin test shows totals equal to the G/L, so the tester marked it passed. Dan notices half the aftermarket COGS shows market channel Fleet. What went wrong in the test design?

Key points
  • Margin totals reconcile by design; test classification, not just totals.
  • Derivation strategies fill characteristics from transactions, master data and rules.
  • Build a flow-by-characteristic matrix with expected values, including expected blanks.
  • Evidence: margins that agree with billing revenue and COGS, and correct characteristics on every flow.

Check your understanding · not graded

Lesson check

  1. 1. Why is "totals equal the G/L" not enough to test margin analysis?

  2. 2. What is a derivation strategy?

  3. 3. Customer is blank on production variance lines, as the matrix expects. How is this rated?

  4. 4. In KEDR, what does the derivation test show you?