Application Development and Automation 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: 
Read only

BAPI_ACC_DOCUMENT_POST Reference

Former Member
0 Likes
3,321

Hi All,

I Have a requirement to post FI documents with a reference to MM document.

I found "BAPI_ACC_DOCUMENT_POST" and fill the following fields in my code:

lwa_header-bus_act = 'RMWE'.

lwa_header-username = 'TEST1'.

lwa_header-comp_code = 'USFC'.

lwa_header-doc_date = '20071129'.

lwa_header-pstng_date = '20071114'.

lwa_header-doc_type = 'SA'.

lwa_header-fis_period = '11'.

lwa_header-obj_sys = 'PXOCLNT140'.

lwa_header-obj_type = 'MKPF'.

lwa_header-OBJ_KEY = '50000000352007'.

lwa_header-header_txt = 'Test posting BAPI'.

lwa_header-ref_doc_no = 'REFXBLNR'.

l_itemno_acc = l_itemno_acc + 1.

clear lwa_account_gl.

lwa_account_gl-ITEMNO_ACC = l_itemno_acc.

lwa_account_gl-TAX_CODE = 'V0'.

lwa_account_gl-GL_ACCOUNT = '0602210102'.

lwa_account_gl-COSTCENTER = 'JVOPTTESTX'.

lwa_account_gl-ITEM_TEXT = 'Test item 1'.

APPEND lwa_account_gl to lt_account_gl.

clear lwa_currency_amount.

lwa_currency_amount-ITEMNO_ACC = l_itemno_acc.

lwa_currency_amount-CURR_TYPE = '00'.

lwa_currency_amount-currency = 'USD'.

lwa_currency_amount-AMT_DOCCUR = '1234'.

APPEND lwa_currency_amount to lt_currency_amount.

When I try to run the program, I encounter an error "Incorrect entry in field OBJ_TYPE: MKPF".

Does any one have any experience on this? Or am I missing something in my code? Many thanks in advance for your help guys.

Best Regards,

Fandi.

1 ACCEPTED SOLUTION
Read only

0 Likes
2,840

I recently wrote a report that calls bapi BAPI_ACC_INVOICE_RECEIPT_POST which i think is similar to BAPI_ACC_DOCUMENT_POST.

Have you tried leaving the field lwa_header-obj_type blank?

In my program I do not provide a value for this field and my documents post successfully.

4 REPLIES 4
Read only

0 Likes
2,841

I recently wrote a report that calls bapi BAPI_ACC_INVOICE_RECEIPT_POST which i think is similar to BAPI_ACC_DOCUMENT_POST.

Have you tried leaving the field lwa_header-obj_type blank?

In my program I do not provide a value for this field and my documents post successfully.

Read only

Former Member
0 Likes
2,840

Hi Fandi,

Pass 'ABR' in below statement instead of 'MKPF'

lwa_header-obj_type = 'MKPF'.

Reward Points if it helps,

Satish

Read only

Former Member
0 Likes
2,840

Got the answer from a friend. Thanks all for your help

Read only

Avinash07
Discoverer
0 Likes
2,385

Where to  pass IRN in BAPI_ACC_DOCUMENT_POST to update BSEG table ?