cancel
Showing results for 
Search instead for 
Did you mean: 

Getting 202 Accepted With No Results by Calling "Journal Entry - Post (Asynchronous)"

YuAkiyama
Explorer
0 Kudos
1,222

Dear Experts.

I have problem calling Journal Entry Posting SOAP API. I'm calling "Journal Entry - Post (Asynchronous)" API and getting status code 202 with no result. As I check Manage Journal Entries application, none of the journal entry was created. However, in Technical Monitoring application, which I selected "Message Monitoring SOAP Error Log," there is no error.

I'm posting details below. Please tell me if I made any mistake.

<URL>

http://{{host}}/sap/bc/srt/scs_ext/sap/journalentrybulkcreationreques?MessageId={{GUID}}

Defined {{host}} in Communication System and setting GUID in {{GUID}}

<Authentication>

Defined user information in Communication Arrangements application, and as I'm not getting 401 Unauthorized, authentication should be fine. If I change username value, I can get statuscode 401, so getting 202 also shows authentication is fine.

<Header>

I'm trying to call API by using Postman. Before createing request, I imported WSDL file of the API I want to call. Then, I set the header below.

  • Content-Type:text/xml
  • SOAPAction:http://sap.com/xi/SAPSCORE/SFIN/JournalEntryBulkCreationRequest_In/JournalEntryBulkCreationRequest_InRequest

<Request>

I'll post XML Request below. I created request by trial and error, until I get no errors. I filled required value, and I created <Item> and <CreditorItem> Tag which I saw in someone's blog.

I saw API Refference biut didn't really get how the Item, DebtorItem, CreditorItem works, so this part might be mistaking.

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

Thank you.

Mark_W
Product and Topic Expert
Product and Topic Expert
0 Kudos

We helped you to accept the answer, since there were no updates after 7 days.

You can unaccept it anytime if you have further questions.

Accepted Solutions (1)

Accepted Solutions (1)

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Yu,

If return code is 202, it normally means the API posting was accepted by the gateway and the data generation coding was executed.

However, there could be error with the functional area.

You need to check the errors in Message Dashboard.

For more details, please check below blogs:

https://blogs.sap.com/2018/08/26/example-of-synchronous-vs-asynchronous-apis-in-sap-s4hana-cloud/

https://blogs.sap.com/2018/03/07/api-extensibility-in-sap-s4hana-cloud-and-monitoring-with-aif/

Best Regards,
Owen

YuAkiyama
Explorer
0 Kudos

Hi Owen.

Thanks for a reply.

I tried to get messages from Message Dashboard, but no there were no message. I actually called API several times today. What can I do other than using Message Dashboard.

Best Regards,

Yu

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Yu,

From your payload, the message time is on 11th.

Could you check whether there is anything on 11th?

Best Regards,
Owen

Answers (0)