Sub topic 14
Reading Messages and Correcting Errors
This chapter assumes you have created a migration project, prepared source data, and run at least a validation or simulation step. You should know what a migration object is and how the cockpit moves through its steps.
Where messages come from
The cockpit reports messages at every step that checks data: validation, value mapping, simulation, and execution. Each message is tied to an object instance, which is one record to be migrated, such as a single customer or G/L account. Messages carry a severity.
| Severity | Meaning | Effect |
|---|---|---|
| Information | Something worth knowing | None |
| Warning | Data may be unexpected | The instance can still be migrated |
| Error | Data cannot be processed | The instance is not migrated |
An instance with at least one error is not loaded. Other instances in the same run are still processed, so one bad record does not stop the whole object.
A repeatable correction loop
Work through errors in the same order each time.
- Open the object and filter the instances by status, such as "Error".
- Read the message text and note which field and which key it names.
- Decide where the cause lies: the source data, a value mapping, or a missing prerequisite object.
- Fix it at the source, then reload or update the data.
- Repeat the failing step, starting with validation and then simulation.
Common causes
- Values that are too long or in the wrong format. A name exceeds the target field length, or a date uses the wrong format.
- Duplicate keys. Two rows share the same legacy identifier.
- Unmapped values. A source value, such as a country or unit code, has no target value in the mapping.
- Missing dependencies. A material refers to a material group that was never loaded, so the load order matters.
- Missing customizing. The target system lacks a setting the data relies on, such as a company code or account group.
Fix the first two before you upload, because that is cheaper than finding them in the cockpit. The script below checks a CSV extract for duplicate keys and over-long values. The file and field names are placeholders, not SAP template fields.
import csv
from collections import Counter
def precheck(path, key_field, max_lengths):
"""Return a list of problems found in a source CSV before upload."""
problems = []
keys = Counter()
with open(path, newline="", encoding="utf-8") as f:
for line_no, row in enumerate(csv.DictReader(f), start=2):
keys[row[key_field]] += 1
for field, limit in max_lengths.items():
if len(row[field]) > limit:
problems.append(f"line {line_no}: {field} is longer than {limit} characters")
problems += [f"duplicate key {k}" for k, n in keys.items() if n > 1]
return problems
for problem in precheck("customers.csv", "CustomerId", {"Name": 40}):
print(problem)Correcting without losing track
Where you correct depends on the cause. Source data errors belong in the source file or table, so that the next test cycle starts clean. Mapping errors are fixed in the value mapping step. Fixing a record only in the target system hides the problem, and it returns in the next cycle.
After execution, some instances may be migrated and others not. Correct the failed ones and migrate them again. Do not load the whole object a second time, because already migrated records could be duplicated or rejected.
Exercise
A simulation of a customer object shows 300 errors, and 280 of them say the same country code has no target value. What is the most efficient fix, and what do you do afterward?
Show answer
Add the missing country code to the value mapping, which clears all 280 errors at once. Then repeat the validation and simulation, and review the remaining 20 errors individually.