Posting Journal Entry document in SAP using BAPI
This blog will give the information to post journal entry with different currency line items.
The BAPI ‘BAPI_ACC_DOCUMENT_POST’ will be used to post the Journal Entry in SAP. This is helpful to SAP Technical consultants to post the document with document currency amount and company code currency amount without exchange rate when the document currency is not same as company code currency. Transaction code for FI documents are FB01/FB50(Create), FB02(Change) and FB03(Display). The document should be balanced for the document to be posted i.e. credit amount and debit amount should be equal. In FI, header table for document data is BKPF and line item table is BSEG. In S/4HANA, we have ACDOCA table, which is based on the Universal Journal line items, containing all of the financial fields, as well as a lot of information from other modules
We will use the BAPI function module ‘BAPI_ACC_DOCUMENT_POST to post the Journal Entry with multiple currency amounts like company code currency is CAD and document currency is USD in the line item without populating the exchange rate.
Populate the data in BAPI structures as below.
Fill the Header structure ‘DOCUMENTHEADER’ with the mandatory fields populated.
Also Fill the line item table ‘ACCOUNTGL’ with the mandatory fields.
While populating the currency table ‘CURRENCYAMOUNT, populate the data as below:
For each line item, populate two currency line items with the currency type ’00’ and ’10’. Here Currency type ’00’ for document currency and currency type ’10’ for company code currency
Here is the BAPI is filled with the same information:
click on Save.
Go to SE37 -> In the Menu click on ‘Function Module’ -> ‘Execute’ -> ‘Test Sequences’
Enter the function modules as below.
Select the variant and click on execute.
click on ‘Back;.
Created the document as below.
By populating the data as specified above, we can post the journal entry document with amount in different currencies.
Also based on the requirement, we can use the currency type ’30’ for populating group currency.