‎2007 Nov 14 9:28 AM
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.
‎2007 Nov 14 5:42 PM
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.
‎2007 Nov 14 5:42 PM
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.
‎2007 Nov 14 5:50 PM
Hi Fandi,
Pass 'ABR' in below statement instead of 'MKPF'
lwa_header-obj_type = 'MKPF'.
Reward Points if it helps,
Satish
‎2007 Dec 23 12:05 PM
‎2024 Aug 02 10:00 AM
Where to pass IRN in BAPI_ACC_DOCUMENT_POST to update BSEG table ?