Skip to Content
Technical Articles

User Guide for Journal Entry Post API on S/4 HANA Cloud

Content

1      Purpose. 6

2      How to Create Communication User, Communication System and Communication Arrangement 7

2.1          Create Communication System and Communication User 7

2.2          Create Communication Arrangement 9

3      How to Create Extension Field and Enable It for Journal Entry Post API 11

4      How to Test API 14

4.1          How to Install SOAPUI 14

4.2          How to Test Synchronous API with SOAPUI 14

4.3          How to Test Asynchronous API with SOAPUI 17

5      How to Check Response Message. 19

5.1          How to Check Response Message for Synchronous API 19

5.2          How to Check Response Message for Asynchronous API 20

6      Some Common Queries. 22

6.1          Typo in payload. 22

6.2          Extension field is not displayed in Fiori App Manage Journal Entry. 23

6.3          Consulting about Payment Terms. 24

6.4          Consulting if Customer/Vender Payment is supported. 25

6.5          Consulting about Partner Bank Type. 26

6.6          Consulting about Tax Caculation. 26

7      Important New Features. 28

CE1905. 28

8      Appendix. 28

1      Purpose

Journal Entry Post API provides SOAP APIs which enable remote systems to post journal entries to the S4/HANA tenant.
The API has two types of SOAP inbound interfaces. One is the synchronous SOAP inbound interface “JournalEntryCreateRequestConfirmation_In”. The other is asynchronous SOAP inbound interface “JournalEntryBulkCreationRequest_In”.  Starting with CE1811, these 2 SOAP APIs support field extensibility.

This document describes the following topics:

1.     How to create communication user, communication system and communication arrangement

2.     How to create extension field and enable it for Journal Entry Post API

3.     How to test API

4.     How to check response message

2  How to Create Communication User, Communication System and Communication Arrangement

2.1    Create Communication System and Communication User

Procedure

  1. Log on to the SAP Fiori launchpad as Administrator.
  2. Under Communication Management, choose the Communication Systems tile.
  3. On the Communication Systems screen, choose New.
  4. Enter System ID and System Name.
  5. Click Create.
  6. Enter any value in the mandatory field Host Name. The actual value is not used in this Communication Scenario and thus can be freely defined.
  7. Under User for Inbound Communication, choose + to add a user for inbound communication.
  8. On the New Inbound Communication User screen, choose New User.
  9. On the Create Communication User screen, make the following entries:a.     User Name: Enter a user name.b.     Description: Enter a descriptionc.     Password: Enter a password and remember it for a later step.
  10. Choose Create.
  11. Click OK and SAVE the Communications System.
  12. Return to the SAP Fiori launchpad.

2.2    Create Communication Arrangement

Procedure

  1. Under Communication Management, choose the Communication Arrangements tile.
  2. On the Communications Arrangements screen, click New and select the scenario SAP_COM_0002 (Finance – Posting Integration).

 

  1. Click Create.
  2. On the next screen, select the Communications System from previous step and verify that the user name has been entered automatically.
  3. Click Save.

 

Result

You have created a communication arrangement that allows you to access and post journal entries from an ERP or S/4HANA On Premise system to a cloud system remotely via the Cloud Connector (RFC).

 

3  How to Create Extension Field and Enable It for Journal Entry Post API

Procedure

  1. Log on to the SAP Fiori launchpad as Administrator.
  1. Under Extensibility, choose the Custom Fields and Logic tile.
  2. On the Custom Fields and Logic screen, click Create
  3. On the New Field screen, make the following entries:a.     Business Context: choose the context where the extension field belongs toUp to CE1902, this API supports the extension fields in Business Context Accounting: Coding Block, Accounting: Journal Entry Item and Accounting: Market Segmentb.     Label: enter the name for extension fieldc.     Type: choose the data type for extension fieldd.     Length: enter the length for extension field
  1. Click Create and Edit
  2. Switch to tab SOAP APIs, and click Enable Usage for JournalEntryBulkCreationRequest_In and JournalEntryCreateRequestConfirmation_In
  3. Switch to tab UIs and Reports, and click Enable Usage for Manage Journal Entries
  4. Click Save and then click Publish

 

