Ansicht
Dokumentation

BAPI_INCOMINGINVOICE_CHANGE - Invoice Verification: Change Provisional Invoice

BAPI_INCOMINGINVOICE_CHANGE - Invoice Verification: Change Provisional Invoice

CL_GUI_FRONTEND_SERVICES - Frontend Services   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

You can use this method to change provisional invoice documents. Provisional invoice documents have the status:

  • 'On hold' or
  • 'On hold (from parking)' or
  • 'Parked' or
  • 'Parked as complete' or
  • 'Parked and released'

With regard to the reference document categories referenced by an invoice, this method offers the following functionality:

  • If you do not change any items in an invoice document, the system retains the originally chosen reference to a document category.
  • If you change items in an invoice document, in other words if you supply the method with information via the Itemdata table, the system takes the purchase order as the reference document category.

For the transactions Provisional Invoice/Differential Invoice and Final Invoice, you can use this method to change the invoice items. The transaction itself (INV_TRAN field) remains unchanged.

Constraints

It is not possible to use this method to change invoice documents flagged for invoice verification in the background. Nor is it possible to use this method to change invoice documents saved within the framework of the EDI process.

Example

Notes

The system checks the authorization objects M_RECH_WRK and M_RECH_BUK for the invoice document to be changed. For documents from the parking environment the system checks Activity 77; for documents on hold from the invoice entry environment the system checks Activity 02.

If you add further items to an invoice, the system checks activity 77 (documents from parking) or 01 (documents from invoice entry) for these items.

Input parameters

  • Invoice document
Using the Invoicedocnumber and Fiscalyear parameters you specify which invoice document is to be changed.
  • Status of the invoice document
The InvoiceDocStatus parameter contains the status of the changed document.
  • Header data
Using the HeaderdataChange parameter you specify the invoice header data that you want to be changed. In the HeaderdataChangex parameter, you specify which information is to be changed.
  • Address data
Using the AdressdataChange parameter you specify the invoice address that you want to change. Using the AdressdataChangex parameter, you specify which information in the address you want to change.
  • Item data.
The tables Itemdata and Accountingdata contain the item data of the changed invoice. Unlike with the header data, here you need to describe all the items of the changed document. It is not possible to only transfer the data that needs changing. Using the TableChange parameter and the ITEMDATA field you indicate that item data has changed.
For invoices relating to a transportation management system, instead of the Itemdata table, you can use the TM_ITEMDATA table (Transfer Structure Item Data Incoming Invoice for Transportation Management).
  • Posting to G/L account, material account, or asset
Using the Glaccountdata table you can change the data for posting to a G/L account. The Materialdata table contains data that displays changes when you post to material accounts. The Assetdata table contains the data for posting changes to an asset. Here too, it is necessary to describe the postings of the changed documents in full. The fields GLACCOUNTDATA, MATERIALDATA, and ASSETDATA in the Table_Change parameter show that data has changed.
  • Tax information
The Taxdata table describes the tax information in the changed invoice. The data of the changed incoming invoice must be passed on in full. You can identify a change using the TableChange parameter and the TAXDATA field.
  • Withholding tax information
To change the information regarding the withholding tax in an invoice document, you can use the parameter Withtaxdata. Via this parameter, you must specify all data of the changed document. The TableChange parameter, WITHTAXDATA field, enables you to display a change.
  • Amount split
Via the Vendoritemsplitdata table, you can change the distribution of the gross amount across several creditor lines. As already described in the case of previous parameters, here too you must describe the data of the changed document in full. It is not enough to pass on only the information that has changed. The TableChange parameter contains the VENDORITEMSPLIT field, which can be used to display changes.

Output parameters

If changing the posting date or the document type necessitates the assignment of a new document number, the provisional invoice document is created with the previous data under a new document number and - if the fiscal year is changed - under a new fiscal year. The previous invoice document is deleted.

The method returns the new document number and the new fiscal year in the parameters InvoicedocnumberNew and FiscalyearNew.

Return messages

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

Further information

The method can only perform its function if no error messages were generated in the Return table. This is the case if it was possible to process the header data and all items without errors.

No transaction control is implemented. This means that, if the method has been called successfully and no errors are shown in the Return parameter, the user calling the method must perform the 'Commit Work' him- or herself.

Note:
If an invoice document parked as complete is again to be parked as complete in a new fiscal year, or a change in the document type necessitates the assignment of a new document number, the system creates a new document and deletes the old one. In the process, a document parked as complete is simply parked in an initial step before finally being converted to the 'parked as complete' status in a second step. To be able to carry out the second step, the system uses a 'Commit Work' program-internally after the first step.

Example: Change of posting date in a provisional invoice document

This example shows which data you must enter in the parameters InvoiceDocNumber, FiscalYear, HeaderdataChange, and HeaderdataChangex in order to change the posting date of a provisional invoice document.

