‎2007 Jun 18 5:32 PM
Hi,
When I call BAPI_ACC_DOCUMENT_POST for G/L posting with CRITERIA parameter filled (CO-PA), I have the following errors returned:
E RW 609 Error in document: BKPFF $ RD1CLNT110
E KI 235 Account 301050 requires an assignment to a CO object
E KI 235 Account 301050 requires an assignment to a CO object
Does anybody knows how to rectify the above errors?
Appreciate your help.
Cheers,
Patrick
(Points will rewarded to helpful answers)
Below is my coding:
Header
lw_header-bus_act = 'RFBU'.
lw_header-username = sy-uname.
lw_header-header_txt = v_spbup.
lw_header-comp_code = p_bukrs.
lw_header-doc_date = sy-datum.
lw_header-pstng_date = p_budat.
lw_header-fisc_year = p_gjahr.
lw_header-fis_period = p_monat.
lw_header-doc_type = 'SB'.
lw_header-ref_doc_no = v_spbup.
Line Item (G/L)
lw_item_gl-itemno_acc = '1'.
lw_item_gl-gl_account = lv_kstar1.
lw_item_gl-profit_ctr = lv_prctr1.
lw_item_gl-material = p_matnr.
APPEND lw_item_gl TO li_item_gl.
lw_item_gl-itemno_acc = '2'.
lw_item_gl-gl_account = lv_kstar2.
lw_item_gl-profit_ctr = lv_prctr2.
lw_item_gl-material = p_matnr.
APPEND lw_item_gl TO li_item_gl.
Line Item (Amount)
lw_item_amt-itemno_acc = '1'.
lw_item_amt-currency = lv_waers.
lw_item_amt-amt_doccur = '-2.00'.
APPEND lw_item_amt TO li_item_amt.
lw_item_amt-itemno_acc = '2'.
lw_item_amt-currency = lv_waers.
lw_item_amt-amt_doccur = '2.00'.
APPEND lw_item_amt TO li_item_amt.
Line Item (CO-PA -> CRITERIA)
lw_item_copa-itemno_acc = '2'.
lw_item_copa-fieldname = 'ARTNR'. "Product
lw_item_copa-character = p_matnr.
APPEND lw_item_copa TO li_item_copa.
CLEAR: lw_item_copa.
lw_item_copa-itemno_acc = '2'.
lw_item_copa-fieldname = 'VKORG'. "Sales Org
lw_item_copa-character = p_vkorg.
APPEND lw_item_copa TO li_item_copa.
CLEAR: lw_item_copa.
lw_item_copa-itemno_acc = '2'.
lw_item_copa-fieldname = 'VTWEG'. "Dist. Channel
lw_item_copa-character = p_vtweg.
APPEND lw_item_copa TO li_item_copa.
CLEAR: lw_item_copa.
lw_item_copa-itemno_acc = '2'.
lw_item_copa-fieldname = 'SPART'. "Division
lw_item_copa-character = p_spart.
APPEND lw_item_copa TO li_item_copa.
CLEAR: lw_item_copa.
Call BAPI
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = lw_header
CUSTOMERCPD =
CONTRACTHEADER =
IMPORTING
OBJ_TYPE =
OBJ_KEY =
OBJ_SYS =
TABLES
accountgl = li_item_gl
ACCOUNTRECEIVABLE =
ACCOUNTPAYABLE =
ACCOUNTTAX =
currencyamount = li_item_amt
criteria = li_item_copa
VALUEFIELD =
EXTENSION1 =
return = li_msg_ret
PAYMENTCARD =
CONTRACTITEM =
EXTENSION2 =
REALESTATE =
.
Message was edited by:
Patrick Teo
‎2007 Jun 18 6:19 PM
Hi,
check this
http://www.sapfans.com/forums/viewtopic.php?t=148217&highlight=235
http://www.sapfans.com/forums/viewtopic.php?t=125937&highlight=235
aRs
Message was edited by:
aRs
‎2007 Jun 18 6:19 PM
Hi,
check this
http://www.sapfans.com/forums/viewtopic.php?t=148217&highlight=235
http://www.sapfans.com/forums/viewtopic.php?t=125937&highlight=235
aRs
Message was edited by:
aRs
‎2007 Jun 19 9:40 AM
hi aRs,
Thanks for your information, I will check whether the cost center has assigned to cost element of a G/L account.
By the way, do you have any idea of the other error besides CO Object, which is:
E RW 609 Error in document: BKPFF $ RD1CLNT110
Thanks and regards,
Patrick
‎2007 Jun 19 5:25 PM
Hi all,
I have solved my problem on CO-PA.
Thanks and regards,
Patrick