Result

You have created extension fields and enabled them in the structure of Journal Entry Post API and Fiori App Manage Journal Entries.

 

4      How to Test API

4.1    How to Install SOAPUI

Latest SoapUI Open Source Downloads:

https://www.soapui.org/downloads/latest-release.html

 SoapUI Installation Guides:

https://www.soapui.org/getting-started/installing-soapui.html

4.2    How to Test Synchronous API with SOAPUI

Procedure

  1. Log on to the SAP Fiori launchpad as Administrator.
  2. Under Communication Management, choose the Communication Arrangements tile.
  1. Open your communication arrangement, and download the WSDL for Journal Entry – Post (Synchronous) on the Communications Arrangements screen
  2. Open SOAPUI and click New SOAP Project
  3. On the New SOAP Project screen, click “Browse” to find your WSDL, then click OK.

  1. Open Request and input your payload into the request. Here we take ‘create vender invoice’ as an example. The payload is attached here
    <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>MSG_2018-12-06_APITEST</ID>
                <!--<ReferenceID></ReferenceID>-->
                <CreationDateTime>2018-06-05T12:00:00.1234567Z</CreationDateTime>
             </MessageHeader>
             <!--1 or more repetitions:-->
             <JournalEntryCreateRequest>
                <MessageHeader>
                   <ID>SUB_MSG_2018-06-05_001</ID>
                   <!--<ReferenceID></ReferenceID>-->
                   <CreationDateTime>2018-06-05T12:00:00.1234567Z</CreationDateTime>
                </MessageHeader>
                <JournalEntry>
                   <OriginalReferenceDocumentType>BKPFF</OriginalReferenceDocumentType>
                   <OriginalReferenceDocument>0090000004</OriginalReferenceDocument>
                   <OriginalReferenceDocumentLogicalSystem>0MB85UO</OriginalReferenceDocumentLogicalSystem>
                   <BusinessTransactionType>RFBU</BusinessTransactionType>
                   <AccountingDocumentType>KR</AccountingDocumentType>
                   <DocumentReferenceID>2</DocumentReferenceID>
                   <DocumentHeaderText>Test AR Item Posting</DocumentHeaderText>
                   <CreatedByUser>CC0000000044</CreatedByUser>
                   <CompanyCode>1010</CompanyCode>
                   <DocumentDate>2018-06-05</DocumentDate>
                   <PostingDate>2018-06-05</PostingDate>
                   <Item>
                      <ReferenceDocumentItem>1</ReferenceDocumentItem>
                      <GLAccount>0065301000</GLAccount>
                      <AmountInTransactionCurrency currencyCode="EUR">934.58</AmountInTransactionCurrency>
                      <DebitCreditCode>S</DebitCreditCode>
                      <DocumentItemText>Test Item 2</DocumentItemText>
                      <Tax>
                         <TaxCode>V2</TaxCode>
                      </Tax>
                      <AccountAssignment>
                         <CostCenter>0010101101</CostCenter>
                         <yy1:YY1_CB_EXT_FIELD>?</yy1:YY1_CB_EXT_FIELD>
                      </AccountAssignment>
                      <yy1:YY1_JE_ITEM_EXT_FIELD>JE ITEM</yy1:YY1_JE_ITEM_EXT_FIELD>
                   </Item>
                   <CreditorItem>
                      <ReferenceDocumentItem>2</ReferenceDocumentItem>
                      <Creditor>0010200001</Creditor>
                      <AmountInTransactionCurrency currencyCode="EUR">-1000</AmountInTransactionCurrency>
                      <DebitCreditCode>H</DebitCreditCode>
                      <DocumentItemText>Vender item</DocumentItemText>
                      <yy1:YY1_JE_ITEM_EXT_FIELD>CREDITOR ITEM</yy1:YY1_JE_ITEM_EXT_FIELD>
                   </CreditorItem>
                   <ProductTaxItem>
                      <TaxCode>V2</TaxCode>
                      <TaxItemClassification>VST</TaxItemClassification>
                      <AmountInTransactionCurrency currencyCode="EUR">65.42</AmountInTransactionCurrency>
                      <DebitCreditCode>S</DebitCreditCode>
                      <TaxBaseAmountInTransCrcy currencyCode="EUR">934.58</TaxBaseAmountInTransCrcy>
                      <yy1:YY1_JE_ITEM_EXT_FIELD>TAX ITEM</yy1:YY1_JE_ITEM_EXT_FIELD>
                   </ProductTaxItem>
                </JournalEntry>
             </JournalEntryCreateRequest>
          </sfin:JournalEntryBulkCreateRequest>
       </soapenv:Body>
    </soapenv:Envelope>​

  2. Click Auth, and choose Add New Authorization
  3. On Add Authorization screen, choose Basic then click OK
  4. Input your communication user and password
  5. Click to submit request, then response, such as journal entry number or error message, will display in the right window

 

