BAPI for Vendor Non-PO Invoice processed through MIR7 Transaction
I have a requirement where i will get data from flat file for that Vendor Non-PO Invoice will be processed by using MIR7 transaction[Multiple line items] - Invoice Upload[Parking the document].
The data is in below format in flat file:
Header fields in 1st line
Dr. Key related fields in 2nd line
Cr. Key related fields in 3rd line
Header fields in 4th line
Dr. Key related fields in 5th line
Cr. Key related fields in 6th line
etc .... in flat file
In these main fields coming in from flat file are: comp.code, doc.type, vendor no, Debit/Credit indicator[SHKZG], G/L a/c no, inv/post dates etc..
1. I am planning to use F.M BAPI_INCOMINGINVOICE_PARK is it the correct F.M!
But Here PO number seems to be mandatory for this F.M but it is not available as per our flat file, if so can anybody suggest a BAPI for Vendor Non-PO Invoice parking for MIR7 transaction!
2. What are the parameters need to be used for from above flat file data especially for 2 line items[Dr./Cr.] data other than header data. So as per Header & 2 Line items [Dr. & Cr. Data] which parameters will be updated with which data in above flat file! can anybody clarify!
3. Also in flat file WorkflowNo is available in which parameter this fields will need to be filled & also by doing this will it trigger workflow automatically!
Can anybody clarify about above points!
Thanks in advance.
Edited by: Deep on Sep 4, 2008 8:21 PM
Grzegorz Glowacki replied
I know it might be quite late for you for this answer, nevertheless I will write that, because there are lots of question like yours. bapi_incominginvoice_park is also a suitable bapi for you. All you need to do is call it this way:
data: headerdata like bapi_incinv_create_header value is initial, table_item type table of bapi_incinv_create_item, gl_account like bapi_incinv_create_gl_account, table_gl type table of bapi_incinv_create_gl_account. * fill headerdata and table_gl, leaving table_item empty CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK' EXPORTING HEADERDATA = HEADERDATA * ADDRESSDATA = IMPORTING INVOICEDOCNUMBER = lv_docnr FISCALYEAR = lv_year TABLES ITEMDATA = table_item * ACCOUNTINGDATA = table_acc GLACCOUNTDATA = table_gl * MATERIALDATA = * TAXDATA = table_tax * WITHTAXDATA = * VENDORITEMSPLITDATA = RETURN = lt_return.
This works perfectly for me, creating a mir7 document without refering to a PO. The trick here is to fulfill the glaccountingdata importing table while leaving itemdata empty.