SAP MM 發票預製 Function Module - BAPI_INCOMINGINVOICE_PARK

dicksonjyl560101發表於2018-05-26
  加入SY專案不到一週,就被在毫無準備的情況下被指派去參與一個SRMSAP系統的介面專案裡,參與這個需求裡預製發票在SRMSAP系統之間資料傳遞的場景梳理。要從技術的角度弄清楚各個場景下從SRM系統傳入SAP系統,以及從SAP系統回傳到SRM系統的資料欄位列表。這個需求裡最複雜的場景是業務人員在SRM系統上發起預製發票申請,經過審批後,透過介面傳入SAP系統,在SAP系統裡建立預製發票,然後回傳到SRM系統;另外業務人員可能會在SRM系統裡對於已經審批過的預製發票申請做修改,這個修改也要透過介面傳入SAP系統。這2個場景,SAP都要接受從SRM系統傳過來的資料。


我需要與SRM系統運維專案組同行溝通,對欄位,即是告訴SRM同事這2個場景裡需要傳遞哪些引數到SAP系統裡來。筆者參與的專案裡很少使用預製發票功能,幾年前的一個跨國企業運維專案裡有用到,但是我們只是運維,並沒有參與功能實現。所以這個東東對於我,還是比較新的一個東東。為了應付工作需要,並且是迫切的需求,筆者上網查資料,得到了如下的一片文字,對於筆者很有幫助,大大的減少了筆者研究與學習的時間。


         如下英文部分文字來自於網際網路

 

SAP MM BAPI_INCOMINGINVOICE_PARK - Invoice Verification: Park Incoming Invoice

 

Functionality

You can use this method to park incoming invoices.

When header data is transferred, you use the field INVOICE_IND to determine whether the system generates a credit memo or an invoice. If you leave the field initial, the system generates a credit memo. If you enter X, the system generates an invoice.

You use this method if information on posting an invoice document is missing in the invoice document. The balance can be a value other than zero. As in the online transaction, the following updates take place: for example, informative PO history, advance tax return, index for checks re duplicate invoices, open creditor items from parked documents, log of document changes.

You can use this method to:

  • Park invoices with multiple account assignment
  • Change and park invoice account assignments
  • Park invoices for blanket purchase orders (see also the documentation for the function module )
  • Park invoices for purchase orders with planned delivery costs
  • Park invoices with unplanned delivery costs
  • Park subsequent credits and debits
  • Use document types with external number ranges
  • Park invoices with withholding tax
  • Park invoices with several creditor lines and different methods and terms of payment
  • Park invoices for purchase orders for external services
  • Park invoices with G/L account postings
  • Park invoices with material account postings
  • Park invoices for a one-time supplier
  • Park invoices with a different payee
  • Create and post provisional/differential invoices and final invoices in the context of differential invoicing
    (See also documentation for function module
    (Invoice Verification: Post Incoming Invoice))

Constraints

You cannot post invoices for returns orders

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:

  • Plant authorization for entering incoming invoices

Input parameters

You transfer the header data of the incoming invoice using the structure HeaderData.

The tables ItemData and AccountingData contain the item data of the incoming invoice. The TaxData table contains the tax information for the incoming invoice.

The GlAccountData table contains data for posting to G/L accounts, and the MaterialData table contains data for posting to material accounts.

You can use the WithTaxData table to pass on withholding tax information.

You can use the VendorItemSplitData table to distribute the gross amount among several vendor line items with different methods and terms of payment.

Output parameters

The document number of the invoice document and the fiscal year are returned as key fields of the incoming invoice.

Return messages

Messages are returned in the Return parameter. The parameter documentation shows the return codes and their meanings.

Further information

Example: Incoming Invoice

This example shows which header data you can park in the table HeaderData and which item data you can park in the table ItemData.

Purchase Order: 10 pc of material A @ 10 USD
Goods receipt: 10 pc of material A

For this purchase order, you receive an incoming invoice referencing PO number 4500007491, PO item 10, for a quantity of 10 pc of material A and an amount of 116 USD incl. 16% VAT. You enter the following data:

