Lesson 5 of 5
Testing characteristic derivation
10 min
Listen to this lesson
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).
- Transaction valuesCustomer, product, sales area from the sales order item
- Master data lookupsCustomer group and sales district from the customer; product group from the material
- RulesMarket channel Fleet or Aftermarket from the distribution channel
- ResultComplete market segment on the journal entry line
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.
- Open
KEDRfor Contoso's operating concern in CMQ client 100 and display all steps. - 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.
- 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.
- Check the result against the flow-by-characteristic matrix: customer group Fleet operators, sales district Midwest, market channel Fleet.
- 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.
- After transports, run the consistency report
RKEDRCHECKto catch rules that a transport or client copy left inconsistent.
Build a flow-by-characteristic matrix
| Flow | Customer | Product | Sales district | Market channel |
|---|---|---|---|---|
| Goods issue for sales order | From order | From order | Derived from customer | Rule |
| Billing: revenue and deductions | From order | From order | Derived from customer | Rule |
| COGS split lines | Same as COGS line | Same | Same | Same |
| Production variances | Not available | From order | Not available | Not available |
| Marketing order settlement | Per settlement rule | Per rule | Per rule | Per rule |
| Manual adjustment (journal entry) | Entered by user | Entered | Derived | Derived |
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.
- 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
- Is every characteristic filled where the matrix expects a value?Yes → next question · No → derivation defect for that flow
- Do test sales show the expected margin per customer and channel?Yes → derivation signed off · No → check COGS split and pricing
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?
- 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. Why is "totals equal the G/L" not enough to test margin analysis?
2. What is a derivation strategy?
3. Customer is blank on production variance lines, as the matrix expects. How is this rated?
4. In KEDR, what does the derivation test show you?