Symptom
After an ALTER TABLE statement changes the scale (number of fractional digits) of a DECIMAL column, the existing values in that column are wrong. The statement finishes without an error, but the stored numbers are now smaller by a power of ten.
Example: a column defined as DECIMAL(22,6) holds values such as 219 and 919. After it is altered to DECIMAL(28,12), the same rows return 0.000219 and 0.000919, which is the original value divided by 10^6.
This often goes unnoticed until totals or reports look wrong, because no DDL error is raised. A common trigger is an S/4HANA upgrade run with the Software Update Manager (SUM), which can execute such ALTER TABLE statements on application tables.
Cause
This is a defect in the SAP HANA database engine. When the new scale does not require a change of the column's internal representation, HANA applies an internal data transformation that skips the value conversion. The internal type check does not take the changed number of fractional digits into account, so the existing values are rescaled unintentionally.
Who is affected
All of the following must apply:
- The system runs SAP HANA 2 SPS08 up to revision 089.06, or SAP HANA Cloud 2025 QRC 1 – QRC 4 or 2026 QRC 1 – QRC 4.
- A column table has a column of type
DECIMAL. - An
ALTER TABLEstatement changed the scale of that column, for example during an S/4HANA upgrade with SUM. - The column was not compressed at the time of the
ALTER TABLE.
To check the compression state of a column:
SELECT COMPRESSION_TYPE
FROM M_CS_COLUMNS
WHERE TABLE_NAME = '<TABLE_NAME>'
AND COLUMN_NAME = '<DECIMAL_COLUMN>';A result of DEFAULT means the column is not compressed.
Prevent the issue on SAP HANA 2 SPS08
At the time of writing, SAP has not yet released an SPS08 revision with a permanent fix. Until it is available, disable the direct import optimization before running upgrades or other DDL that changes decimal scales:
ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'SYSTEM')
SET ('nseconfig', 'direct_import_with_up') = 'false'
WITH RECONFIGURE;Keep in mind:
ALTER TABLEoperations may run slower with this setting. Table moves, partitioning and index creation are not affected.direct_import_with_upis an internal parameter. Use it only for this issue and only as SAP describes.- Remove the setting once you are on a revision that contains the permanent fix:
ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'SYSTEM')
UNSET ('nseconfig', 'direct_import_with_up')
WITH RECONFIGURE;On SAP HANA Cloud, SAP mitigates the issue automatically. No parameter change is needed.
Correct data that is already affected
Back up the affected tables before changing anything. A wrong UPDATE makes the inconsistency worse.
- If table
TRST_CLASFLOis affected, open an SAP support case on component FIN-FSCM-TRM-TM. - For any other table, contact SAP Support before running a correction.
The correction itself is a manual UPDATE that multiplies the affected values back by the scale difference:
- Correction factor = 10^(new fractional digits − old fractional digits)
- For
DECIMAL(22,6)→DECIMAL(28,12)the factor is 10^(12 − 6) = 1,000,000.
UPDATE <TABLE_NAME>
SET <DECIMAL_COLUMN> = <DECIMAL_COLUMN> * <FACTOR>
WHERE <CONDITION>;The hard part is the WHERE condition. Only rows that were rescaled may be corrected, and identifying them requires knowing which value ranges are plausible for the business data in that column. Agree on the condition with SAP Support and the application owner, and test it on a copy first.
Confirm the result
After the correction, compare totals and sample records against a pre-upgrade backup or a source system. Check reports and downstream extracts that read the column, since they may have cached or replicated the wrong values in the meantime.