Skip to Content
0
Jun 21, 2023 at 12:04 PM

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

116 Views

Hi,

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

            <JournalEntry>
               <OriginalReferenceDocumentType>BKPFF</OriginalReferenceDocumentType>
               <BusinessTransactionType>RFBU</BusinessTransactionType>
               <DocumentReferenceID>RECAUDOS</DocumentReferenceID>
               <AccountingDocumentType>ZD</AccountingDocumentType>
               <DocumentHeaderText>RECAUDO TITAN</DocumentHeaderText>
               <CreatedByUser>CB9980000013</CreatedByUser>
               <CompanyCode>4810</CompanyCode>
               <DocumentDate>2023-06-20</DocumentDate>
               <PostingDate>2023-06-20</PostingDate>
               <TaxDeterminationDate>2023-06-20</TaxDeterminationDate>   
               <DebtorItem>
                  <ReferenceDocumentItem>1</ReferenceDocumentItem>
                  <Debtor>1000965</Debtor>
                  <AmountInTransactionCurrency currencyCode="COP">89000</AmountInTransactionCurrency>
                  <DebitCreditCode>S</DebitCreditCode>
                  <DocumentItemText>Down payment</DocumentItemText>
                  <Reference1IDByBusinessPartner>-----</Reference1IDByBusinessPartner>
                  <Reference3IDByBusinessPartner>DAVID ----</Reference3IDByBusinessPartner>
                  <DownPaymentTerms>
                  <SpecialGLCode>A</SpecialGLCode>
                  <TaxCode>V0</TaxCode>
                  </DownPaymentTerms>
               </DebtorItem>
               <Item>
                  <ReferenceDocumentItem>2</ReferenceDocumentItem>
                  <GLAccount>11051050</GLAccount>
                  <AmountInTransactionCurrency currencyCode="COP">52176</AmountInTransactionCurrency>
                  <DebitCreditCode>S</DebitCreditCode>
                  <DocumentItemText>ACCOUNT BALANCE</DocumentItemText>
                  <Reference1IDByBusinessPartner>-----</Reference1IDByBusinessPartner>
                  <Reference3IDByBusinessPartner>DAVID ----</Reference3IDByBusinessPartner>
                  <AccountAssignment>
                     <ProfitCenter>4810111121</ProfitCenter>
                  </AccountAssignment>
               </Item>
               <DebtorItem>
                  <ReferenceDocumentItem>3</ReferenceDocumentItem>
                  <Debtor>1000965</Debtor>
                  <AmountInTransactionCurrency currencyCode="COP">-141176</AmountInTransactionCurrency>
                  <DebitCreditCode>H</DebitCreditCode>
                  <DocumentItemText>TOTAL INVOICE</DocumentItemText>
                  <AssignmentReference>0090000057</AssignmentReference>
                  <Reference1IDByBusinessPartner>-----</Reference1IDByBusinessPartner>
                  <Reference3IDByBusinessPartner>DAVID ----</Reference3IDByBusinessPartner>
               </DebtorItem> 
               <ProductTaxItem>
                  <TaxCode>V0</TaxCode>
                  <TaxItemClassification>VST</TaxItemClassification>
                  <AmountInTransactionCurrency currencyCode="COP">0</AmountInTransactionCurrency>
                  <DebitCreditCode>S</DebitCreditCode>
                  <TaxBaseAmountInTransCrcy currencyCode="COP">89000</TaxBaseAmountInTransCrcy>
                  <TaxBaseAmountInGroupCrcy currencyCode="COP">89000</TaxBaseAmountInGroupCrcy>
               </ProductTaxItem>                         
            </JournalEntry>
         </JournalEntryCreateRequest>
      </sfin:JournalEntryBulkCreateRequest>
   </soapenv:Body>
</soapenv:Envelope>
But, the API responds with a balance error:

image.png

Thank you in advance.

Best regards.

Attachments

image.png (78.0 kB)