ABAP development for Accounting [rev]

  • 2083799 - Composite SAP Note: Postings with Accounting BAPIs
  • 1232484 - How to use the VAT due date, tax reporting date VATDATE


1232484 - How to use the VAT due date, tax reporting date VATDATE

The functionality is based on legal requirements in different countries.
Incomplete list of countries currently known:
Poland, Hungary, Slovakia, Spain.
For each country it must be checked whether the functionality fulfills the legal requirements.

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
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.)

2083799 - Composite SAP Note: Postings with Accounting BAPIs

It is even technically possible to transfer amounts to the BAPI with greater precision than was the case with the posting in the document. This means that, for a currency that has only two decimal places, you can still transfer amounts with three or four decimal places to the BAPI. However, the amounts are then rounded to the second decimal place. Note that in this case, however, no rounding difference distribution takes place and, as a result, the system may generate a balance error. Therefore, the amounts must always be transferred in accordance with the currency Customizing. If the posting is carried out using a customer program, round the amounts before calling the BAPI and distribute rounding differences that may occur to establish a balance of zero.

In addition, check for leading zeros in the case of G/L and current accounts, and account assignment objects. In the case of alphanumeric fields, errors can occur during the posting if numeric values are transferred without leading zeros. In addition, we recommend that you transfer fields that, by definition, are to be filled in uppercase letters to the BAPI in uppercase letters, since not all conversions are adopted by the BAPI.

You must always transfer the amounts in the transaction currency in the structure CURRENCYAMOUNT, but the local currencies are optional. However, if you wish to transfer one of the local currencies to the BAPI, this step must then take place for each document line item; otherwise, balance errors can occur during the posting.

Required fields


DOCUMENTHEADER

BUS_ACT   RFBU
USERNAME SAP
COMP_CODE 0001
DOC_DATE 20141001
PSTNG_DATE 20141001
DOC_TYPE SA


ACCOUNTGL

ITEMNO_ACC GL_ACCOUNT
0000000001|0000131000
0000000002|0000132000


CURRENCYAMOUNT

ITEMNO_ACC CURRENCY AMT_DOCCUR    
0000000001|EUR     | 100.0000 
0000000002|EUR     | 100.0000-

Tax postings

Unlike the traditional FI posting transactions (such as FB01), the Accounting BAPIs do not include the function "Automatically Calculate Tax". The source application must therefore already determine the tax in advance. This tax is then transferred in the parameter ACCOUNTTAX to the BAPI.

In the case of simple tax transactions, all you have to do very often is transfer the tax code and the tax account. However, in the case of more complex transactions (such as multi-level tax codes or for postings with item-by-item tax calculation and tax jurisdiction codes), you also have to transfer the account and condition key. To avoid side effects during tax posting, we therefore recommend that you always transfer this information for every tax line item.

Please note also that the tax should always be passed at summary level to the BAPI as long as line-by-line tax calculation is not used in the updated company code. This is particularly relevant if you park a document.

DOCUMENTHEADER

BUS_ACT RFBU
USERNAME SAP                                                                             
COMP_CODE 0001
DOC_DATE 20141001
PSTNG_DATE 20141001
DOC_TYPE DR



ACCOUNTRECEIVABLE

ITEMNO_ACC CUSTOMER
0000000001|KP01                                                          



ACCOUNTGL

ITEMNO_ACC GL_ACCOUNT TAX_CODE COSTCENTER ITEMNO_TAX
0000000002|0000400000|V1      |0000001000|000000



ACCOUNTTAX

ITEMNO_ACC GL_ACCOUNT COND_KEY ACCT_KEY TAX_CODE ITEMNO_TAX
0000000003|0000154000|MWVS    |VST     |V1      |000000



CURRENCYAMOUNT

ITEMNO_ACC CURRENCY AMT_DOCCUR     AMT_BASE    
0000000001|EUR     |     119.0000 |    0.0000                         
0000000002|EUR     |     100.0000-|    0.0000                       
0000000003|EUR     |      19.0000-|  100.0000-     

Direct tax

You generally post a tax item on the basis of a revenue or expense item with the same tax code. However, in the case of a direct tax line item, this relationship does not exist. In this case, you post directly to a tax account. The tax code used in the direct tax line item is usually not set in any other revenue or expense item.

A direct tax item is flagged by setting the code ACCOUNTTAX-DIRECT_TAX.

Implement SAP Notes 1876699 and 1903918 if errors occur when you post direct tax with the BAPI. Duplicate updating of the tax in table BSET is another error that can occur frequently. This is because the tax code of the direct tax line item is filled in a G/L account item (in the parameter ACCOUNTGL). To avoid this error, delete the tax code from the G/L account item or post an automatic tax line to this item.

Cross-company code postings

You can assign a company code to each line item at item level. To represent a cross-company code process, you must also assign at least two different company codes in the items. In this case, the leading company code is always derived from the first line item, not from the company code of the structure DOCUMENTHEADER!

Note that you cannot specify a company code in the structure ACCOUNTTAX. Since the tax is always posted in the leading company code, the BAPI derives the company code of the tax items itself.

You must not transfer the company code clearing lines to the BAPI. These lines are generated within the Accounting interface. However, you must still transfer the document with a balance of 0 to the BAPI.

Posting with invoice reference

Credit memos

If a vendor or customer document is posted as a credit memo using the BAPI, the invoice reference field is automatically set to the value "V". A credit memo is therefore generally entered as a value-dated credit memo. As a result, the due date is determined like for an invoice. If you do not want to have an invoice reference for credit memos, you must initialize the field REBZG for the corresponding credit memo item using the option to extend for the BAPI.

Comments