Purpose
The purpose of this page is to clarify the understanding of the program logic and requirements in relation to processing of Debit Memo document in different modes.
Overview
This article describes the behavior and logic of program J_1UNCREATE_EXT while processing of FI and SD Debit Memo documents in order to create Tax Invoices or Correction Tax Invoices.
Processing of Debit Memo in 'Based on FI Documents' or 'Based on SD Invoices' modes.
1. Debit Memos are processed as regular Invoices if any of following conditions are met:
a) Debit Memo document is created from FI;
b) Program is executed in ‘Based on FI Documents’ mode with active ‘Special Down Payment Processing’ option;
c) The program is executed in ‘Based on SD Invoices not released to FI’;
d) The program was not able to find an Invoice to which Debit Memo document is related;
e) The program was not able to compare prices in Debit Memo and Invoice.
2. Creation of Correction Tax Invoice based on Debit Memo can be performed only in ‘Based on FI Documents’ mode with inactive ‘Special Down Payment Processing’ option and if all following conditions are met (see SAP Note 1664184):
a) Option ‘Create Corrections for Debit Memos w/ Price Change’ is active;
b) Debit Memo FI document is created from SD (bkpf-awtyp = ‘VBRK’) and original SD document has SD document category ‘Debit Memo’ (vbrk-vbtyp = ‘P’);
c) All documents of related SD document chain exist in the system. (If SD and FI modules are divided between different systems Correction Tax Invoice based on Debit Memo cannot be created);
d) The program was able to find SD Invoice to which Debit Memo is related and the prices of Invoice items can be compared with prices of Debit Memo items;
e) Debit Memo document contains at least one item with Price correction;
f) For the found SD Invoice a Tax Invoice was already created or SD Invoice was released to FI and then Tax Invoice was created based on FI Invoice document (not based on clearing document);
g) Total amounts of SD ad FI Debit Memo documents are positive. Otherwise, the program can determine document as Credit Memo or show error message saying that it is not possible to determine document type.
h) All items of SD Debit Memo should be debit items. It is not allowed to combine lines decreasing and increasing Quantity or Price of Material in one document. Each item of Debit Memo should contain “delta” for which Price or Quantity of corresponding Invoice Item is increased. SD Debit Memos created from request with type “RK” are an exception. In such documents delivered Items to be corrected are completely subtracted and new Items completely replacing the corrected ones have positive sign. The amount for each “debited” item by absolute value should exceed amount of corresponding credited (“replaced”) Item. Each pair of “credited” and “debited” items should increase either Quantity (with the same Price) or Price (with the same amount) of delivered material. The cases with common change of Price and Quantity in one delivered Item cannot be correctly processed.
2.1 While processing of Debit Memo in Correction Tax Invoice creation mode Debit Memos are never combined with Invoices and require creation of separate Correction Tax Invoice.
2.2 To let the program correctly find the SD Invoice which Debit Memo is related to, Debit Memo, SD Debit Memo and SD Invoice should be placed in the document flow of the same Sales Order.
2.3 If SD Debit Memo is created with reference to Invoice, then program uniquely determines an Invoice and correspondence between Invoice and Memo Items by references from Debit Memo document.
2.4 If SD Debit Memo is created without a reference to an Invoice, then program will first find the closest Sales Order in the flow of documents created earlier than Debit Memo documents. Then in the document flow of the found Sales Order the program will find Invoices created earlier that processed Debit Memo. From the found Invoices it will select those which have the maximum number of Items related to the same Items of Sales Order which Debit Memo Items refer to. And from this selection the program will choose the Invoices with the latest creation date.
2.5 If SD Debit Memo is created without a reference to an Invoice but it has value in field Reference Document Number (VBRK-XBLNR), then program will check if this filed contains reference to an SD Invoice related to the same Sales Order as Debit Memo. If yes, then program will assume that Debit Memo was created to that Invoice. If not then check previous point.
2.6 If the program has found an Invoice and related Tax Invoice, then the program will compare Prices in SD Invoice and SD document of Debit Memo. If no items with Price change were found, then further processing of Debit Memo will be similar to processing of an Invoice. Correction Tax Invoice will not be created.
2.7 Correction Tax Invoice for Debit Memo with Price change will be created without indication of correction reason for the Items and will contain all Items of SD debit Memo document with the same data and Amounts. The items of SD Debit Memos created from request of type “RK” will be transformed into “Price delta” or “Quantity delta”: “credited” items will be deducted from corresponding “debited” Items.
Related Content
Related Documents
Value-Added Tax solution for Ukraine; SAP ERP, SAP S/4HANA
Creation of outgoing Tax Invoices: SAP ERP, SAP S/4HANA
Related SAP Notes/KBAs
SAP KBA 2332794: UA-FI: Debit/Credit memo creation and processing by J_1UNCREATE_EXT