HeaderData table

  • INVOICE_IND (invoice/credit memo): X
  • DOC_DATE (document date): 20.05.2000
  • PSTNG_DATE (Posting date): 23.05.2000
  • COMP_CODE (company code): 1000
  • GROSS_AMOUNT (Gross amount): 116,00
  • CURRENCY (currency key): USD
  • CALC_TAX_IND (calculate tax): X

ItemData table

  • INVOICE_DOC_ITEM (Invoice document item): 00001
  • PO_NUMBER (purchase order number): 4500007491
  • PO_ITEM (Purchase order item): 00010
  • TAX_CODE (Tax code): VN
  • ITEM_AMOUNT (Item amount): 100
  • QUANTITY (Quantity): 10
  • PO_UNIT (Unit of measure): pc

For more information, see the parameter documentation for the and tables.

Example: Incoming invoice with foreign currency, GR-based invoice verification, and tax information

This example specifies the header data that you need to enter in the HeaderData table, the item data that you need to enter in the Itemdata table, and the tax information that you need to enter in the TaxDatatable, in order to park an invoice in a foreign currency.

Purchase Order: 10 pc of material A @ 10.00 USD
Goods receipt 1: 4 pc of material A
Goods receipt 2: 6 pc of material A

For this purchase order, you receive an incoming invoice referencing PO no. 4500007505, PO item 10, goods receipt document 50010095, 2000, item 1. A quantity of 4 pc of material A and a gross amount of 46.60 USD and 16% tax (6.60 USD) is invoiced. You enter the following data:

HeaderData table

  • INVOICE_IND (invoice/credit memo): X
  • DOC_DATE (document date): 20.05.2000
  • PSTNG_DATE (Posting date): 23.05.2000
  • COMP_CODE (company code): 1000
  • CURRENCY (currency key): USD
  • GROSS_AMOUNT (Gross amount): 46,60

ItemData table

  • INVOICE_DOC_ITEM (Invoice document item): 00001
  • PO_NUMBER (purchase order number): 4500007505
  • PO_ITEM (Purchase order item): 00010
  • REF_DOC (GR document): 50010095
  • REF_DOC_YEAR (fiscal year of current period): 2000
  • REF_DOC_ITEM (Item in a GR document): 1
  • TAX_CODE (Tax code): VN
  • ITEM_AMOUNT (Item amount): 40,00
  • QUANTITY (Quantity): 4
  • PO_UNIT (Unit of measure): pc

TaxData table

  • TAX_CODE (tax code): VN
  • TAX_AMOUNT (tax amount in document currency): 6,60

For more information, see the parameter documentation for the , , and tables.

Example: Change account assignments and add unplanned ones

This example shows which header data you enter in the HeaderData table, which item data you enter in the ItemData table, and which account assignment data you enter in the AccountingData table in order to be able to change account assignments for an incoming invoice. For you to be able to change account assignments, a non-valuated goods receipt or no goods receipt must exist. GR-based invoice verification takes place.

Purchase Order: 300 pc of material A @ 1.00 USD
Goods receipt: 300 pc of material A

For this purchase order with multiple account assignments, you receive an incoming invoice referencing PO number 4500006846, PO item 10, GR document 50008849, 2000, item 1. The quantity invoiced is 100 pc of material A, for a gross amount of 116.00 USD including 16% VAT. You want to change the planned account assignment for the second account assignment object and add an unplanned account assignment. You enter the following data:

HeaderData table

  • INVOICE_IND (invoice/credit memo): X
  • DOC_DATE (document date): 05.08.2000
  • PSTNG_DATE (Posting date): 08.08.2000
  • COMP_CODE (company code): 1000
  • CURRENCY (currency key): USD
  • GROSS_AMOUNT (Gross amount): 17,40
  • CALC_TAX_IND (Automatically calculate tax): X
  • PMNTTRMS (Payment terms key): 0001

ItemData table

  • INVOICE_DOC_ITEM (Invoice document item): 00001
  • PO_NUMBER (purchase order number): 4500006846
  • PO_ITEM (Purchase order item): 00010
  • REF_DOC (GR document): 500008849
  • REF_DOC_YEAR (fiscal year of current period): 2000
  • REF_DOC_ITEM (Item in a GR document): 1
  • TAX_CODE (Tax code): VN
  • ITEM_AMOUNT (Item amount): 100
  • QUANTITY (Quantity): 100
  • PO_UNIT (Unit of measure): pc