4.3    How to Test Asynchronous API with SOAPUI

Procedure

  1. Please follow the procedure 1 to 9 in section 4.1. In Communication Arrangement, you need to download the WSDL for Journal Entry – Post (Asynchronous)
  2. Click WS-A in SOAPUI request, and check Enable WS-A addressing and Generate MessageID
  3. Remember the ID in the structure of MessageHeader. It is used to identify your request in Message Dashboard (Message Dashboard is introduced in the subsequent section). You could change this ID as your wish.

 

  1. Click to submit request. As it is asynchronous API, response does not display in the right window. It need to be checked in Message Dashboard.

5      How to Check Response Message

5.1    How to Check Response Message for Synchronous API

Procedure

  1. For synchronous API, it can check response message directly in SOAPUI in most cases. However, because of some typos or missing of substructure or fields in payload, response like

‘Web service processing error; more details in the web service error log on provider side (UTC timestamp 20181206081109; Transaction ID 7317F91553620380E005BF87F1D17D3D) The error log can be accessed by service provider from SAP backend’

is returned. In this case, it is requested to access SAP backend to check the error message.

For cloud customer, they need to ask for assistance from SAP Support to check the error message in SAP backend.

  1. Log on to the backend system, and enter Transaction SRT_LOG
  2. On Select Error Log Entries screen, it is suggested to search by Transaction ID stated in response, such as Transaction ID 7317F91553620380E005BF87F1D17D3D or fill User Name to narrow down the result. User Name is the backend user of the communication user
  3. On Web Service Utilities: Error Log screen, the error entries are listed

 

5.2    How to Check Response Message for Asynchronous API

Procedure

  1. For asynchronous API, it can check response message in Fiori App Message Dashboard. Pease follow the subsequent procedure to enable API monitor in Message Dashboard
  2. Log on to the SAP Fiori launchpad as Administrator. Make sure Administrator is assigned with role SAP_BR_CONF_EXPERT_BUS_NET_INT in advance.
  1. Under Message Monitoring, choose Assign Recipients to Users tile
  2. Click to assign AIF Recipient to business user
  3. Enter the Recipients. It supports to choose them from drop down list.
  4. Assign business user with the role which includes business catalog SAP_CA_BC_COM_ERR_PC
  5. Log on to the SAP Fiori launchpad with business user.
  6. Under Message Monitoring, choose Message Dashboard tile
  7. Set the period of dates, then click message number
  8. By means of ID to address the message log

 

6      Some Common Queries

6.1    Typo in payload

  1. Some typos in payload structure could be identified by using Validate of SOAPUI. Please use this function to make sure there is no such kind of error in payload.
  2. Some warnings like those in screenshot below can be ignored

