SAP Message CACS_SE046 - A key was changed during enrichment of settlement documents

Diagnosis
A key field was changed in the document table in the BAdI SettlementRun: Enrich Settlement Document (CACS_SETTLEMENT_RUN_ENR_DOC).
This change is not permitted since the key for the uniqueidentification of the entry is used. Before thesettlement documents areenriched, the SAP fields are temporarily stored and they are thenwritten again by the enriched documents so that only thecustomer's own fields are changed and the documents remain consistent.

Procedure
Adjust the BAdI for enriching the settlement documents in such a waythat no key of the line items is changed