Create invoice: MIRO
对应BAPI: BAPI_INCOMINGINVOICE_CREATE
Preformed invoice: MIR7
Corresponding BAPI: BAPI_INCOMINGINVOICE_PARK
The incoming parameters of the two BAPIs are highly similar
4 types of "business processing"
1 Invoice Park as Invoice
2 Credit certificate Park as Credi Memo
3 Subsequent Debit Park as Subsequent Debit
4 Subsequent Credit Park as Subsequent Credit
Here has BAPI: BAPI_INCOMINGINVOICE_PARK as an example
4 types of "business processing" are achieved by arranging and combining two parameters
"Park as Invoice: headerdata-invoice_ind = 'X' itemdata-de_cre_ind = space
"Park as Credi Memo: headerdata-invoice_ind = space itemdata-de_cre_ind = space
"Park as Subsequent Debit: headerdata-invoice_ind = 'X' itemdata-de_cre_ind = 'X'
"Park as Subsequent Credit:headerdata-invoice_ind = space itemdata-de_cre_ind = 'X'
Note 1: The parameter (service processing) in headerdata inv_tran does not need to be assigned (1, 2, 3, 4) otherwise an error will be reported
If the parameters itemdata and taxdata are maintained when pre-made invoices or invoices for PO
If the invoice or invoice is directly prepared for the item number, the parameters materialdata and taxdata are maintained
Note 2: The parameter BUZEI in itemdata must be arranged in ascending order, otherwise the row data may be lost
CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK'
EXPORTING
headerdata = ls_headerdata
* ADDRESSDATA =
IMPORTING
invoicedocnumber = lv_invoicedocnumber
fiscalyear = lv_fiscalyear
TABLES
itemdata = lt_itemdata
* ACCOUNTINGDATA =
* GLACCOUNTDATA =
* materialdata = lt_materialdata
taxdata = lt_taxdata
* WITHTAXDATA =
* VENDORITEMSPLITDATA =
return = lt_return
* EXTENSIONIN =
* TM_ITEMDATA =
* NFMETALLITMS =
.
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
EXPORTING
headerdata = ls_headerdata
* ADDRESSDATA =
IMPORTING
invoicedocnumber = lv_invoicedocnumber
fiscalyear = lv_fiscalyear
TABLES
itemdata = lt_itemdata
* ACCOUNTINGDATA =
* GLACCOUNTDATA =
* materialdata = lt_materialdata
taxdata = lt_taxdata
* WITHTAXDATA =
* VENDORITEMSPLITDATA =
return = lt_return
* EXTENSIONIN =
* TM_ITEMDATA =
* NFMETALLITMS =
.