‎2016 Dec 02 4:56 PM
Hi Experts - I am working on ABAP program to Park vendor invoices without -PO.
I have implemented BADI - ACC_DOCUMENT to Pass the status = '2' and using BAPI -BAPI_ACC_DOCUMENT_POST
This logic is failing when I pass the records with cross company code. Below is the structure I am using.
Could please anyone try to take a look to see if anything is missing in the structures, I am only stuck in the cross company code scenarios.
Header -
ls_hdr-comp_code = 1000
ls_hdr-doc_date = 02.02.2016
ls_hdr-pstng_date = 02.02.2016
* ls_hdr-fis_period = 02
ls_hdr-doc_type = KR
ls_hdr-ref_doc_no = 'some text'
Vendor
lw_acc_vr-itemno_acc = 0000000010
lw_acc_vr-vendor_no = 201010
lw_acc_vr-item_text = Vendor text
lw_acc_vr-comp_code = 1000
------------------------------------------------------
GL-account
w_acc_gl-itemno_acc = '0000000020'.
*lw_acc_gl-gl_account = '0000406260'.
*lw_acc_gl-item_text = 'BAPI_success_park'.
*lw_acc_gl-doc_type = 'KR'.
*lw_acc_gl-comp_code = '1000'.
*lw_acc_gl-tax_code = 'V1'.
Gl-account
w_acc_gl-itemno_acc = '0000000030'.
*lw_acc_gl-gl_account = '0000406260'.
*lw_acc_gl-item_text = 'BAPI_success_park'.
*lw_acc_gl-doc_type = 'KR'.
*lw_acc_gl-comp_code = '1500'.
*lw_acc_gl-tax_code = 'V1'.
----------------------------------------------------
currency lines
lw_curr_amt-itemno_acc = '0000000010'.
lw_curr_amt-curr_type = '00'.
lw_curr_amt-currency = 'GBP'.
lw_curr_amt-currency_iso = 'GBP'.
lw_curr_amt-amt_doccur = '2400.00-'.
--------------------------------------------------------------
lw_curr_amt-itemno_acc = '0000000020'.
lw_curr_amt-curr_type = '00'.
lw_curr_amt-currency = 'GBP'.
lw_curr_amt-currency_iso = 'GBP'.
lw_curr_amt-amt_doccur = '1000.00'.
-----------------------------------------------------------------
lw_curr_amt-itemno_acc = '0000000030'.
lw_curr_amt-curr_type = '00'.
lw_curr_amt-currency = 'GBP'.
lw_curr_amt-currency_iso = 'GBP'.
lw_curr_amt-amt_doccur = '1000.00'.
----------------------------------------------------------------------
lw_extension2-valuepart1 = 'X'.
APPEND lw_extension2 TO lt_extension2.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = ls_hdr
IMPORTING
* obj_type = lv_objtype
*obj_key = lv_objkey
* obj_sys = lv_objsys
TABLES
accountgl = lt_acc_gl
accountpayable = lt_acc_vr
currencyamount = lt_curr_amt
extension2 = lt_extension2
return = lt_bapiret