Do Invoice verification and create and post incoming invoices with this BAPI: BAPI_INCOMINGINVOICE_CREATE. Here is an example:
ls_miro_head-invoice_ind = 'X'.ls_miro_head-doc_date = sy-datum.ls_miro_head-pstng_date = sy-datum.ls_miro_head-currency = ls_ekko-waers.ls_miro_head-comp_code = ls_ekko-bukrs.ls_miro_items-invoice_doc_item = '000001'.ls_miro_items-po_number = wa_ekpo-ebeln.ls_miro_items-po_item = wa_ekpo-ebelp.ls_miro_head-gross_amount = ls_miro_items-item_amount = wa_ekpo-netwr.ls_miro_items-quantity = 1.ls_miro_items-po_unit = gv_isocode.ls_miro_items-ref_doc = it_migo_beleg-mat_doc.ls_miro_items-ref_doc_year = it_migo_beleg-doc_year.ls_miro_items-ref_doc_it = '0001'.ls_miro_items-tax_code = wa_ekpo-mwskz.APPEND ls_miro_items TO lt_miro_items.ls_miro_split-split_key = '000001'.ls_miro_split-split_amount = wa_ekpo-netwr.APPEND ls_miro_split TO lt_miro_split.* --- Call the bapi to create the invoiceCALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'EXPORTINGheaderdata = ls_miro_head* ADDRESSDATA =IMPORTINGinvoicedocnumber = lw_invoice* FISCALYEAR =TABLESitemdata = lt_miro_items* NFMETALLITMS =* ACCOUNTINGDATA =* GLACCOUNTDATA =* MATERIALDATA =* TAXDATA =* WITHTAXDATA =vendoritemsplitdata = lt_miro_splitreturn = lt_miro_return.
No comments:
Post a Comment