In 2004 you parked invoice 5105601000/2004. This contains one item. You want to give the invoice a new posting date from the year 2005 without changing the item.

Parameter InvoiceDocNumber

  • (invoice document number): 5105601000

Parameter FiscalYear

  • (fiscal year): 2004

Parameter HeaderdataChange

  • PSTNG_DATE (Posting date): 12.05.2005

Parameter HeaderdataChangex

  • PSTNG_DATE (Posting date): X

You do not have to transfer the Itemdata table. In this case the system adopts the invoice items unchanged from the document to be changed.

Due to the changed fiscal year, the old document is deleted and a new invoice document is created with the old data. The method returns the document number and the fiscal year in the fields InvoicedocnumberNew and FiscalyearNew.

Example: Adding a further item to a provisional invoice document

This example shows which data you must enter in the parameters InvoiceDocNumber, FiscalYear, HeaderdataChange, and HeaderdataChangex in order to be able to add another item to a provisional invoice document. Furthermore, it describes which item data is entered in the Itemdata table and which information you have to enter in the TableChange parameter.

You have parked the invoice document 5105600011/2005. This invoice contains one item referencing purchase order 4500000100, item 10. The invoice quantity amounts to 10 pc, the value is 100 EUR. You now want to add a second item referencing PO no. 4500000101, item 10. The quantity invoiced for this item is 5 pc, the value being 50 EUR. For both items, value-added tax of 16% applies.

Parameter InvoiceDocNumber

  • (invoice document number): 5105600011

Parameter FiscalYear

  • (fiscal year): 2005

Parameter HeaderdataChange

  • GROSS_AMOUNT (Gross amount): 174,00

Parameter HeaderdataChangex

  • GROSS_AMOUNT (Gross amount): X

Parameter TableChange

  • ITEMDATA (item data): X

Parameter Itemdata

Line 1: Previous invoice item

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

Line 2: Add further invoice item

  • INVOICE_DOC_ITEM (Invoice document item): 00002
  • PO_NUMBER (purchase order number): 4500000101
  • PO_ITEM (Purchase order item): 00010
  • TAX_CODE (Tax code): V1
  • ITEM_AMOUNT (Item amount): 50
  • QUANTITY (quantity): 5
  • PO_UNIT (Unit of measure): pc

Further information is available in the parameter documentation for tableItemData.

Example: Adding an unplanned account assignment to a provisional invoice document

This example indicates which data you have to enter for the parameters InvoiceDocNumber and FiscalYear, which item data you have to enter for the Itemdata table, and which account assignment data you have to enter for the table Accountingdata. Furthermore, it describes which information you have to enter for the parameter TableChange in order to be able to add unplanned account assignments to a provisional invoice document. In order for you to be able to add account assignments, provision must have been made for non-valuated or no goods receipt.

You have parked the invoice document 5105600012/2005. This contains an item relating to purchase order 4500000110, item 10. The purchase order item has a single account assignment. You want to apportion the invoice amount of 100 EUR for 10 pc to the planned account assignment and one other account assignment. 16% VAT is payable.

Parameter InvoiceDocNumber

  • (invoice document number): 5105600012

Parameter FiscalYear

  • (fiscal year): 2005

Parameter TableChange

  • ITEMDATA (item data): X

Parameter Itemdata

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

Parameter Accoutingdata

Line 1: Change planned account assignment item

  • INVOICE_DOC_ITEM (Document item in invoice document): 0001
  • SERIAL_NO (Serial number for the account assignment): 01
  • TAX_CODE (Tax code): V1
  • ITEM_AMOUNT (Amount in document currency): 60,00
  • QUANTITY (quantity): 6
  • 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): V1
  • ITEM_AMOUNT (amount in document currency): 40,00
  • QUANTITY (quantity): 4
  • PO_UNIT (purchase order unit): pc
  • GL_ACCOUNT (G/L account number): 891000
  • COSTCENTER (cost center): 1300

Further information is available in the parameter documentation for the tables ItemData and AccountingData.





Parameters

/AFS/ITEMDATA
ACCOUNTINGDATA
ADRESSDATA_CHANGE
ADRESSDATA_CHANGEX
ASSETDATA
EXTENSIONIN
FISCALYEAR
FISCALYEAR_NEW
GLACCOUNTDATA
HEADERDATA_CHANGE
HEADERDATA_CHANGEX
INVOICEDOCNUMBER
INVOICEDOCNUMBER_NEW
INVOICE_DOC_STATUS
ITEMDATA
MATERIALDATA
RETURN
TABLE_CHANGE
TAXDATA
TM_ITEMDATA
VENDORITEMSPLITDATA
WITHTAXDATA

Exceptions

Function Group

MRM_BAPI

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.

Length: 18826 Date: 20240523 Time: 115801     sap01-206 ( 262 ms )