MOVE_CAST_ERROR — MOVE_CAST_ERROR dump: failed dynamic type cast
MOVE_CAST_ERROR is raised when a dynamic cast using the CAST operator or the narrowing move ?= tries to assign an object reference, interface reference, or data reference to a target type that the runtime object does not actually support. The exception class behind it is CX_SY_MOVE_CAST_ERROR. It almost always points to a class hierarchy or BAdI implementation mismatch, not a data value problem.
This page covers the MOVE_CAST_ERROR short dump raised by CX_SY_MOVE_CAST_ERROR when a narrowing cast between reference types fails at runtime. It walks through the class-hierarchy and BAdI causes that actually trigger it, what to read in ST22 to identify source and target types, and the branching resolution path depending on whether the mismatch is a development defect or a transport inconsistency.
Published 16 Sept 2026· 1,151 words
What the dump means
MOVE_CAST_ERROR fires when ABAP OO code attempts a downcast or interface cast with the ?= operator, or an explicit CAST( ) expression, and the object instance on the right-hand side does not implement the interface or is not an instance of the target class named on the left-hand side. Unlike a plain type mismatch on flat data, this is a reference-type compatibility failure evaluated at runtime because the compiler cannot verify polymorphic assignments statically. The exception raised is CX_SY_MOVE_CAST_ERROR, catchable in a TRY block, but when uncaught it terminates the program as this dump. It also occurs with dynamic data references created through RTTI when the target reference type declared does not match the runtime type of the object the reference points to.
Root causes that actually produce it
- BAdI implementation returns the wrong object type: the enhancement framework instantiates an implementation class through a factory or filter combination, and the calling code then casts the result to an interface the active implementation does not actually implement, usually after a custom implementation was added without matching the interface signature.
- Interface changed without updating implementers: a shared interface gained or lost a method or the interface itself was reassigned to a class, but one implementing class in a customer namespace was not regenerated or was still bound to the old interface version, common right after a transport that touched only part of the object list.
- Downcast to the wrong subclass: generic handler code holds a reference typed to a superclass or interface and casts it down to a specific subclass based on an assumption (a type field, a BAdI filter value) that does not hold for the current instance.
- Transport landscape inconsistency: the interface or class definition in the target system is at a different version than in the source system because dependent objects were not transported together, so the cast is valid in development but not yet in quality or production.
- Dynamic object creation via RTTI or factory pattern mismatched with the static declared type of the reference variable used to hold it, typically in generic persistence, workflow, or output-management frameworks that instantiate classes by name from configuration.
- Custom code casting a generic CL_ABAP_.. container object to a business type without checking IS INSTANCE OF first, inherited from copy-pasted framework example code.
What to inspect in ST22
- Exception class field: confirms CX_SY_MOVE_CAST_ERROR and distinguishes this from an unrelated uncaught exception dump.
- Program name, include, and line number in the 'Where' section: identifies the exact CAST or ?= statement and the enclosing method.
- The 'What happened' / error analysis text: it names the actual runtime type of the source object and the target type the code demanded, this pair is the single most useful piece of information on the whole dump.
- Call stack above the failing line: shows which factory, BAdI dispatcher, or generic handler produced the mismatched object, walk up until a filter value, configuration key, or customizing entry is visible.
- System and client, plus timestamp: check whether this is reproducible or a one-off tied to a specific business object instance.
- Follow-on: SE24 to inspect the class hierarchy and confirm which interfaces the runtime class actually implements, SE18 and SE19 if a BAdI is in the call stack, SE03 or the transport log if the same code behaves differently across systems.
Resolution path
If a BAdI implementation is the source, use SE19 to check which implementation is active for the filter values in the failing instance and confirm the implementing class actually satisfies the interface the caller expects; deactivating a wrongly-scoped custom implementation is often the fastest safe fix, but any change to which implementation is active in production requires a change request. If an interface was changed and one implementer not updated, the fix is a code change in the lagging class and needs a transport through the normal development pipeline, not a quick note in production. If the cause is a transport inconsistency between systems, this is a basis and transport management issue, not a code defect, resolve by re-transporting the missing dependent object rather than touching the code. If a downcast assumption is simply wrong, replace the blind cast with an IS INSTANCE OF check and branch logic, which is a development fix requiring testing of every code path that previously relied on the assumption holding.
The fix people try first (and why it fails)
The near-universal reflex is to wrap the offending CAST or ?= statement in a TRY block catching CX_SY_MOVE_CAST_ERROR and doing nothing, or logging and continuing. This stops the dump but the object that failed to cast is simply skipped, and downstream processing silently proceeds without it. In workflow, output determination, or BAdI dispatch chains this produces missing documents, missing approvals, or partial postings with no error visible to the business user, which surfaces days later as a data discrepancy far harder to diagnose than the original dump.
Prevention
Enforce IS INSTANCE OF checks before any narrowing cast in generic or framework-facing code, particularly in BAdI implementations and factory patterns where the object source is configuration-driven rather than statically known. When an interface used by more than one implementer changes, treat every implementing class as part of the same change request and test them together. Keep dependent objects bundled in the same transport request as the interface or class they depend on so a partial transport cannot leave one system at a different version than another.
Whose problem this is
This is an ABAP development issue in nearly all cases; a functional consultant is involved only when the failing cast sits inside a BAdI implementation tied to a business configuration decision. The handover note should include the exact class and interface names from the dump analysis text, the filter or configuration values active for the failing instance, and whether the same cast succeeds in a different system, which tells the developer whether to look at code logic or transport state.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-abap-dumps/move-cast-errorERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.