cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ACC_DOCUMENT_POST Issue - Enter a true account assignment object with revenues issue

velsankar_sundar
Participant
0 Kudos

Hi All,

I have an issue when i am creating the accounting document manually through FB01 , the document is getting posted. But when i tried to pass the same data through BAPI i am getting the error " Enter a true account assignment object with revenues issue " .


Dont know what is the issue , if done manually i creates , but through BAPI alone it fails.


w_bapiache09-obj_type = 'BKPFF'.
w_bapiache09-ref_doc_no = 'Rebates Split'."
w_bapiache09-obj_key = '000000000000001'.
w_bapiache09-bus_act = 'RFBU'.
w_bapiache09-username = sy-uname.
w_bapiache09-comp_code = 'AR02'.
w_bapiache09-pstng_date = '20161019'.
w_bapiache09-doc_date = sy-datum.
w_bapiache09-fisc_year = sy-datum(4).
w_bapiache09-doc_type = 'SA'. "'AB'.
.* Populate the Extension table

wa_bapiparex-structure = 'POSTING_KEY'.
wa_bapiparex-valuepart1 = '000000001'. " Item number
wa_bapiparex-valuepart2 = '50'. " Posting Key
append wa_bapiparex to it_bapiparex.

wa_bapiparex-structure = 'POSTING_KEY'.
wa_bapiparex-valuepart1 = '000000002'. " Item number
wa_bapiparex-valuepart2 = '40'. " Posting Key
append wa_bapiparex to it_bapiparex.

wa_bapiparex-structure = 'POSTING_KEY'.
wa_bapiparex-valuepart1 = '000000003'. " Item number
wa_bapiparex-valuepart2 = '40'. " Posting Key
append wa_bapiparex to it_bapiparex.
* fill AP (line 1)
w_accountpayable-itemno_acc = '000000001'.
w_accountpayable-vendor_no = 'CCU001'.
w_accountpayable-pmnttrms = '0001'.
w_accountpayable-bline_date = '20081212'.
w_accountpayable-item_text = 'Intercompany AP Invoice'.

append w_accountpayable to t_accountpayable.

w_bapiacgl09-itemno_acc = '000000001'.
w_bapiacgl09-gl_account = '0035329985'. " '0014499985'.
w_bapiacgl09-MATERIAL = '000000000060000004'.
w_bapiacgl09-SALESORG = 'AR02'.
w_bapiacgl09-DISTR_CHAN = '20'.
w_bapiacgl09-comp_code = 'AR02'.
w_bapiacgl09-profit_ctr = 'P9200124' . " 'P2000002'.
append w_bapiacgl09 to t_bapiacgl09.

w_bapiacgl09-itemno_acc = '000000002'.
w_bapiacgl09-gl_account = '0035329985'. "'0014499985'.
w_bapiacgl09-comp_code = 'AR02'.
w_bapiacgl09-MATERIAL = '000000010010788608'.
w_bapiacgl09-SALESORG = 'AR02'.
w_bapiacgl09-DISTR_CHAN = '20'.
w_bapiacgl09-profit_ctr = 'P9200124'.
append w_bapiacgl09 to t_bapiacgl09.

w_bapiacgl09-itemno_acc = '000000003'.
w_bapiacgl09-gl_account = '0035329985'. "'0014499985'.
w_bapiacgl09-comp_code = 'AR02'.
w_bapiacgl09-MATERIAL = '000075010569129113 '.
w_bapiacgl09-SALESORG = 'AR02'.
w_bapiacgl09-DISTR_CHAN = '20'.
w_bapiacgl09-profit_ctr = 'P9200124'.
append w_bapiacgl09 to t_bapiacgl09.


w_bapiaccr09-itemno_acc = '000000001'.
w_bapiaccr09-currency = 'ARS'.
w_bapiaccr09-amt_doccur = '-100.00'.
append w_bapiaccr09 to t_bapiaccr09.

w_bapiaccr09-itemno_acc = '000000002'.
w_bapiaccr09-currency = 'ARS'.
w_bapiaccr09-amt_doccur = '70'.
append w_bapiaccr09 to t_bapiaccr09.

w_bapiaccr09-itemno_acc = '000000003'.
w_bapiaccr09-currency = 'ARS'.
w_bapiaccr09-amt_doccur = '30'.
append w_bapiaccr09 to t_bapiaccr09.
*

Accepted Solutions (0)

Answers (0)