SAP Function BAPI_INCOMINGINVOICE_CREATE1 - Invoice Verification: Hold/ Park/ Park As Complete/ Post Incoming Invoice

Parameter Reference Type Length Default Optional Text
ADDRESSDATA BAPI_INCINV_CREATE_ADDRESSDATA u 516 X Transfer Structure: Address Data Incoming Invoice (Create)
HEADERDATA BAPI_INCINV_CREATE_HEADER u 489 Transfer Structure for Invoice Header Data (Create)
INVOICESTATUS BAPI_INCINV_CREATE_STATUS-RBSTAT C 1 '5' X Invoice Document Status

Parameter Reference Type Length Text
FISCALYEAR BAPI_INCINV_FLD-FISC_YEAR N 4 Fiscal Year
INVOICEDOCNUMBER BAPI_INCINV_FLD-INV_DOC_NO C 10 Document Number of an Invoice Document

Parameter Reference Length Optional Text
ACCOUNTINGDATA BAPI_INCINV_CREATE_ACCOUNT 330 X Transfer Structure for Invoice Acct Assignment Data (Create)
EXTENSIONIN BAPIPAREX 990 X Enhancement Fields (Import Parameter)
EXTENSIONOUT BAPIPAREX 990 X Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
GLACCOUNTDATA BAPI_INCINV_CREATE_GL_ACCOUNT 404 X Transfer Struct.: G/L Acct Posting Incoming Invoice (Create)
ITEMDATA BAPI_INCINV_CREATE_ITEM 216 Transfer Structure for Invoice Item Data (Create)
MATERIALDATA BAPI_INCINV_CREATE_MATERIAL 163 X Transfer Struct.: Material Posting Incoming Invoice (Create)
RETURN BAPIRET2 548 Return Parameter(s)
TAXDATA BAPI_INCINV_CREATE_TAX 66 X Transfer Structure for Tax Data (Create)
TM_ITEMDATA BAPI_INCINV_CREATE_TM_ITEM 143 X Transfer Structure: Item Data Incoming Invoice for Transportation Management
VENDORITEMSPLITDATA BAPI_INCINV_CREATE_VENDORSPLIT 27 X Transfer Structure: Vendor Split Incoming Invoice (Create)
WITHTAXDATA BAPI_INCINV_CREATE_WITHTAX 46 X Transfer Structure: Withholding Tax Data (Create)