AccountingData table

Line 1: Change second account assignment item

  • INVOICE_DOC_ITEM (Document item in invoice document): 0001
  • SERIAL_NO (Serial number for the account assignment): 02
  • TAX_CODE (Tax code): VN
  • ITEM_AMOUNT (Amount in document currency): 10,00
  • QUANTITY (Quantity): 10
  • PO_UNIT (purchase order unit): pc
  • GL_ACCOUNT (G/L account number): 890000
  • COSTCENTER (Cost center): 1200

Line 2: Add unplanned account assignment

  • INVOICE_DOC_ITEM (Document item in invoice document): 0001
  • XUNPL (Unplanned account assignment from Invoice Verification): X
  • TAX_CODE (Tax code): VN
  • ITEM_AMOUNT (Amount in document currency): 5,00
  • QUANTITY (Quantity): 5
  • PO_UNIT (purchase order unit): pc
  • GL_ACCOUNT (G/L account number): 890000
  • COSTCENTER (Cost center): 1200

For more information, see the parameter documentation for the tables HeaderData, and .

Example: Incoming invoice with planned delivery costs

This example shows the header data that you need to enter in the HeaderData table, the item data that you need to enter in the ItemData table, and the tax information that you need to enter in table TaxData to create an invoice containing planned delivery costs.

Purchase Order: 100 pc of material A @ 1.00 USD
Goods receipt: 100 pc of material A

For this purchase order, you receive an incoming invoice referencing PO no. 4500006986, PO item 10, for a quantity of 100 pc of material A and an amount of 136.00 USD incl. 16% VAT and 20.00 USD planned delivery costs. You enter the following data:

HeaderData table

  • INVOICE_IND (invoice/credit memo): X
  • DOC_DATE (document date): 10.08.2000
  • PSTNG_DATE (Posting date): 12.08.2000
  • COMP_CODE (company code): 1000
  • CURRENCY (currency key): USD
  • GROSS_AMOUNT (Gross amount): 136,00

ItemData table

Line 1: Entry of PO item

  • INVOICE_DOC_ITEM (Invoice document item): 00001
  • PO_NUMBER (purchase order number): 4500006986
  • PO_ITEM (Purchase order item): 00010
  • TAX_CODE (tax code): VN
  • ITEM_AMOUNT (Item amount): 100,00
  • QUANTITY (Quantity): 100
  • PO_UNIT (Unit of measure): pc

Line 2: Entry of planned delivery costs

  • INVOICE_DOC_ITEM (Invoice document item): 00002
  • PO_NUMBER (purchase order number): 4500006986
  • PO_ITEM (Purchase order item): 00010
  • ITEM_AMOUNT (Item amount): 20,00
  • QUANTITY (Quantity): 100
  • PO_UNIT (Unit of measure): pc
  • COND_TYPE (condition type): FRB1

TaxData table

  • TAX_CODE (tax code): VN
  • TAX_AMOUNT (tax amount in document currency): 16,00

For more information, see the parameter documentation for the , , and tables.

Example: Incoming invoice with withholding tax

This example shows which header data you can enter in the HeaderData table, which item data you can enter in the Itemdata table, and which withholding tax information you can enter in the WithTaxData table, in order to park an incoming invoice with withholding tax.

Purchase Order: 10 pc of material A @ 10.00 USD
Goods receipt: 10 pc of material A

For this purchase order, you receive an incoming invoice referencing PO no. 4500007505, PO item 10, goods receipt document 50010095, 2000, item 1. A quantity of 10 pc and a gross amount of 100.00 USD is invoiced. You have to pay 10% withholding tax on the gross amount. Enter the following data:

HeaderData table

  • INVOICE_IND (invoice/credit memo): X
  • DOC_DATE (document date): 20.05.2000
  • PSTNG_DATE (Posting date): 23.05.2000
  • COMP_CODE (company code): WT01
  • CURRENCY (currency key): USD
  • GROSS_AMOUNT (Gross amount): 100,00

