SAP Knowledge Base Article - Public

3219486 - Error "D/C-Code does not fit to sign of amount in some items" in API SAP_COM_0002 SAP S/4HANA Cloud

Symptom

Error "D/C-Code does not fit to sign of amount in some items" appears in API SAP_COM_0002 (Journal Entry - Post API).

Environment

SAP S/4HANA Cloud

Reproducing the Issue

While posting a Payload file with API Journal Entry - Post (API SAP_COM_0002) the below error occurs;
"D/C-Code does not fit to sign of amount in some items".

Cause

On CE1911, the API SAP_COM_0002 has been enhanced to check the matching between the DebitCreditCode and the sign of amount for the new feature of negative posting.
For normal posting, the DebitCreditCode should be S if the sign of amount is positive or the DebitCreditCode should be H if the sign of amount is negative.
In case such mismatching occurs for partial items, it leads to the error "D/C-Code does not fit to sign of amount in some items.

Resolution

Make sure that the DebitCreditCode is S if the sign of amount is positive or the DebitCreditCode is H if the sign of amount is negative.

If it is not used, DebitCreditCode for each item can be removed. The program will determine the DebitCreditCode automatically according to the sign of amount.

Keywords

API, SAP_COM_0002, API Journal Entry - Post, DebitCreditCode, D/C-Code does not fit to sign of amount in some items, Debit code, credit code, S, H, , KBA , AC-INT , Accounting Interface , Problem

Product

SAP S/4HANA Cloud 1911 ; SAP S/4HANA Cloud 2002 ; SAP S/4HANA Cloud 2005 ; SAP S/4HANA Cloud 2008 ; SAP S/4HANA Cloud 2011 ; SAP S/4HANA Cloud 2102 ; SAP S/4HANA Cloud 2105 ; SAP S/4HANA Cloud 2108 ; SAP S/4HANA Cloud 2111 ; SAP S/4HANA Cloud 2202 ; SAP S/4HANA Cloud 2208 ; SAP S/4HANA Cloud 2302