Functionality
With this method you can hold, park, park as complete, or postincoming invoices.

  • Hold Incoming Invoice

  • The system saves an incomplete invoice document and carries out minimumchecks to determine if there is a company code, for example. Thepurchase order history is not updated, nor is data posted to financialaccounting.
    • Park Incoming Invoice

    • The system creates an invoice document in document parking and saves thedata to the database. Before the data is saved, the system carries outconsistency checks. The following objects are updated:
      Informative purchase order history
      Data for advance tax returns
      Index for duplicate invoice check
      Open vendor items in parked documents
      Log of document changes
      You use the Park Incoming Invoice function in the followingcases:
      Information required to post the invoice document is missing, and you donot want to have to enter data again that has already been entered.
      The balance is not zero.
      You want updates to take place (informative purchase order history, datafor advance tax returns, index for checking for duplicate invoices andopen vendor items).
      You can still change, delete, and post parked invoice documents at alater data, or save them as complete.
      • Park incoming invoice as complete

      • The system does not expect any more changes to the invoice document. Thebalance is zero. The invoice document is flagged for posting but has notyet been posted. The same checks are used as for posting. The followingfollow-on documents are created:
        Informative purchase order history
        Data for advance tax returns
        Index for duplicate invoice check
        Open vendor items in parked documents
        Purchase order commitment
        Controlling documents
        Funds management documents
        Document changes
        • Post Invoice

        • The process is the same as for park as complete but the systemposts the invoice at the end of the process.
          Control
          The value you assign to the import parameter InvoiceStatuscontrols the invoice process:
          • Value 5: Invoice is posted

          • Value A: Invoice is parked

          • Value B: Invoice is parked as complete

          • Value D: Invoice is put on hold

          • If you do not enter a value, the system uses the default value 5.
            When the header data is transferred, the INVOICE_IND field determineswhether the system creates a credit memo or an invoice:
            • Value INITIAL: System creates a credit memo

            • Value X: System creates an invoice

            • If you want to enter an incoming invoice for a return order, you mustleave the INVOICE_IND field initial and enter the value 5 in theINVOICESTATUS field.
              Objects
              You can use the functions of this method on the same objects as the
              create and post functions of methodBAPI_INCOMINGINVOICE_CREATE. Thismeans you can hold, park, park as complete, or
              post the following objects:
              • Invoices with multiple account assignment

              • Invoices with different account assignments

              • Invoices for blanket purchase orders

              • Invoices for purchase orders with planned delivery costs

              • Invoices with unplanned delivery costs

              • Subsequent debits and credits

              • Invoices with withholding tax

              • Invoices with multiple vendor line items and different payment methods
              • and terms of payment
                • Invoices with returns purchase orders

                • Invoices for transportation service providers

                • Invoices for purchase orders for external services

                • Invoices with G/L account postings

                • Invoices with material account postings

                • Invoices for a one-time vendor


                  • Invoices with a different payee

                  • Note: You can use document types with external number assignment.
                    Constraints
                    The following fields in Financial Accounting are not passed on:
                    • ISR subscriber number (ISR = Inpayment Slip with Reference number)

                    • Bank details

                    • Payment reference

                    • Short key for house bank

                    • Service indicator
                    • Notes
                      The following authorization object is checked with activity 77 oractivity 01:
                      M_RECH_WRK: Authorization to create invoices incertain plants
                      Input parameters
                      The following data is transferred:

                      • HeaderData table: header data from incoming invoice

                      • AddressData table: address data of a one-time vendor or different
                      • payee for the incoming invoice
                        • ItemData table: item data from the incoming invoice

                        • IF &[SWITCH]MM_SFWS_MAA& = 'X'.
                          • Tabelle TM_ITEMDATA table: transfer structure item data incoming
                          • invoice (ext. TMS)
                            ENDIF.
                            • AccountingData table:account assignment data for the incoming
                            • invoice of an item
                              • GlAccountData table: data for posting to the G/L account

                              • MaterialData table: data for posting to the material account

                              • TaxData table: tax information for the incoming invoice

                              • WithTaxData table: withholding tax information

                              • VendorItemSplitData table: distribution of the gross amount to
                              • multiple vendor line items with different payment methods and terms ofpayment
                                Output parameters
                                The document number of the invoice document and the fiscal year arereturned as key fields of the incoming invoice.
                                Return Messages
                                INCLUDE BAPI_RET OBJECT DOKU ID TX LANGUAGE EN
                                INCLUDE BAPI_INVENTUR_WEITERINF OBJECT DOKU ID TX LANGUAGE EN
                                Customer Enhancements
                                The BAPI customer enhancement concept allows customers to take accountof additional data that is not considered at interface level.
                                The ExtensionIn and ExtensionOut parameters serve as datacontainers in which the additional values are transferred at import andexport.
                                In addition to the extension parameters in the interface, the BAPIfunction module provides BAdIs (Business Add-Ins) that check the datatransferred to the method by the customer and carry out furtherprocessing.
                                For more information, see SAP Library.

                                Example: Hold invoice without goods receipt
                                This example shows which header data you must enter in the
                                HeaderData table and which item data in the ItemData table ifyou want to hold an incoming invoice without a goods receipt.

                                • Purchase order (transaction ME21N): 100 pieces, material A (purchase
                                • order item 10)
                                  • Item details on Invoice tab page in field WE-BEZ.RP (

                                  • indicator for goods receipt-based invoice verification): IndicatorNOT set
                                    • Goods receipt (transaction MIGO): 100 pieces, material A

                                    • To get an incoming invoice for this purchase order with reference to thepurchase order number (such as 4500000018), purchase order item 10, fora quantity of 100 pieces of material A, enter the following data:
                                      Import structure HeaderData
                                      • INVOICE_IND (post invoice/credit memo): X

                                      • DOC_DATE (document number in document): 27.10.2008

                                      • PSTNG_DATE (posting date in document): 27.10.2008

                                      • COMP_CODE (company code): 0001

                                      • DIFF_INV (different invoicing party): VENDOR1

                                      • CURRENCY (currency key): USD

                                      • GROSS_AMOUNT (gross invoice amount in document currency): 100

                                      • BLINE_DATE (baseline date for due date calculation): 27.10.2008

                                      • Import parameter InvoiceStatus
                                        • INVOICESTATUS (invoice document status): D

                                        • ItemData table
                                          • INVOICE_DOC_ITEM (document item in invoice document): 000001

                                          • PO_NUMBER (purchase order number): 4500000018

                                          • PO_ITEM (item number of purchasing document): 00010

                                          • ITEM_AMOUNT (amount in document currency): 100

                                          • QUANTITY (quantity): 100

                                          • PO_UNIT (purchase order unit): pc

                                          • You get the document number of an invoice document (INVOICEDOCNUMBERfield, for example 5105600788) and the fiscal year (FISCALYEAR field,for example 2008). 2008).

                                            Example: Hold goods receipt-based invoice with account assignment
                                            This example shows which header data you must enter in the
                                            HeaderData table, which item data in the ItemData table, andwhich account assignment data in the AccountingData table if youwant to hold a goods receipt-based invoice with account assignment.

                                            • Purchase order (transaction ME21N): 100 pieces of material A with
                                            • account assignment category K (purchase order item 10) and 50 pieces ofmaterial B with account assignment category K (purchase order item 20)Item details:
                                              • Item overview

                                              • Purchase order item 10, Invoice tab page; WE-BEZ.RP field (
                                                indicator for goods receipt-based invoice verification): Indicatorset
                                                Purchase order item 10, Account Assignment tab page; percentagedistribution: 50 percent, cost center KOST1, G/L account 892000 and 50percent, cost center KOST2, G/L account 892000
                                                • Goods receipt for purchase order (transaction MIGO): partial delivery,
                                                • 50 pieces of material A (material document number: 5000000052).
                                                  To get an incoming invoice for this purchase order with reference topurchase order number 4500000020 and the posted goods receipt 5
                                                  000000052, enter the following data:
                                                  Import structure HeaderData
                                                  • INVOICE_IND (post invoice/credit memo): X

                                                  • DOC_DATE (document number in document): 27.10.2008

                                                  • PSTNG_DATE (posting date in document): 27.10.2008

                                                  • COMP_CODE (company code): 0001

                                                  • DIFF_INV (different invoicing party): STANDARD

                                                  • CURRENCY (currency key): USD

                                                  • GROSS_AMOUNT (gross invoice amount in document currency): 50

                                                  • BLINE_DATE (baseline date for due date calculation): 27.10.2008

                                                  • Import parameter InvoiceStatus
                                                    • INVOICESTATUS (invoice document status): D

                                                    • ItemData table
                                                      • INVOICE_DOC_ITEM (document item in invoice document): 000001

                                                      • PO_NUMBER (purchase order number): 4500000020

                                                      • PO_ITEM (item number of purchasing document): 00010

                                                      • REF_DOC (document number of a reference document): 5000000052

                                                      • REF_DOC_YEAR (fiscal year of current period): 2008

                                                      • REF_DOC_IT (reference document item): 0001

                                                      • ITEM_AMOUNT (amount in document currency): 50

                                                      • QUANTITY (quantity): 50

                                                      • PO_UNIT (purchase order unit):

                                                      • AccountingData table
                                                        AccountingData table - row 1
                                                        • INVOICE_DOC_ITEM (document item in invoice document): 000001

                                                        • SERIAL_NO (account assignment sequence number): 01

                                                        • ITEM_AMOUNT (amount in document currency): 25

                                                        • QUANTITY (quantity): 25

                                                        • PO_UNIT (purchase order unit): pc

                                                        • GL_ACCOUNT (G/L account number): 892000

                                                        • COSTCENTER (cost center): KOST1

                                                        • AccountingData table - row 2
                                                          • INVOICE_DOC_ITEM: 000001

                                                          • SERIAL_NO: 02

                                                          • ITEM_AMOUNT: 25

                                                          • QUANTITY: 25

                                                          • PO_UNIT: pc

                                                          • GL_ACCOUNT: 892000

                                                          • COSTCENTER: KOST2

                                                          • You get the document number of an invoice document (INVOICEDOCNUMBERfield, for example 5105600789) and the fiscal year (FISCALYEAR field,for example 2008).

                                                            Description
                                                            INCLUDE BAPI_KEYFIELD
                                                            Fiscal year

                                                            Description
                                                            INCLUDE BAPI_KEYFIELD
                                                            Document number of an invoice document
                                                            INCLUDE 'BAPI_INCOMINGINVOICE_CREATE ADDRESSDATA' OBJECT DOKU ID FU
                                                            INCLUDE 'BAPI_INCOMINGINVOICE_CREATE HEADERDATA' OBJECT DOKU ID FU

                                                            Description
                                                            Controls the invoice process.

                                                            Value range
                                                            You can define the following invoice processes by the value of theimport parameter InvoiceStatus:

                                                            • Value 5: Invoice is posted

                                                            • Value A: Invoice is parked

                                                            • Value B: Invoice is parked as complete

                                                            • Value D: Invoice is put on hold

                                                            • Note:
                                                              When the header data is passed on, the INVOICE_IND field determineswhether the system creates a credit memo or an invoice:
                                                              • Value INITIAL: System creates a credit memo

                                                              • Value X: System creates an invoice

                                                              • If you want to enter an incoming invoice for a return order, you mustleave the INVOICE_IND field initial and enter the value 5 in theINVOICESTATUS field.

                                                                Default
                                                                If you do not enter a value, the system uses the default value 5.
                                                                INCLUDE 'BAPI_INCOMINGINVOICE_CREATE ACCOUNTINGDATA' OBJECT DOKU ID FU

                                                                Description
                                                                This table enables you to supply the enhancement fields from table IVEXTwithout modifications.

                                                                Description
                                                                This table enables you to return the enhancement fields to the callinginstance without modifications.

                                                                Description
                                                                This table contains G/L account data for an incoming invoice.
                                                                If, in addition to a purchase order item, you also want to make postingsto a GL account, enter the relevant postings in the GlAccountDatatable.
                                                                Note:
                                                                For information about the meaning of the individual parameter fields,see the relevant data element documentation in the ABAP Dictionary.
                                                                The following fields must be filled:

                                                                • Invoice document item (INVOICE_DOC_ITEM field)

                                                                • General ledger account in G/L accounting (GL_ACCOUNT field)

                                                                • Credit/debit indicator (DB_CR_IND field)

                                                                • Company code (COMP_CODE field)

                                                                • Tax code (TAX_CODE field)

                                                                • The following fields are optional:
                                                                  • Amount in document currency (ITEM_AMOUNT field)

                                                                  • Negative posting indicator (NEG_POSTNG field)

                                                                  • Tax jurisdiction code # location for tax calculation (TAXJURCODE field)

                                                                  • Item text (ITEM_TEXT field)

                                                                  • Cost center (COST_CENTER field)

                                                                  • SD document number (SD_DOC field)

                                                                  • SD document item (SDOC_ITEM field)

                                                                  • Order number (ORDERID field)

                                                                  • Reference date for settlement (REF_DATE field)

                                                                  • Commitment item (CMMT_ITEM_LONG field)

                                                                  • Funds center (FUNDS_CTR field)

                                                                  • Functional area (FUNC_AREA_LONG field)

                                                                  • Profit center (PROFIT_CTR field)

                                                                  • Fund (FUND field)

                                                                  • Business area (BUS_AREA field)

                                                                  • Business area of business partner (TR_PART_BA field)

                                                                  • Cost object (COSTOBJECT field)

                                                                  • Network number for account assignment (NETWORK field)

                                                                  • Activity number (ACTIVITY field)

                                                                  • WBS element (WBS_ELEM field)

                                                                  • Activity type (ACTTYPE field)

                                                                  • Internal key for real estate object (RL_EST_KEY field)

                                                                  • Personnel number (PERSON_NO field)

                                                                  • Business process (CO_BUSPROC field)

                                                                  • Grant (GRANT_NBR field)
                                                                  • Value range
                                                                    Checks
                                                                    If the system cannot determine any data, it returns appropriate returnmessages from the method call. These are listed in the return parameter.
                                                                    Invoice document item (INVOICE_DOC_ITEM field)
                                                                    This field must be populated with ascending values.


                                                                    INCLUDE 'BAPI_INCOMINGINVOICE_CREATE ITEMDATA' OBJECT DOKU ID FU

                                                                    Description
                                                                    This table contains material account data for an incoming invoice.
                                                                    If, in addition to a purchase order item, you also want to make postingsto a material, enter the relevant postings in the MaterialDatatable.
                                                                    Note:
                                                                    For information about the meaning of the individual parameter fields,see the relevant data element documentation in the ABAP Dictionary.
                                                                    The following fields must be filled:

                                                                    • Invoice document item (INVOICE_DOC_ITEM field)

                                                                    • Material (MATERIAL field)

                                                                    • Valuation area (PLANT field)

                                                                    • Credit/debit indicator (DB_CR_IND field)

                                                                    • Quantity (QUANTITY field)

                                                                    • Base unit of measure (BASE_UOM field)

                                                                    • Base unit of measure in ISO code (BASE_UOM_ISO field)

                                                                    • Tax code (TAX_CODE field)

                                                                    • The following fields are optional:
                                                                      • Valuation type (VALUATION_TYPE field)

                                                                      • Amount (ITEM_AMOUNT field)

                                                                      • Tax jurisdiction code # jurisdiction for tax calculation (TAXJURCODE
                                                                      • field)

                                                                        Value range
                                                                        Checks
                                                                        If the system cannot determine any data, it returns appropriate returnmessages from the method call. These are listed in the return parameter.
                                                                        Invoice document item (INVOICE_DOC_ITEM field)
                                                                        This field must be populated with ascending values.
                                                                        INCLUDE 'BAPI_INCOMINGINVOICE_CREATE RETURN' OBJECT DOKU ID FU

                                                                        Description
                                                                        This table contains the tax information for the invoice to be created.
                                                                        INCLUDE BAPI_DATAELEMENT
                                                                        The following fields have to be populated:

                                                                        • Tax code (TAX_CODE field)

                                                                        • Tax amount in document currency (TAX_AMOUNT field)

                                                                        • The following fields can be populated:
                                                                          • Tax base amount in document currency (TAX_BASE_AMOUNT field)

                                                                          • Condition type (COND_TYPE field)

                                                                          • Tax jurisdiction (TAXJURCODE field)

                                                                          • Tax jurisdiction code - location for tax (TAXJURCODE_DEEP field)

                                                                          • Document item number for tax document (ITEMNO_TAX field)
                                                                          • Description
                                                                            You can use this table to transfer item data from the invoice document(applies to invoices that were created with reference to SAP TM).

                                                                            Description
                                                                            You use this table to transfer the incoming invoice data if you want todistribute the gross amount to multiple vendor lines.
                                                                            INCLUDE BAPI_DATAELEMENT OBJECT DOKU ID TX
                                                                            The following fields must be populated:

                                                                            • Grouping key for splitting vendor line item (SPLIT_KEY field)

                                                                            • The following fields can be populated:
                                                                              • Invoice gross partial amount in document currency (SPLIT_AMOUNT field)

                                                                              • Payment method (PYMT_METH field)

                                                                              • Tax code (TAX_CODE field)

                                                                              • Terms of payment key (PMNTTRMS field)

                                                                              • Payment method supplement (PMTMTHSUPL field)
                                                                              • Value range
                                                                                Grouping key for amount split
                                                                                If you want to distribute the withholding tax to multiple vendor lineitems, you must use the same grouping keys (SPLIT_KEY) for the amountsplit as for the withholding tax: The line numbers for the grouping keysmust be entered in ascending order.

                                                                                Description
                                                                                With this table you transfer the data for the withholding tax of theincoming invoice, for example, information about the calculation ofemployment tax or capital gains tax.
                                                                                INCLUDE BAPI_DATAELEMENT OBJECT DOKU ID TX
                                                                                The following fields must be populated:

                                                                                • Grouping key for splitting vendor line item (SPLIT_KEY field)

                                                                                • The following fields can be populated:
                                                                                  • Indicator for withholding tax type (WI_TAX_TYPE field)

                                                                                  • Withholding tax code (TAX_CODE field)

                                                                                  • Withholding tax base amount (WI_TAX_BASE field)

                                                                                  • Withholding tax amount in document currency (WI_TAX_AMOUNT field)

                                                                                  • Withholding tax retention amount in document currency
                                                                                  • (WI_TAX_WITHHELD_AMT field)

                                                                                    Value range
                                                                                    Grouping key (SPLIT_KEY)
                                                                                    If you enter multiple lines for the withholding tax, you must enter thegrouping keys in ascending order.
                                                                                    If you want to distribute the withholding tax to multiple vendor lineitems, you must use the same grouping key (SPLIT_KEY) for the amountsplit as for the withholding tax.
                                                                                    Withholding tax type (WI_TAX_TYPE) and withholding tax code(WI_TAX_CODE)
                                                                                    The withholding tax type contains the calculation type for determiningthe withholding tax. The vendor can be intermittently exempt fromwithholding tax; this information is specified in the vendor masterrecord.
                                                                                    If you enter a withholding tax code, you must also specify thewithholding tax type
                                                                                    If the withholding tax code (WI_TAX_CODE) contains a value, thewithholding tax base amount must be filled (WI_TAX_BASE).
                                                                                    If the withholding tax code (WI_TAX_CODE) is initial, the withholdingtax amount in the document currency (WI_TAX_AMT) and the withholding taxbase amount (WI_TAX_BASE) must be zero.

1571719SOA: SuplInvERPCreatReqConf - new fields