SAP Knowledge Base Article - Public

3778698 - Unstable CDS View Primary Key Causes Incorrect Data in CDS Replication

Symptom

Use a Data Flow with a CDS View source reading from an S/4HANA ABAP CDS View. After loading, the target HANA table contains shifted/incorrect data — column values of one record appear in rows belonging to other records.

The same CDS view used via Remote Table or Replication Flow may also return inconsistent results.

Environment

  • SAP Datasphere
  • SAP S/4HANA On-Premise

Cause

The primary key(PK) column of the ABAP CDS view is calculated dynamically inside a table function. Its values change depending on the filter conditions applied at query time. As a result:

  • The same PK value may correspond to different physical rows across executions.
  • CDS replication relies on stable PKs to track row-level changes — an unstable PK causes incorrect rows to be overwritten in the target.

This is not a Datasphere product bug. The root cause is the CDS view design that violates the CDC prerequisite of stable, unique primary keys.

Resolution

The fix must be implemented by the responsible person of the CDS view. 

Redesign the primary key column to use stable, unique values that do not change based on runtime.

Keywords

KBA , BC-DB-CDC , ABAP CDC Engine (Change Data Capture) , DS-DI-DF , Data Flow Runtime , Problem

Product

SAP Datasphere all versions