cancel
Showing results for 
Search instead for 
Did you mean: 

"Journal Entry - Post (Asynchronous)" Posts Negative Value

YuAkiyama
Explorer
0 Kudos
307

Hi Experts.

I'm having trouble with the result for calling "Journal Entry - Post (Asynchronous)" API. I'm checking how this API works, and by posting with this API, I only get negative values like below.

I'm checking payload by trial and error, but didn't came up with correct way.

What I did, was changing second item's value to positive "110000" and switching DebitCreditCode to "H". However, a journal entry didn't have been posted, so it means the payload is wrong.

So my question is,

- Which parameter is defining to post with a negative value?

- Am I defining payload with wrong way, to be posted as a negative value?

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:sfin="http://sap.com/xi/SAPSCORE/SFIN">
    <soapenv:Header/>
    <soapenv:Body>
        <sfin:JournalEntryBulkCreateRequest>
            <MessageHeader>
                <ID>API_TEST</ID>
                <CreationDateTime>2023-04-19T14:40:00.1234567Z</CreationDateTime>
            </MessageHeader>
            <JournalEntryCreateRequest>
                <MessageHeader>
                    <ID>API_TEST</ID>
                    <CreationDateTime>2023-04-19T14:40:00.1234567Z</CreationDateTime>
                </MessageHeader>
                <JournalEntry>
                    <OriginalReferenceDocumentType>BKPFF</OriginalReferenceDocumentType>
                    <BusinessTransactionType>RFBU</BusinessTransactionType>
                    <AccountingDocumentType>SA</AccountingDocumentType>
                    <CreatedByUser>CB9980000002</CreatedByUser>
                    <CompanyCode>1510</CompanyCode>
                    <DocumentDate>2023-04-19</DocumentDate>
                    <PostingDate>2023-04-19</PostingDate>
                    <Item>
                        <ReferenceDocumentItem>1</ReferenceDocumentItem>
                        <GLAccount>10010000</GLAccount>
                        <AmountInTransactionCurrency currencyCode="JPY">110000</AmountInTransactionCurrency>
                        <DebitCreditCode>H</DebitCreditCode>
                        <DocumentItemText>Test Item 1 DebitCreditCode H</DocumentItemText>
                    </Item>
                    <Item>
                        <ReferenceDocumentItem>2</ReferenceDocumentItem>
                        <GLAccount>10010000</GLAccount>
                        <AmountInTransactionCurrency currencyCode="JPY">-110000</AmountInTransactionCurrency>
                        <DebitCreditCode>S</DebitCreditCode>
                        <DocumentItemText>Test Item 2 DebitCreditCode S</DocumentItemText>
                    </Item>
                </JournalEntry>
            </JournalEntryCreateRequest>
        </sfin:JournalEntryBulkCreateRequest>
    </soapenv:Body>
</soapenv:Envelope>

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

daviddasilva
Active Contributor

Hi,

In my experience it is much easier to leave out the field DebitCreditCode. Just focus on the sign on the amount value, where negative values will post as a credit, and positive values will post as a debit.

Kind regards,

David

YuAkiyama
Explorer
0 Kudos

Hi David.

Thank you for a reply, and as you mensioned, deleting field DebitCreditCode field worked as I wanted. I was thinking DebitCreditCode is the only field to define credit or debt, so I didn't try deleting it.

Thank you so much...

Yu

Answers (1)

Answers (1)

Giulio_Grandine
Product and Topic Expert
Product and Topic Expert
0 Kudos

From the help documentation: This service supports negative posting on header level. Negative posting can be set if DebitCreditCode doesn't sign off the amount in all items. So it seems that the problem is with the DebitCreditCode, without knowing the details of what you are trying to post unfortunately I can't make any recommendation, but just make sure that the Code you use signs off the amount in all items.

Journal Entry - Post (Asynchronous) | SAP Help Portal