ItemData table

  • INVOICE_DOC_ITEM (Invoice document item): 00001
  • PO_NUMBER (purchase order number): 4500007505
  • PO_ITEM (Purchase order item): 00010
  • REF_DOC (GR document): 50010095
  • REF_DOC_YEAR (fiscal year of current period): 2000
  • REF_DOC_ITEM (Item in a GR document): 1
  • TAX_CODE (Tax code): V0
  • ITEM_AMOUNT (Item amount): 100,00
  • QUANTITY (Quantity): 10,00
  • PO_UNIT (Unit of measure): pc

WithTaxData table

  • SPLIT_KEY (grouping key for splitting withholding tax): 0001
  • WI_TAX_TYPE (indicator for withholding tax type): R1
  • WI_TAX_CODE (Withholding tax indicator): 01
  • WI_TAX_BASE (Withholding tax base amount): 100
  • WI_TAX_AMT (withholding tax amount in document currency): 10,00

For more information, see the parameter documentation for the , and tables.

Example: Incoming invoice with amount split

This example shows which header data you enter in the HeaderData table, which item data you enter in the Itemdata table, and which information you enter in the VendorItemSplitData table, in order to generate an incoming invoice with an amount split.

Purchase Order: 10 pc of material A @ 10.00 USD
Goods receipt: 10 pc of material A

For this purchase order, you receive an incoming invoice referencing PO no. 4500007505, PO item 10, goods receipt document 50010095, 2000, item 1. A quantity of 10 pc and a gross amount of 100.00 USD is invoiced. You want to distribute the gross amount among two creditor lines. 40% of the gross amount is to be paid immediately by check, and the remaining 60% of the gross amount is to be paid within 14 days subject to 3% cash discount. You enter the following data:

HeaderData table

  • INVOICE_IND (invoice/credit memo): X
  • DOC_DATE (document date): 20.05.2000
  • PSTNG_DATE (Posting date): 23.05.2000
  • COMP_CODE (company code): 0001
  • CURRENCY (currency key): USD
  • GROSS_AMOUNT (Gross amount): 100,00

ItemData table

  • INVOICE_DOC_ITEM (Invoice document item): 00001
  • PO_NUMBER (purchase order number): 4500007505
  • PO_ITEM (Purchase order item): 00010
  • REF_DOC (GR document): 50010095
  • REF_DOC_YEAR (fiscal year of current period): 2000
  • REF_DOC_ITEM (Item in a GR document): 1
  • TAX_CODE (Tax code): V0
  • ITEM_AMOUNT (Item amount): 100,00
  • QUANTITY (Quantity): 10,00
  • PO_UNIT (Unit of measure): pc

VendorItemSplitData table

Vendor line item 1

  • SPLIT_KEY (Grouping key for splitting creditor line): 0001
  • SPLIT_AMOUNT (partial invoice amount in document currency): 40,00
  • PYMT_METH (payment method): S
  • TAX_CODE (tax code): V0
  • PMNTTRMS (Payment terms key): 0001

Vendor line item 2

  • SPLIT_KEY (Grouping key for splitting creditor line): 0002
  • SPLIT_AMOUNT (partial invoice amount in document currency): 60,00
  • PYMT_METH (payment method): U
  • TAX_CODE (tax code): V0
  • PMNTTRMS (Payment terms key): 0003

For more information, see the parameter documentation for the , and tables.

Example: Incoming invoice with G/L and material account posting.

This example shows you which header data you must enter in the HeaderData table, which item data you enter in the ItemData table, which G/L account information you enter in the GlAccountData table, and which material account information you enter in the MateralData table in order to park an incoming invoice.

You receive an invoice referencing PO no. 4500006846, PO item 10. A quantity of 100 pc of material A for a gross amount of 150.80 USD including 16% VAT is invoiced. This includes a G/L account posting of 10 USD to account 400000 in company code 1, and a material account posting of 20 USD to the material MAT01. You enter the following data:

HeaderData table

  • INVOICE_IND (post invoice/credit memo): X
  • DOC_DATE (document date): 05.08.2000
  • PSTNG_DATE (Posting date): 08.08.2000
  • COMP_CODE (company code): 1000
  • CURRENCY (currency key): USD
  • GROSS_AMOUNT (Gross amount): 150,80
  • CALC_TAX_IND (Automatically calculate tax): X
  • PMNTTRMS (Payment terms key): 0001

