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.