6.2    Extension field is not displayed in Fiori App Manage Journal Entry

  1. If extension field is totally missing in Fiori App Manage Journal Entry, please make sure the extension field is enabled for Manage Journal Entries when creating it in Fiori App Custom Fields and Logic. Please refer section 3 procedure 7
  2. If the value of extension field is missing, you need to switch to legal view to see its value in Fiori App Manage Journal Entry

 

6.3    Consulting about Payment Terms

If substructure DebtorItem-CashDiscountTerms or CreditorItem-CashDiscountTerms are filled with value in payload, cash discount is determined by CashDiscountTerms. Otherwise cash discount is determined by Payment Terms which is derived from Customer or Supplier’s master data.

 

If you want to fill CashDiscountTerms, you need to fill the following fields in order.

<DueCalculationBaseDate>?</DueCalculationBaseDate>

<CashDiscount1Days>?</CashDiscount1Days>

<CashDiscount1Percent>?</CashDiscount1Percent>

<CashDiscount2Days>?</CashDiscount2Days>

<CashDiscount2Percent>?</CashDiscount2Percent>

<NetPaymentDays>?</NetPaymentDays>

 

It is not allowed to have a gap in the payment terms. However, it is allowed to only fill NetPaymentDays. In this case, the NetPaymentDays will be shifted to CashDiscountDays1 with CashDiscountPercent1 = 0%. From business perspective this is equivalent.

Correct Example:

<CashDiscountTerms>

<DueCalculationBaseDate>2019-01-24</DueCalculationBaseDate>

<CashDiscount1Days>1</CashDiscount1Days>

<CashDiscount1Percent>5</CashDiscount1Percent>

<CashDiscount2Days>3</CashDiscount2Days>

<CashDiscount2Percent>2</CashDiscount2Percent>

<NetPaymentDays>5</NetPaymentDays>

</CashDiscountTerms>

Or

<CashDiscountTerms>

<DueCalculationBaseDate>2019-01-24</DueCalculationBaseDate>

<NetPaymentDays>5</NetPaymentDays>

</CashDiscountTerms>

Incorrect Example:

This example is incorrect because CashDiscount1Days and CashDiscount1Percent are not filled.

<CashDiscountTerms>

<DueCalculationBaseDate>2019-01-24</DueCalculationBaseDate>

<CashDiscount2Days>3</CashDiscount2Days>

<CashDiscount2Percent>2</CashDiscount2Percent>

<NetPaymentDays>5</NetPaymentDays>

</CashDiscountTerms>

</CreditorItem>

 

6.4    Consulting if Customer/Vender Payment is supported

The API supports posting document for customer or vender payment, however the API does not support clearing open item.

6.5    Consulting about Partner Bank Type

Partner bank type is not provided in the structure of JE Post API. However, it can be determined by country, vender, bank number and bank account. It means if you provide these fields in Substructure CreditorItem-PaymentDetails- PayeeBankAccount, partner bank type can be determined from vender master data  and updated in accounting document.

Example is below.

<CreditorItem>
<ReferenceDocumentItem>1</ReferenceDocumentItem>
<Creditor>0010401010</Creditor>
<AmountInTransactionCurrency currencyCode=”EUR”>-100</AmountInTransactionCurrency>
<DebitCreditCode>H</DebitCreditCode>
<PaymentDetails>
<PayeeBankAccount>
<Country>DE</Country>
<BankNumber>50070010</BankNumber>
<BankAccount>50070010</BankAccount>
<IBAN>DE54500700100113369800</IBAN>
</PayeeBankAccount>
</PaymentDetails>
</CreditorItem>

 

Partner bank type is proposed in accounting document.

 

6.6    Consulting about Tax Caculation

JE Post API does not support calculating tax amount automatically based on tax code. Tax amount and other tax information need to be manually filled in substructure ProductTaxItem.

 

This is part of payload as example:

<Item>

