The following post is focusing on the generation of the accounting document.
The main purpose is to presentate the most important programs and tables involved during the process.
General information
During release of a billing document to accounting, the relevant fields of the SD invoice (fields of VBRK, VBRP, VBPA, KONV tables) are transfered to the interface tables XACCHD, XACCIT, XACCCR.
On FI side these interface tables are used to transfer the data to the necessary modules in FI/CO.
On accounting side the most important tables being filled are BKPF, BSEG and BSET.
As a result the customer line item on FI side is created, that equals to the value that has to be payed by the customer. Furthermore revenue and tax lines are created. A summarization takes place if possible or if there is a special customizing setting for it (see SAP Note 36353).
Function module that starts the SD-FI Interface
The most important modules are the function module RV_ACCOUNTING_DOCUMENT_CREATE for creating accounting documents for individual documents, the function moduleRV_ACCOUNTING_DOCULIST_CREATE for creating accounting documents for invoice lists and the Include LV60BF00 that contains the most important subprograms.
RV_ACCOUNTING_DOCUMENT_CREATE (LV60BU01)
triggered by:
Transaction | Button |
VF01 | Save |
VF02 | Release to accounting (if posting block is set in billing type customizing VOFA) |
VFX3 | Release to accounting (if posting block is set in billing type customizing VOFA) |
VF11 | Save |
RV_ACCOUNTING_DOCUMENT_CREATE converts the billing document into the interface structures ACCIT, ACCCR and ACCHD and the internalinterface tables XACCIT, XACCCR, XACCHD are filled. These are then converted in Function AC_DOCUMENT_CREATE into the accounting document tables BSEG (accounting segment), BSET (taxes) and BKPF (document header). An ACCHD line is created for each and every billing document.
ACCHD:
The structure ACCHD contains the header information for the accounting document. It includes, for example, the time of entry, the name of the person entering the data and the transaction which was used to create the document.
ACCIT:
The structure ACCIT contains basic posting information including the currency information. You can see the billing item to which an ACCIT line belongs in the field ACCIT-POSNR_SD.
ACCCR:
The sturcture ACCCR contains the rate and currency information for customer, tax and G/L account lines. At least one ACCCR is created for each condition, customer or tax line. The ACCIT line belonging to an ACCR line can be identified using the field POSNR (ACCIT-POSNR) .
RV_ACCOUNTING_DOCULIST_CREATE (LV60BU02)
triggered by:
Transaction | Button |
VF21 | Save |
VF22 | Release to accounting (if posting block is set in billing type customizing VOFA) |
VFX3 | Release to accounting (if posting block is set in billing type customizing VOFA) |
VF26 | Save |
SUBPROGRAMS (LV60BF00)
Form ACCOUNTING_HEAD_LINE
Form ACCOUNTING_ITEM_LINE.
Form ACCOUNTING_TAX_LINE.
Form READ_FI_PERIODE_INVOICEDATE.
Form TXJCD_AUFBEREITEN.
Form FREE_OF_CHARGE_LINE.
Form XACCIT_XNEGP_SET.
Form XACCIT_XVALGS_ZFBDT_SET.
Form CURRENCY_CONVERSION
Form FILL_ACCIT_DEB
Important tables and fields
Table | Field | Functionality |
XACCHD | TCODE
AWREF | Transaction that released the invoice to accounting. For batch jobs the TCODE is space
Invoice number that will be transfered to BKPF-AWREF
|
XACCIT | POSNR_SD
POSNR
KSCHL
HKONT
MWSK1
BSCHL
TAXIT | Item number of the SD invoice
Item number of the interface table
Condition type
Account number
Tax code
Posting key
Indicator for the tax line
|
XACCCR | POSNR
WRBTR
FWBAS | Item number of the interface table (link to the corresponding line in XACCIT)
Value that will be posted to FI)
Tax base (filled only in the tax line) |
Possibility of modification
Of course it is possible to influence the release of billing documents to accounting by using user exits. Just to mention some of the relevant programs:
EXIT_SAPLV60B_001 | Change of header data in structure ACCHD |
EXIT_SAPLV60B_002 | Change of the ACCIT customer line |
EXIT_SAPLV60B_004 | Change of the ACCIT G/L account line |
EXIT_SAPLV60B_006 | Change of the ACCIT tax line |
EXIT_SAPLV60B_008 | Change of transfer structures ACCCR and ACCIT |
You can find more information in the following SAP Note:
301077 - User exits for the interface for accounting
.