Lesson 3 of 5
Creating preconditions
9 min
Preconditions are the transactional states a scenario expects before step 1: stock on the shelf, invoices open on the customer's account, an approved credit limit, an open posting period. Creating them is often a mini-process of its own. Done carelessly, it creates side effects that confuse the real test.
Stock
For a scenario that sells or consumes stock, someone has to put stock there first. There are two common routes in a test client:
| Route | How | When to use | Watch out for |
|---|---|---|---|
| Initial entry of stock | Goods movement with movement type 561 in MIGO (or the Manage Stock app), for unrestricted stock; 563 and 565 exist for quality inspection and blocked stock | Quick setup of stock for scenarios where how the stock arrived does not matter | Valuation uses the product's price unless you enter an amount; it posts against an initial-entry offset account, not GR/IR |
| Real inbound process | Purchase order and goods receipt (movement type 101), or a production order receipt | When the scenario also needs PO history, GR/IR or realistic costs | Takes longer and depends on procurement data being ready |
Initial entry is a data migration movement. Many projects allow it in test clients for setup, but agree that with the finance key user, because the offset postings land in finance reports that someone else may be reconciling in the same client.
Open items
Scenarios such as incoming payment, dunning or the payment run need open items on customer or supplier accounts. You can create them by running the real process (sell, deliver, bill), which is realistic but slow, or by posting invoices directly in accounting, for example with FB70 for a customer invoice and FB60 for a supplier invoice in SAP GUI, or the equivalent Fiori apps in your roles. Direct postings are fast, but they have no sales or purchasing history behind them, so do not use them for scenarios that check document flow.
Credit limits
In SAP S/4HANA, credit limits are managed in SAP Credit Management. The limit is stored on the business partner's credit account per credit segment, maintained in SAP GUI with UKM_BP or in the Manage Credit Accounts app. The credit check compares the limit with the customer's exposure, which typically includes open orders, open deliveries and open receivables. For a credit scenario, set an exact limit and know the current exposure, so you can predict whether the next order should pass or block.
Prior-period balances
Some scenarios need history: a period-end close needs postings in the period being closed, an aging report needs receivables of different ages, and a comparison report needs last year's figures. These are the hardest preconditions to create, because SAP rightly prevents most postings into closed periods. Options, in order of preference: run the scenario later in the cycle so real test postings have aged; ask finance to open a prior period briefly for setup postings, under control and with a record of what was posted; or use a masked production copy that already holds history (lesson 4). Whatever you choose, write it in the data sheet so the result can be explained later.
Periods and posting dates
Every posting has a date, and the date must fall in an open period. Finance controls posting periods per company code (in SAP GUI OB52, or the Manage Posting Periods app in Fiori). Materials management has its own period, which normally allows postings only in the current and previous period and is moved forward with MMPV. Test clients that are not maintained can end up with closed periods and every goods movement failing.
- Is the posting date in an open financial period for company code 1710?Yes → next question · No → ask finance to open it or change the date
- Is it in the current or previous materials management period?Yes → next question · No → materials management period must be moved forward
- Is the price or condition valid on that date?Yes → post · No → adjust validity or the date in the data sheet
What would you do?
Contoso's QAS client 100 was refreshed last week. On day one of UAT cycle 2, every goods issue fails with a period error, though orders and deliveries work. What is the most likely cause and fix?
- Create stock with initial entry (movement type 561) for speed, or the real inbound process when history matters.
- Create open items through the real process or by direct invoice posting, depending on what the scenario checks.
- Credit scenarios need an exact limit and known exposure in SAP Credit Management (UKM_BP or Manage Credit Accounts).
- Check financial and materials management periods; write dates relative to the run.
- Record the "before" state of preconditions as part of the evidence.
Check your understanding · not graded
Lesson check
1. Which movement type posts an initial entry of unrestricted stock?
2. Where are credit limits maintained in SAP S/4HANA?
3. When should you avoid creating open items by direct invoice posting?
4. Why write dates relative to the run, such as "today + 5 working days"?