<ReferenceDocumentItem>1</ReferenceDocumentItem>

<GLAccount>0063009000</GLAccount>

<AmountInTransactionCurrency currencyCode=”IDR”>91</AmountInTransactionCurrency>

<DebitCreditCode>S</DebitCreditCode>

<DocumentItemText>Test Item</DocumentItemText>

                  <Tax>

                     <TaxCode>V2</TaxCode>

                  </Tax>

<AccountAssignment>

<CostCenter>0051101101</CostCenter>

</AccountAssignment>

</Item>

<CreditorItem>

<ReferenceDocumentItem>2</ReferenceDocumentItem>

<Creditor>S5130003</Creditor>

<AmountInTransactionCurrency currencyCode=”IDR”>-100</AmountInTransactionCurrency>

<DebitCreditCode>H</DebitCreditCode>

<DocumentItemText>Vender item</DocumentItemText>

</CreditorItem>

               <ProductTaxItem>

                  <TaxCode>V2</TaxCode>

                  <TaxItemClassification>VST</TaxItemClassification>

                  <AmountInTransactionCurrency currencyCode=”IDR”>9</AmountInTransactionCurrency>

                  <DebitCreditCode>S</DebitCreditCode>

                  <TaxBaseAmountInTransCrcy currencyCode=”IDR”>91</TaxBaseAmountInTransCrcy>

               </ProductTaxItem>

 

7     Important New Features

CE1905

As of CE1905,  Journal Entry Post API (Synchronous and Asynchronous) supports over 999 line items posting. But there are some limitations below to be complied.

  • If the document line item number is less than or equal 999, no compress will happen. The details are stored in both of Entry View and Ledger View.
  • If the document line item number is higher than 999 and the items exclude open item, cross company item and tax item, the items are only stored in the Ledger View without compress.
  • If the document line item number is higher than 999 and the items include open item, cross company item or tax item, the items will be compressed in Entry View. This is done by deleting the contents from the account assignment except for the function area. But the details are still stored in the Ledger View.But for the following cases, the items will not be compressed in Entry View:

    a. CreditorItem or DebtorItem cannot be compressed.
    b. The G/L Items with accounts which are open item management cannot be compressed if the G/L items are distinguished by assignment or account assignment or item text or any other value offered in the GL structure (besides amount fields).  If there are no difference among G/L items besides amount fields, they will be compressed.
    c. If items have unique document item text or assignment,  these items cannot be compressed.

  • In case the document line item number is still higher than 999 after compress, the posting will fail as Entry View does not support over 999 line items.

8      Appendix

1.     SAP Help Page

Journal Entry – Post (Synchronized)

https://help.sap.com/viewer/53d48a2a603e41e9b0b1e825ded17742/1808.500/en-US/92fed0579212c525e10000000a4450e5.html

 

Journal Entry – Post (Asynchronized)

https://help.sap.com/viewer/630f9d89492645408f7f131005f5faa7/1811.500/en-US/22a267e571e948499fda007a65b27c64.html

2.     SAP API Business Hub

Journal Entry – Post (synchronized)

https://api.sap.com/api/JOURNALENTRYCREATEREQUESTCONFI/overview

 

Journal Entry – Post (asynchronized)

https://api.sap.com/api/JOURNALENTRYBULKCREATIONREQUES/overview

4 Comments
You must be Logged on to comment or reply to a post.
  • Hi There – is there a way I can simulate the Journal posting payload before committing it? with S/4 HANA Cloud its difficult to understand how error handling will work.

     

    -Kamal

    • Hi Kamal,

      You can use the validation of SOAPUI to check format error payload.

      And with <TestDataIndicator>true</TestDataIndicator> in <MessageHeader>, it support simulating posting without actually creating accounting document.

       

      Best regards,

      Wesley

  • Thanks Wesley Yin,

    I have one question i applied all steps but the message dashboard still not display any status and status still undefined how i can solve it ??