Lesson 6 of 6
Testing and signing off inbound orders
15 min
Listen to this lesson
An inbound order flow is proven when real partner files create the right sales orders, and wrong files fail in the right way. Priya's team built Contoso's inbound test pack for Great Lakes in CMQ with three principles: use the partner's own sample files, compare field by field, and test the failures as carefully as the successes.
Use real samples
Great Lakes provided twelve sample 850s from its test system: single and multi-line orders, both depots, a heavy-duty alternator, an order with a future delivery date and one with a price that deliberately did not match. Each file went through the real path: AS2 into PO on XQ1, translation, IDoc into CMQ client 100. Test files typed by hand prove the map's happy path; partner files prove what the partner actually sends, including the qualifiers and padding nobody wrote into the guide.
Compare field by field
| Field | Source in the 850 | Where to read it in SAP | Expected for GLF-PO-55120 |
|---|---|---|---|
| Customer reference | BEG03 | Order header, customer reference | GLF-PO-55120 |
| Sold-to | N1*BY | Order header, sold-to | 17100001 |
| Ship-to | N1*ST GR04 | Order header partners, ship-to | 17100006 |
| Sales area and type | Contoso's supplier number via EDSDC | Order header | 1710 / 10 / 00, OR |
| Material | PO1 BP GLF-ALT-100 | Item material and customer material | CMC-ALT-100 / GLF-ALT-100 |
| Quantity and unit | PO1-02, PO1-03 | Item quantity | 50 PC |
| Expected price | PO1-04 | Item conditions, EDI1 vs net price | 240.00 = 240.00, order complete |
| Requested delivery date | DTM*002 | Header requested delivery date | 2026-10-21 |
The field-by-field comparison for one inbound order; every row is evidence.
- Week 1Samples receivedTwelve Great Lakes sample 850s and the signed partner spec; EDPAR, EDSDC and KNMT entries loaded in CMQ
- Week 2Positive runAll samples through AS2, PO on XQ1 and CMQ; field-by-field comparisons completed
- Week 3Negative runUnknown part, unknown ship-to, duplicate PO, price mismatch and unknown sender tests
- Week 4Partner confirmationGreat Lakes confirms the 855s it received; defects retested; evidence reviewed
- CutoverProduction checkConversion data verified in CMP before the first Monday batch
Test the failures
| Negative test | How | Expected result |
|---|---|---|
| Unknown part number | Sample 850 with a part not in KNMT | Status 51 "material not determined", work item at the O2C EDI desk, no 855 |
| Unknown ship-to code | N1*ST with an unmapped location | Status 51 for the ship-to, no order |
| Duplicate purchase order | Resend the same 850 with a new interchange number | Duplicate PO check stops or warns per the sales document type setting; no second order unnoticed |
| Price mismatch | PO1 price 228.00 against 240.00 | Order incomplete for price, no 855 until resolved |
| Unknown sender | Edited IDoc from an unknown partner in WE19 | Status 56, work item for the IDoc administrator |
Negative tests in Contoso's inbound order test pack.
Automating the comparison
The comparison table is mechanical, which makes it a good candidate for automation: read the created order through an API, find it by the customer's purchase order number, and assert the fields from the partner file. SAP S/4HANA exposes sales orders through the OData-based Sales Order API, where the header carries fields such as PurchaseOrderByCustomer, SoldToParty and SalesOrderType, and items carry Material, MaterialByCustomer and RequestedQuantity. A check that searches by PurchaseOrderByCustomer and expects exactly one result also proves the duplicate rule on every run.
What would you do?
Two days before cutover, all twelve Great Lakes samples pass in CMQ, but nobody has checked that EDPAR, EDSDC and KNMT entries exist in CMP. Priya asks whether to sign off. What is the right call?
- Test with the partner's own sample files through the real path, not hand-typed IDocs.
- Compare file to IDoc and IDoc to order, field by field; each row is evidence.
- Negative tests (unknown part, unknown ship-to, duplicate PO, price mismatch, unknown sender) must fail in the expected way.
- Sign-off includes the conversion data (EDPAR, EDSDC, KNMT) in the CMP cutover load.
Check your understanding · not graded
Lesson check
1. Why does Contoso compare the file with the IDoc and the IDoc with the order separately?
2. Which negative test proves the duplicate purchase order rule?
3. Which data must be in the CMP cutover load for Great Lakes orders to post?