Lesson 6 of 6
Testing inventory postings
10 min
Listen to this lesson
Inventory tests have a big advantage: every movement leaves hard evidence. A material document, a journal entry, and a measurable change in stock. A good inventory test checks all three, before and after, and does not stop at "posted successfully."
The before-and-after method
- Record beforeStock of CMC-RTR-200 in 171S by stock type; inventory G/L balance
- Expected resultWrite what should change: quantity, stock type, value, accounts
- PostExecute the movement with a user holding the warehouse role
- Record afterMaterial document, journal entry, stock by stock type
- CompareAfter minus before equals expected; journal entry accounts and amounts match
Contoso's inventory test set
| Test | Movement | Expected evidence |
|---|---|---|
| Receipt for PO into unrestricted | 101 | Stock +500; inventory debit, GR/IR credit; PO history updated |
| Receipt into quality inspection, then release | 101 then 321 | Inspection +500 then -500, unrestricted +500; no value change on 321 |
| Reversal of a wrong receipt | 102 via cancellation | Stock and GR/IR reversed; both documents linked |
| Refused reversal (stock already issued) | 102 | Error; no posting |
| Return to supplier | 122 | Stock -30; return delivery note; GR/IR adjusted |
| Storage location transfer, two-step | 313 then 315 | Stock in transfer then cleared; no value change |
| Plant-to-plant transfer | 301 (or stock transport order) | 1710 -100, 1720 +100; value difference posted |
| Issue to cost center | 201 | Stock -10; expense on the cost center |
| Scrapping | 551 | Stock -10; scrapping expense |
Receipts, transfers and reversals in one test set.
Reconciling quantities and values
Individual tests prove individual movements. At the end of a test cycle, a reconciliation proves the whole: total stock value per valuation class from the stock reports should equal the inventory G/L account balance, and GR/IR should be explainable PO by PO. If they do not match, something posted value without quantity or the other way round, which is precisely the kind of defect that slips through movement-by-movement tests.
What would you do?
All inventory tests passed individually, but at the end of the cycle the inventory G/L balance is $2,400 higher than the stock value report. What do you do?
Choose test data so that results are easy to read. Use quantities that are not already in stock (for example, receive 37 rather than 100), so the change is obvious in the stock report. Use a dedicated storage location for tests where possible, so other testers' postings do not disturb your before and after values. And record the posting date you used, because stock reports for a date and journal entries by period depend on it.
What goes wrong in inventory testing
| Symptom in the test cycle | Usual cause | How to prevent it |
|---|---|---|
| Before values change between "record before" and "post" | Another tester or an MRP or backflush job posted to the same product and storage location | Dedicated test products or storage locations; note job schedules in CMQ |
| Receipt refused on the 1st of the month | MM period not opened (MMPV) or FI period closed (OB52) | Make period opening a test precondition with an owner |
| 321 release does nothing in the stock report | Stock was in QM inspection lot stock; the usage decision should post it, not a manual 321 | Agree which products are QM-managed before writing the test |
| Plant-to-plant value difference is not $600 | Standard price for 1720 not released, or moving average used in one plant | Check price control and price per plant in the accounting view first |
| Reconciliation gap at cycle end | Manual journal entries to the inventory account, or price changes during the cycle | Block direct postings to inventory accounts; freeze price changes during the cycle |
Typical inventory test failures that are not defects in the movement itself.
Record the test cases, evidence and defects where the program keeps them: at Contoso that is test management in SAP Cloud ALM, with each test case linked to the requirement and the movement type it proves. For Public Edition, SAP's Test Automation Tool ships standard scripts for the common inventory processes that you can copy and adapt.
Inventory tests also need the right users and timing. Run receipts and issues with the warehouse clerk role and transfers with the role that will post them in production. Post some tests near a period boundary to check that posting periods are open and closed as intended: a receipt with a posting date in a closed period should be refused, and that refusal is evidence too. Finally, agree with Dan which inventory and GR/IR accounts will be reconciled after the cycle, so that the reconciliation is planned rather than improvised.
- Record stock and balances before, write expected results, post, record after, compare.
- Test receipts, transfers, issues, reversals, returns and refused postings.
- Evidence for every test: material document, journal entry and stock change.
- Reconcile stock value to the inventory G/L account at the end of each cycle.
- Protect before/after values from other testers and jobs; make period opening a precondition.
Check your understanding · not graded
Lesson check
1. What are the three pieces of evidence for an inventory posting?
2. Why record stock before posting?
3. Which reconciliation proves an inventory test cycle?
4. Which is a valid negative inventory test?