COMPUTE_BCD_OVERFLOW — COMPUTE_BCD_OVERFLOW Runtime Error
COMPUTE_BCD_OVERFLOW fires when an arithmetic operation on a packed decimal (type P) field produces a result larger than the field's defined length and decimal places can hold. It is almost always a mismatch between the magnitude of business data (quantity, amount, exchange rate) and a field or variable declared too small, not a system fault.
Covers why COMPUTE_BCD_OVERFLOW is thrown during packed-decimal arithmetic in ABAP, the recurring data and coding patterns that cause it, and how to trace the failing statement and field in ST22 before deciding whether the fix is a data correction, a field extension, or a logic rewrite. Also flags the reflex fixes that mask the overflow instead of resolving it.
Published 16 Sept 2026· 1,256 words
What the dump means
This dump occurs when an ABAP statement performing arithmetic on packed decimal (type P) fields - COMPUTE, MULTIPLY, ADD, DIVIDE, or an inline arithmetic expression - produces a result that exceeds the number of digits or decimal places the target field can store. Packed fields have a fixed length and fixed decimal scale defined in the ABAP Dictionary or the local declaration; unlike floating point, there is no silent widening. The underlying exception is a catchable arithmetic overflow exception, meaning the statement can be wrapped in TRY/CATCH if the business logic can tolerate handling it, but by default an unhandled occurrence terminates the program. It is a symptom of a value mismatch, not a kernel or database problem, and the same line of code can run correctly for years until a value finally exceeds the field's capacity.
Root causes that actually produce it
- Target field too short for the operation: the classic case is quantity multiplied by price, or amount multiplied by an exchange rate, written into a field with fewer digits or fewer decimal places than the result requires. This is the single most common trigger, especially in custom reports and interfaces.
- Currency and decimal-place mismatches: hardcoding a scale factor (dividing or multiplying by 100) without checking the currency's actual number of decimal places. Currencies with zero decimals, such as JPY or KRW, break code written assuming two decimals everywhere, producing values a hundred times larger than expected.
- Unbounded accumulators in loops: summing amounts or quantities into a locally declared packed field across a large internal table without checking for realistic bounds. Works fine in development with a handful of test records, fails in production once volume grows.
- Unit-of-measure conversion factors: converting between base unit and an alternative unit of measure with a large conversion factor (pieces to milligrams, for example) where the target quantity field cannot hold the converted number.
- Interface and BAPI mapping errors: moving a value from an external system or a BAPI return structure into a locally defined variable that was sized for a narrower value range than the source system actually sends.
- Data migration and mass upload defects: legacy monetary values loaded through LSMW, batch input, or a custom upload program that exceed the standard SAP amount field length, usually because the legacy system used a different currency or a different order of magnitude.
- Negative or reversed sign logic doubling a value: a correction or reversal routine that adds a value twice instead of netting it, pushing an otherwise normal-looking amount past the field boundary.
What to inspect in ST22
- Program, include and line number in the dump header: pinpoints the exact arithmetic statement, not just the calling transaction.
- The short text and error analysis text: usually names the specific field or work area component that overflowed, and sometimes shows the field's length and decimal places.
- Source code extract with the highlighted statement: identifies whether it is MULTIPLY, COMPUTE, ADD, DIVIDE, or an implicit conversion inside a MOVE with arithmetic.
- Active variables at the point of the dump: check the actual runtime values of the operands, particularly quantity, exchange rate, or conversion factor fields, to see how far past the limit the result landed.
- Call stack: confirms whether this is standard code being fed bad data by a customer exit or enhancement, or genuinely custom Z code.
- Cross-check the failing field's data element and domain in SE11 or SE80 to see its defined length and decimal places against the values seen in the variable list.
- If the dump came from a background job, check SM37 for the job's selection parameters and SM21 for concurrent system messages that might explain an unusual input volume.
Resolution path
If the failing field is a customer-defined (Z) field that is simply too small for realistic business values, extend its length or decimal places in the Dictionary and adjust dependent code; this is a standard transportable change with functional sign-off on the new maximum expected value. If the cause is a currency decimal-place assumption hardcoded into custom logic, replace the fixed scale factor with logic that reads the currency's actual decimal places rather than assuming two. If it is an unbounded accumulator, either move to a larger intermediate field with generous headroom or restructure the summation to aggregate in stages using an existing totals table designed for the volume. If the root cause is bad source data from a migration or interface, correct the data at the source and reprocess; do not widen the standard SAP target field to accommodate garbage input. If the overflow occurs inside standard SAP code and no custom exit is feeding it an out-of-range value, that is the only scenario justifying an incident to SAP support; confirm the custom code path is clean first, since most of these dumps are self-inflicted and do not need SAP involvement at all.
The fix people try first (and why it fails)
The near-universal reflex is to blindly increase the target field's length or decimal places without asking why the value got that large in the first place. This clears the dump but leaves the actual defect, an unbounded loop, a wrong conversion factor, a doubled posting, silently producing wrong numbers that no longer crash but are simply incorrect. An equally damaging variant is wrapping the statement in TRY/CATCH against the arithmetic overflow exception and swallowing it, which lets processing continue with a truncated or zeroed value and corrupts downstream postings without anyone noticing until reconciliation fails weeks later.
Prevention
Size packed fields against the genuine maximum business value, not the value seen in test data, and document that assumption next to the declaration. Never hardcode a currency decimal-place assumption; derive it from the currency's own decimal configuration. Add explicit range checks before multiplication or accumulation in custom code handling quantities, exchange rates, or conversion factors, and raise a proper business exception rather than letting the runtime catch it. Include boundary-value test cases (maximum quantity, zero-decimal currency, large conversion factor) in unit testing for any development that performs packed arithmetic.
Whose problem this is
This is an ABAP development issue in the large majority of cases, since the fix is a code or Dictionary change rather than a Basis configuration change. Functional consultants are needed to confirm realistic maximum values for the business scenario (largest expected order quantity, currency in use, conversion factor range). The handover note should state the program, line, failing field, its current length and decimals, the actual value that triggered the overflow, and the business transaction that produced it.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-abap-dumps/compute-bcd-overflowERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.