Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Accts Payable posting using BAPI

Former Member
0 Likes
318

Hi I am trying to use the Bapi: BAPI_ACC_INVOICE_RECEIPT_POST and am getting an error for "Balance in Transaction Currency. Here is how I am loading the fields, if anyone can see where my error is I would appreciate it.


* fill header
  gd_documentheader-obj_type   = 'BKPFF'.
  gd_documentheader-obj_key    = ref_key.
* GD_DOCUMENTHEADER-OBJ_SYS    = FUNKTION OWN_LOGICAL_SYSTEM_GET
  gd_documentheader-username   = sy-uname.
  gd_documentheader-header_txt = '2008 RPT Header'.
  gd_documentheader-comp_code  = '0604'.
  gd_documentheader-fisc_year  = '2008'.
  gd_documentheader-doc_date   = '20081101'.
  gd_documentheader-pstng_date = '20081114'.
  gd_documentheader-doc_type   = 'KR'.
  GD_DOCUMENTHEADER-REF_DOC_NO = '0000003761'.

* fill AP (line 1)
  it_accountpayable-itemno_acc     = 1.
  it_accountpayable-vendor_no      = '0000111111'.
  it_accountpayable-gl_account     = '0000111111'.
  it_accountpayable-pmnttrms       = 'CINA'.
  it_accountpayable-bline_date     = '20071120'.
  it_accountpayable-pmtmthsupl     = '6'.
  it_accountpayable-pymt_meth      = 'C'.
  it_accountpayable-pmnt_block     = ' '.
  it_accountpayable-item_text      = '2008 RPT Detail'.

  APPEND it_accountpayable.

  it_currencyamount-itemno_acc   = 1.
  it_currencyamount-curr_type    = '00'.
  it_currencyamount-currency     = 'USD'.
  IT_CURRENCYAMOUNT-CURRENCY_ISO = 'USD'.
  it_currencyamount-amt_doccur   = -200000.
*  it_currencyamount-amt_base     = .
  APPEND it_currencyamount.

* fill GL (line 2)
  it_accountgl-itemno_acc     = 2.
  it_accountgl-gl_account     = '0000222222'.
  it_accountgl-comp_code      = '0604'.
  it_accountgl-pstng_date     = '20081114'.
  IT_ACCOUNTGL-DOC_TYPE       = 'KR'.
  it_accountgl-ac_doc_no      = '0000012345'.
  it_accountgl-fisc_year      = '2008'.
  IT_ACCOUNTGL-FIS_PERIOD     = '11'.
  IT_ACCOUNTGL-TAX_CODE       = 'N1'.
  it_accountgl-item_text      = 'GL BAPI Test'.
  APPEND it_accountgl.

  it_currencyamount-itemno_acc   = 2.
  it_currencyamount-curr_type    = '00'.
  it_currencyamount-currency     = 'USD'.
  IT_CURRENCYAMOUNT-CURRENCY_ISO = 'USD'.
  it_currencyamount-amt_doccur   = 200000.
*  it_currencyamount-amt_base     = .
  APPEND it_currencyamount.


Thanks

Mike

1 REPLY 1
Read only

Former Member
0 Likes
269

Try with both amounts positive.

Rob