Skip to Content
0
Sep 28, 2005 at 09:16 AM

Bapi BAPI_ACC_INVOICE_RECEIPT_POST

483 Views

Hi,

I want to be able to use the bapi with tax. I have the following code which gives me the result: E FF 747 Tax amount must not be greater than the tax base.

Its not clear to me what i do wrong when filling the tables for the bapi. Any help will be appreciated.

FORM FILL_INTERNAL_TABLES.

CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'

IMPORTING

OWN_LOGICAL_SYSTEM = GD_DOCUMENTHEADER-OBJ_SYS.

  • fill header

GD_DOCUMENTHEADER-OBJ_TYPE = 'BKPFF'.

GD_DOCUMENTHEADER-OBJ_KEY = REF_KEY.

GD_DOCUMENTHEADER-USERNAME = SY-UNAME.

GD_DOCUMENTHEADER-HEADER_TXT = 'AHJD BAPI Test'.

GD_DOCUMENTHEADER-COMP_CODE = 'A14'.

GD_DOCUMENTHEADER-DOC_DATE = '20050927'.

GD_DOCUMENTHEADER-PSTNG_DATE = '20050927'.

GD_DOCUMENTHEADER-DOC_TYPE = 'KR'.

  • fill AP (line 1)

IT_ACCOUNTPAYABLE-ITEMNO_ACC = 1.

IT_ACCOUNTPAYABLE-VENDOR_NO = '0000001001'.

IT_ACCOUNTPAYABLE-PMNTTRMS = '30'.

IT_ACCOUNTPAYABLE-ITEM_TEXT = 'AP BAPI Test'.

APPEND IT_ACCOUNTPAYABLE.

IT_CURRENCYAMOUNT-ITEMNO_ACC = 1.

IT_CURRENCYAMOUNT-CURR_TYPE = '00'.

IT_CURRENCYAMOUNT-CURRENCY = 'EUR'.

IT_CURRENCYAMOUNT-AMT_DOCCUR = -119.

APPEND IT_CURRENCYAMOUNT.

  • fill GL (line 2)

IT_ACCOUNTGL-ITEMNO_ACC = 2.

IT_ACCOUNTGL-GL_ACCOUNT = '0043419002'.

IT_ACCOUNTGL-ITEM_TEXT = 'GL BAPI Test'.

IT_ACCOUNTGL-COSTCENTER = '0000514200'.

APPEND IT_ACCOUNTGL.

IT_CURRENCYAMOUNT-ITEMNO_ACC = 2.

IT_CURRENCYAMOUNT-CURR_TYPE = '00'.

IT_CURRENCYAMOUNT-CURRENCY = 'EUR'.

IT_CURRENCYAMOUNT-AMT_DOCCUR = 100.

APPEND IT_CURRENCYAMOUNT.

  • fill tax

IT_ACCOUNTTAX-ITEMNO_ACC = 3.

IT_ACCOUNTTAX-TAX_CODE = 'BA'.

APPEND IT_ACCOUNTTAX.

IT_CURRENCYAMOUNT-ITEMNO_ACC = 3.

IT_CURRENCYAMOUNT-CURR_TYPE = '00'.

IT_CURRENCYAMOUNT-CURRENCY = 'EUR'.

IT_CURRENCYAMOUNT-AMT_DOCCUR = 19.

IT_CURRENCYAMOUNT-AMT_BASE = 100.

APPEND IT_CURRENCYAMOUNT.