Hi
As far as I recollect, the below BAPI BAPI_ACC_DOCUMENT_POST can be used to change or entered in the Header structure.
Refer SAP Note 1232484
The note text is:
Symptom
There is a new entry field (VATDATE) in the document header (BKPF) of the financial accounting document that can be used as VAT due date or tax reporting date.
When a document is being entered (for example FB01, FB60, MIRO) then the VATDATE can be entered or changed on the tax screen. A specific BADI proposes usually the posting date or document date.
Once the document is posted the VATDATE can also be changed using the change transaction FB02. This changeabilty must just be switched on in the usual way.
This note describes the features of this functionality and will be amended continuously if necessary.
Other terms
VATDATE
Reason and Prerequisites
The functionality is based on legal requirements in different countries. Incomplete list of currently known countries:
Poland, Hungary, Slovakia, Spain.
For each country it must be checked whether the functionality fulfills the legal requirements.
The functionality has originally been implemented by note 1023317 in release ER2005, its enhancement packages and in ERP2004 and by note 1235415 in release 4.70 and 4.6C. As many objects are involved in the correction the functionality can only be imported by applying the corresponding support package.
For Reporting for Eastern European countries see note 1038448.
In order to ensure data transport of the new field VATDATE some programs and structures must be regenerated. Therefore please run the following programs:
- SAPFACCG
- RFBIPPG0
Solution
- 1. Activation of the functionality
The functionality can be activated per company code in the usual customizing for the company code 'Enter Global Parameters'.
(transaction OBY6 or SM30: View V_001_B)
For this purpose the new field XVATDATE has been added to table T001.
- 2. General rule
If the functionality is active then every financial accounting document that is tax relevant ( i.e. contains a tax code in a g/l-line item) must have a valid date in the field VATDATE. If the document is not tax relevant, or the functionality is off in the company code, the date will be initial.
- 3. Exchange rate determination for tax line items
There exists the well established functionality that the local (company code) currency amount of tax line items in a document can be calculated with a separate exchange rate, different from the exchange rate used for the other line items of the document. In addition to the already existing options the VATDATE can now also be used for the determination of the exchange rate.
(transaction OBC8 or SM30: View V_001_V)
For this purpose the new value '5' for domain TXKRS has been added.
- 4. BADI for determining and checking the VATDATE
a) Release ERP2005 (ECC 600) and higher
There is a new Enhancement Spot VATDATE_RULES with the BADI definition VATDATE_VALUES.
A default implementation is delivered: VATDATE_VALUES_DEFAULT_SAP
(Use transaction SE18 to see the details of the BADI or SE19 to see the implementations.)
b) Release ERP2004
There is a new BADI definition VATDATE_VALUES.
A standard implementation is provided: VATDATE_VALUES_SAP
c) Release 4.70 and 4.6C
There is a new BADI definition VATDATE_VALUES_46.
A standard implementation is provided: VATDATE_VALUES_SAP46
Common features of the BADI in all releases:
Two methods are provided:
- VATDATE_DETERMINE
- VATDATE_CHECK
Purpose of the BADI:
Only the method VATDATE_CHECK is called from standard programs.
Within the default implemetation the method VATDATE_DETERMINE is called if the document requires a VATDATE but no value has been provided or could have been entered so far. The method VATDATE_DETERMINE determines the initial value that will be proposed, for example on the screens.
By default either posting date or document date is proposed, depending in your customizing in the company code(transaction OBCK).
A value that has been provided, proposed or entered will be checked in method VATDATE_CHECK whether it meets specific conditions or rules.
It is up to the customer to create his own implementation where these specific rules are defined. The default rule is that the VATDATE must not be less than the posting date and document date. A customized message is issued (FF 785) if it is less.
Where has the BADI been implemented?
The BADI has been implemented in
- the function group TAX1 (taxes)
- the program SAPMF05A (entering accounting documents)
- the program SAPMF05L (displaying/changing financial accounting documents)
- the function group RWCL (general interface to accounting)
- the function group SAPLFCJ_PROCESS_MANAGER (Cash Journal)
- 5. BADI for determining exchange rate for tax line items
a) Release ERP2005 (ECC 600) and higher
There is a new Enhancement Spot ESPOT_TAX_EXCHANGE_RATE with the BADI definition BADI_TAX_EXCHANGE_RATE.
A default implementation is delivered: TXKRS_SET_DEFAULT_VATDATE
b) Release ERP2004 (ECC 500)
There is a new BADI definition TAX_EXCHANGE_RATE.
A standard implementation is provided: TXKRS_VATDATE_SAP
There an exchange is determined only if the VATDATE-functionality is active and only for certain reference procedures.
c) Release 4.70 and 4.6C
There is a new BADI definition TAX_EXCHANGE_RATE_46.
A standard implementation is provided: TXKRS_VATDATE_SAP46
Common features of the BADI in all releases:
Only one method is provided: TXKRS_SET
Purpose of the BADI:
The purpose of the BADI is to set the exchange rate for tax line items.
The default implementation determines an exchange rate only for billing documents and cash journal documents.
Where has the BADI been implemented?
The BADI has been implemented ONLY in function group RWCL, the general interface to accounting.
- 6. (Remark: When a financial accounting document is entered directly with a transaction (for example FB01, FB60, MIRO) then it is of course not necessary that this BADI is being called as the exchange rate determination works there in a different way.)
- 7. Standard reports RFUMSV00, RFUMSV10
The standard tax reports RFUMSV00 and RFUMSV10 support the selection of documents according to the VATDATE.
For this purpose the field has been added to the logical database BRF.
But, in order to prevent that every report using BRF shows the select option for the VATDATE although it does not deal with taxes, the field has been added as hidden where it is switched off. For reports RFUMSV00 and RFUMSV10 it has been switched on permanently. But thereby, in other report using BRF it can now easily be switched on via the DYNAMIC SELECTIONS.
- 8. Country specific reports
- some reports used mainly in Easter Europe have been adopted.
See note 1038448 and related.
- 9. BAPIs
Only the most important Bapi BAPI_ACC_DOCUMENT_POST supports the entry of the VATDATE in its header structure.
- 10. Batch-Input
Batch-Input for FB01 is supported.
- 11. Document reversal
A reversed document has the same VATDATE as the original one. It can be changed with FB02.