Showing results for 
Search instead for 
Did you mean: 

Double debtor line item in journal entries API S/4HANA Cloud

0 Kudos


We are using an API for S/4HANA cloud (Journal entries- POST, SOAP API). We want to know if it is possible to send in the API two debtor line items, as I show you below.

We use this API to post the payment of an invoice from the customer, but, when the customer has a down payment and we put two line items for the debtor, one with a debit code (S) and the other with the credit code (H), we get an error.

The first debtor line item makes reference to the down payment with a value of 89000

The second line item makes reference to the account balance with a value of 52176

The third debtor line item makes reference to the total of the invoice with a value of - 141176

The credits and the debits have the same amount

               <DocumentHeaderText>RECAUDO TITAN</DocumentHeaderText>
                  <AmountInTransactionCurrency currencyCode="COP">89000</AmountInTransactionCurrency>
                  <DocumentItemText>Down payment</DocumentItemText>
                  <Reference3IDByBusinessPartner>DAVID ----</Reference3IDByBusinessPartner>
                  <AmountInTransactionCurrency currencyCode="COP">52176</AmountInTransactionCurrency>
                  <DocumentItemText>ACCOUNT BALANCE</DocumentItemText>
                  <Reference3IDByBusinessPartner>DAVID ----</Reference3IDByBusinessPartner>
                  <AmountInTransactionCurrency currencyCode="COP">-141176</AmountInTransactionCurrency>
                  <DocumentItemText>TOTAL INVOICE</DocumentItemText>
                  <Reference3IDByBusinessPartner>DAVID ----</Reference3IDByBusinessPartner>
                  <AmountInTransactionCurrency currencyCode="COP">0</AmountInTransactionCurrency>
                  <TaxBaseAmountInTransCrcy currencyCode="COP">89000</TaxBaseAmountInTransCrcy>
                  <TaxBaseAmountInGroupCrcy currencyCode="COP">89000</TaxBaseAmountInGroupCrcy>
But, the API responds with a balance error:

Thank you in advance.

Best regards.

0 Kudos

I think the problem is with the that line "The second line item makes reference to the account balance with a value of 52176". The question is that do you really need it.

Presumably, the total debt owed as represented in invoice, is already in the system in the customer account. When the customer makes down payment, this would automatically reduce the amount outstanding in the corresponding customer account and simultaneously post the balance thereof. The system is built to do the calculations in the customer account. All the system needs to do is reflect balance in customer account. The question that follows is, does one really need to separately post account balance? Your proposition some how suggests duplication of tasks. Just a thought.

0 Kudos

The account balance is a function between invoice amount and down payment, which is through principles of debit and and credit is automatic. Whereas the down payment is made by the customer, this is settled at the Bank in absolute terms. Therefore, the reduction in customer outstanding amount will increase the Bank Balance, case closed.

View Entire Topic
0 Kudos

Just group nodes DebtorIetm together, without any other items in between.

Hint was given by Yang from SAP - cudos to him!