ItemData table

  • INVOICE_DOC_ITEM (Invoice document item): 00001
  • PO_NUMBER (purchase order number): 4500006846
  • PO_ITEM (Purchase order item): 00010
  • TAX_CODE (Tax code): VN
  • ITEM_AMOUNT (Item amount): 100
  • QUANTITY (Quantity): 100
  • PO_UNIT (Unit of measure): pc

GlAccountData table

  • INVOICE_DOC_ITEM (Document item in invoice document): 00001
  • GL_ACCOUNT (G/L account): 400000
  • ITEM_AMOUNT (Item amount): 10,00
  • DB_CR_IND (Debit/credit indicator): S
  • COMP_CODE (company code): 0001
  • TAX_CODE (Tax code): VN
  • COSTCENTER (Cost center): 1

MaterialData table

  • INVOICE_DOC_ITEM (Document item in invoice document): 0001
  • MATERIAL (Material): MAT01
  • PLANT (Valuation area): 0001
  • DB_CR_INP (Debit/credit indicator): S
  • ITEM_AMOUNT (Item amount): 10,00
  • QUANTITY (MENGE_D): 1
  • PO_UNIT (purchase order unit): pc
  • TAX_CODE (Tax code): VN

For more information, see the parameter documentation for the tables HeaderData, , and

Example: Incoming invoice for a purchase order for external services and service-based invoice verification

This example shows which header data you must enter in the HeaderData table, which item data you must enter in the ItemData table, and which account assignment data you must enter in the AccountingData table in order to enter and post an incoming invoice.

You receive an invoice referencing PO no. 4500000191, PO item 10. The invoice is for two services A and B, each with a quantity of six service units. Service A has a gross amount of 580 USD incl. 16% VAT. Service B has 812 USD including 16% VAT. 50% of service A was assigned to each of the cost centers 1000 and 2000. 50% of service B was assigned to each of the cost centers 1000 and 3000. The service acceptance is performed jointly for both services with the service entry sheet number 1000000022. The account assignments cannot be changed. You enter the following data:

HeaderData table

  • INVOICE_IND (post invoice/credit memo): X
  • DOC_TYPE (Document type): RE
  • DOC_DATE (document date): 10.01.2002
  • PSTNG_DATE (Posting date): 10.01.2002
  • COMP_CODE (company code): 0001
  • CURRENCY (currency key): USD
  • GROSS_AMOUNT (Gross amount): 1392,00
  • CALC_TAX_IND (Automatically calculate tax): X
  • PMNTTRMS (Payment terms key): 0001

ItemData table

First entry for service A:

  • INVOICE_DOC_ITEM (Invoice document item): 000001
  • PO_NUMBER (purchase order number): 4500000191
  • PO_ITEM (Purchase order item): 00010
  • TAX_CODE (Tax code): V1
  • ITEM_AMOUNT (Item amount): 250,00
  • QUANTITY (Quantity): 3
  • PO_UNIT (Unit of measure): SU
  • SHEET_NO (Entry sheet number): 1000000022
  • SHEET_ITEM (Line number) : 10

Second entry for service A:

  • INVOICE_DOC_ITEM (Invoice document item): 000002
  • PO_NUMBER (purchase order number): 4500000191
  • PO_ITEM (Purchase order item): 00010
  • TAX_CODE (Tax code): V1
  • ITEM_AMOUNT (Item amount): 250,00
  • QUANTITY (Quantity): 3
  • PO_UNIT (Unit of measure): SU
  • SHEET_NO (Entry sheet number): 1000000022
  • SHEET_ITEM (Line number) : 10

First entry for service B:

  • INVOICE_DOC_ITEM (Invoice document item): 000003
  • PO_NUMBER (purchase order number): 4500000191
  • PO_ITEM (Purchase order item): 00010
  • TAX_CODE (Tax code): V1
  • ITEM_AMOUNT (Item amount): 350,00
  • QUANTITY (Quantity): 3
  • PO_UNIT (Unit of measure): SU
  • SHEET_NO (Entry sheet number): 1000000022
  • SHEET_ITEM (Line number) : 20

