Lesson 5 of 6
Simulate and test
14 min
Listen to this lesson
A mapping isn't done when the lines are drawn. It's done when you can show that known inputs produce the expected outputs. Cloud Integration gives you two design-time tools for that, and neither needs a deployment. Simulate tests the entire mapping. Display Queue tests one node or function. Both run in the mapping editor, even when the flow isn't in edit mode, and both can use the same uploaded input file.
- Open the integration flow (or the mapping artifact) and select the mapping.
- Choose Simulate and select an input XML file from your computer. The data appears in the source message table.
- Choose Generate Test. The output appears in the target message table.
- Choose Download Output to keep the output file as evidence.
- Change a function or property, simulate again, and compare. You don't have to save the mapping to simulate.
A few rules from SAP's documentation are worth knowing. Simulating an incomplete mapping returns a validation error, so finish the structure first. Mapping simulation is supported only for the Cloud Integration runtime profile. Mappings that use scripts can be simulated too, which matters for lesson 6 and sap-pim-202.
- Pick inputsAnonymized ORDERS05 and INVOIC02 files taken from XP1 traffic, plus hand-made edge cases
- Write expected outputsFrom the partner's specification, or from the PO mapping's output for the same input
- SimulateRun each input; download the output file
- CompareDiff expected and actual; explain or fix every difference
- File the evidenceInput, expected, actual and result, stored with the test case
What to put in the sample set
| Case | Why it matters | ORDERS05 example |
|---|---|---|
| Happy path | Proves the main structure | One PO, three items, all partners present |
| Many items | Proves contexts and useOneAsMany | PO with 40 items |
| Optional data missing | Proves createIf, exists and defaults | No ship-to E1EDKA1 segment |
| Bulk message | Proves removeContexts and splitting | Two IDocs in one message |
| Edge values | Proves formats and precision | Quantities with 3 decimals, long texts, special characters |
| Invalid input | Proves the failure is visible | No E1EDK01 header: the flow must fail, not send a half order |
A minimal sample set for one mapping; keep the files with the test cases.
Migration regression: PO output as the oracle
For interfaces that move from XP1, the best expected output is often the one PO produces today. Run the same input through the ESR mapping's test function on PO and through Simulate in Cloud Integration, then compare the two outputs. Any difference must be explained: a deliberate improvement, a partner-agreed change, or a defect. sap-pim-301 builds this into a full migration regression approach. Here, learn to do it for one mapping.
Beyond the mapping, the integration flow simulation feature lets you test a whole flow or part of it before deployment. You can mock receiver responses on Request Reply steps, so calls to S/4HANA or Lakeside aren't needed. Use it when the mapping depends on headers or properties set by earlier steps.
- Simulate tests the whole mapping, Display Queue one node; neither needs deployment or saving.
- Keep a sample set with happy path, many items, missing optional data, bulk, edge values and invalid input.
- For migrated interfaces, compare against the PO output for the same input and explain every difference.
- Store input, expected output, actual output and result as evidence.
Check your understanding · not graded
Lesson check
1. What is the difference between Simulate and Display Queue?
2. A developer simulates a mapping whose target structure isn't fully mapped yet. What happens?
3. Why is PO's output for the same input a good expected result during Contoso's migration?
4. Which case belongs in a mapping sample set to prove failures are visible?