2010 Feb 16 4:36 PM
Hello, i´m working with bapi_acc_document_post.
I need to post this document:
Position 1: vendor 1000 usd
Posicion2: vat 1000 usd
but the bapi does not post it correctly.
Does anyone knows how to fill the internal tables to post it?
Thanks!
2010 Feb 16 5:05 PM
2010 Feb 16 4:55 PM
You can try to Fill
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = lx_head
TABLES
accountgl = li_gl
accountreceivable = li_ar
currencyamount = li_cr
return = li_ret.
Fill All the paramerters as below
Header contruction to be done based on retireval as per your reuirement
lx_head-bus_act = 'RFBU'
lx_head-username = sy-uname.
lx_head-header_txt = 'abcd'
lx_head-comp_code = bukrs.
lx_head-doc_date = budat.
lx_head-pstng_date = budat.
lx_head-fisc_year = year.
lx_head-fis_period = monat.
lx_head-doc_type = blart.
lx_head-ref_doc_no = rebzg.
SELECT *
INTO TABLE li_bseg
FROM bseg
WHERE bukrs = Compnay Code
AND belnr = BELNR
AND gjahr = Fiscal Year
CLEAR lx_ar.
lx_ar-itemno_acc = " Fill First item count from BSEG.
lx_ar-customer = lx_bseg-kunnr.
lx_ar-sp_gl_ind = lx_bseg-umskz.
lx_ar-gl_account = x_zfipr2-hkont1.
lx_ar-ref_key_1 = lx_bseg-xref1.
lx_ar-ref_key_3 = lx_bseg-rebzg.
lx_ar-comp_code = lx_bseg-bukrs.
lx_ar-alloc_nmbr = lx_bseg-zuonr.
lx_ar-item_text = lx_bseg-sgtxt.
APPEND lx_ar TO li_ar.
fill GL account data li_gl based on BSEG data
Fill amount /Documen tcurrency /Currency /Item no_acc into li_cr. This can be done agin with BSEG data
~Pramod
2010 Feb 16 5:08 PM
Hello PKUPADHYAY
the code you post works fine, but the vat line is posted as GL line, and not as a VAT line, so the VAT report doesn´t show this document, and it can´t be accepted by customer.
Thanks!
2010 Feb 16 5:05 PM