Application Development 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: 

BAPI_ACC_DOCUMENT_POST error

Former Member
0 Kudos

Hi FI ABAP Expert

i am using bap_acc_document_post for F-02...

as error, i checked if G/L Account 254500 is defined in chart of account CAHS or NOT, but this G/L Account is defined in CAHS.

i tried to post document with above same data by T-code F-02 instead of my bapi code, it was posted as well.

does any body what somthing wrong on my code?

2 Entries error

E RW 609 Error in document : BKPFF $ HMDCLNT200

E F5 507 G/L Account 254500 is not defined in chart of account CAHS

refresh lt_doc_header.

lt_doc_header-bus_act = 'RFBU'.

lt_doc_header-username = sy-uname.

lt_doc_header-doc_date = lv_month. "

lt_doc_header-pstng_date = lv_month. ".

lt_doc_header-fisc_year = sy-datum(4). "

lt_doc_header-fis_period = sy-datum+4(2).

lt_doc_header-doc_type = 'SA'.

lt_doc_header-comp_code = '1000'.

append lt_doc_header.

refresh lt_acc_gl.

lt_acc_gl-itemno_acc = '1'. "40

lt_acc_gl-gl_account = '557130'. " GL Account

lt_acc_gl-item_text = ''. " Line Item Text

lt_acc_gl-doc_type = 'SA'.

lt_acc_gl-comp_code = '1000'. " Company Code

lt_acc_gl-pstng_date = sy-datum. " Posting Date

lt_acc_gl-wbs_element = 'E-2008-001-R1'. " WBS Element

append lt_acc_gl.

clear lt_acc_gl.

lt_acc_gl-itemno_acc = '2'. "50

lt_acc_gl-gl_account = '254500'. " GL Account

lt_acc_gl-item_text = ''. " Line Item Text

lt_acc_gl-doc_type = 'SA'.

lt_acc_gl-comp_code = '1000'. " Company Code

lt_acc_gl-pstng_date = sy-datum. " Posting Date

append lt_acc_gl.

refresh lt_curr_amt.

lt_curr_amt-itemno_acc = '1'. "

lt_curr_amt-curr_type = '00'.

lt_curr_amt-currency = 'KRW'. "bdc_source-col_g. " Currancy

lt_curr_amt-amt_doccur = '10'. " Line Item Amount

append lt_curr_amt.

clear lt_curr_amt.

lt_curr_amt-itemno_acc = '2'. "

lt_curr_amt-curr_type = '00'.

lt_curr_amt-currency = 'KRW'. " Currancy

lt_curr_amt-amt_doccur = '-10'. "gt_itab-setwr * -1. " Line Item Amount

append lt_curr_amt.

refresh lt_return.

call function 'BAPI_ACC_DOCUMENT_POST'

exporting

documentheader = lt_doc_header

tables

accountgl = lt_acc_gl

currencyamount = lt_curr_amt

return = lt_return

1 ACCEPTED SOLUTION

Former Member

Try passing the GL account with leading zeors.

Hope this helps.

Thanks,

Balaji

2 REPLIES 2

Former Member

Try passing the GL account with leading zeors.

Hope this helps.

Thanks,

Balaji

0 Kudos

You saved my life! Thank you man