Second entry for service B:

  • INVOICE_DOC_ITEM (Invoice document item): 000004
  • PO_NUMBER (purchase order number): 4500000191
  • PO_ITEM (Purchase order item): 00010
  • TAX_CODE (Tax code): V1
  • ITEM_AMOUNT (Item amount): 350,00
  • QUANTITY (Quantity): 3
  • PO_UNIT (Unit of measure): SU
  • SHEET_NO (Entry sheet number): 1000000022
  • SHEET_ITEM (Line number) : 20

AccountingData table

First account assignment for service A:

  • INVOICE_DOC_ITEM (Document item in invoice document): 000001
  • SERIAL_NO (Serial number for the account assignment): 01
  • TAX_CODE (Tax code): V1
  • ITEM_AMOUNT (Amount in document currency): 250,00
  • QUANTITY (Quantity): 3
  • PO_UNIT (purchase order unit): SU

Second account assignment for service A:

  • INVOICE_DOC_ITEM (Document item in invoice document): 000002
  • SERIAL_NO (Serial number for the account assignment): 02
  • TAX_CODE (Tax code): V1
  • ITEM_AMOUNT (Amount in document currency): 250,00
  • QUANTITY (Quantity): 3
  • PO_UNIT (purchase order unit): SU

First account assignment for service B:

  • INVOICE_DOC_ITEM (Document item in invoice document): 000003
  • SERIAL_NO (Serial number for the account assignment): 01
  • TAX_CODE (Tax code): V1
  • ITEM_AMOUNT (Amount in document currency): 350,00
  • QUANTITY (Quantity): 3
  • PO_UNIT (purchase order unit): SU

Second account assignment for service B:

  • INVOICE_DOC_ITEM (Document item in invoice document): 000004
  • SERIAL_NO (Serial number for the account assignment): 03
  • TAX_CODE (Tax code): V1
  • ITEM_AMOUNT (Amount in document currency): 350,00
  • QUANTITY (Quantity): 3
  • PO_UNIT (purchase order unit): SU

For more information, see the parameter documentation for the tables HeaderData, , and .

Example: Incoming invoice for a one-time supplier

This example shows how to proceed in order to enter and post an invoice for a one-time supplier.

It is not necessary to populate the AddressData table. If you do not enter any data in the AddressData table, the address data for the one-time supplier from the purchase order is adopted 1:1 in the invoice.

If you use the AddressData table for the data transfer, the address data for the one-time supplier is read from the purchase order into the invoice and is then overwritten or supplemented by the fields in the AddressData table.

In the purchase order for the one-time supplier, the name is 'SAP AG', the postal code is '60000', and the street and building number are 'Neurottstrasse 16'. You receive an invoice with the one-time supplier address as follows: Name 'SAP AG', postal code '69190', and place 'Walldorf'. Enter the following data:

AddressData table

ACC_1_TIME (One-time supplier indicator): X

NAME (Name): SAP AG

POSTL_CODE (Postal code): 69190

CITY (Place): Walldorf

The invoice is posted with the following one-time supplier address data: Name 'SAP AG', street and building number 'Neurottstrasse 16', postal code '69190', place 'Walldorf'.

For more information, see the parameter documentation for the table AddressData.

Example: Incoming invoice for different payee

This example shows you which address data you must enter in the AddressData table in order to enter and post an invoice for a different payee.

You receive an invoice for the different payee with the name 'SAP AG', postal code '69190', place 'Walldorf', bank number '38070724', and account number '4711'. Enter the following data:

AddressData table

ACC_1_TIME (One-time supplier indicator): ' '

NAME (Name): SAP AG

POSTL_CODE (Postal code): 69190

CITY (Place): Walldorf

BANK_NO (Bank number): 38070724

BANK_ACCT (Bank account number): 4711

For more information, see the parameter documentation for table .

Example: Provisional invoice/differential invoice

For an example of how to create invoices within differential invoicing, see the documentation for function module (Invoice Verification: Post Incoming Invoice).

 

 

        



2018-05-25 整理於上海灘


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29829936/viewspace-2155153/,如需轉載,請註明出處,否則將追究法律責任。

相關文章