There can be a business scenario where a company can be selling, to one customer, diverse products from different Plants assigned to different Company Codes. In such scenarios, more than one intercompany invoice will have to be generated. This will help the business to act as a single entity to the customer selling diverse products instead of forcing the customer to send separate orders for products belonging to different Plant/Company Code combination. Standard SAP allows for only one intercompany invoice to be created from one delivery but, as per this requirement, more than one intercompany invoice will have to created from one delivery.
Intercompany Invoices are generated whenever an order is placed for materials belonging to a Plant that is assigned to a Company Code that is different from the Company Code to which the customer is linked to.
Sales Order –> Delivery –> Invoice –> Intercompany Invoice
Enterprise Structure Setup:
Plant to company code set-up:
- Plant PL01 to Company Code CC01
- Plant PL02 to Company Code CC02
- Plant PL03 to Company Code CC03
Sales Org to Plant Set-up:
Customer is created for the Sales Org SO01 and Company Code CC01 and can place orders for materials belonging to all Plants in a single order.
- Sales Org SO01 to Plant PL01
- Sales Org SO01 to Plant PL02
- Sales Org SO01 to Plant PL03
Sales Org to Company Code Set up:
- Sales Org SO01 to Company Code CC01 (Customer Sales Org and Company Code)
- Sales Org SO02 to Company Code CC02 (Intercompany Sales Org and Company Code)
- Sales Org SO03 to Company Code CC03 (Intercompany Sales Org and Company Code)
Customer is created for the Sales Org SO01 and Company Code CC01 and can place orders for materials belonging to all 3 Plants in a single order.
To achieve the requirement of creating multiple intercompany invoices from one delivery, we need to make the following 2 changes to the existing process:
- Create additional entry in VKDFS table (for Intercompany – IV billing type) at the time of customer invoice creation
- Modify the Sales Org selected during intercompany invoice creation so that the materials belonging to Plant PL02 are billed for SO02 and materials belonging to Plant PL03 are billed for SO03
VKDFS Entry Creation:
For the system to create 2 intercompany invoices, we need to have 2 entries in the VKDFS table for both the Sales Orgs of the plants PL02 (SO02) and PL03 (SO03). The VKDFS entry to create the intercompany invoices is created once the F2 customer invoice is created for the delivery.
One entry is created automatically by SAP based on the Sales Org of the first intercompany billing relevant material present in the delivery. This can be that of either SO02 or SO03 and this value is filled in the Delivery header table LIKP-VKOIV.
Compare the sales orgs of the plants for the materials in the delivery that are relevant for intercompany billing and have not yet been completely processed (the Plant to Sales Org link can be selected from the table T001W by providing the plant as input). For these sales orgs, check if a relevant entry is already present in the VKDFS table. If an entry is not present, then add a new entry with that sales org into the VKDFS table with the relevant details (the existing entry can be used as a reference).
This change can be made in the user exit V05IEXIT.
The additional entries that are created in the VKDFS table will not be cleared automatically by the system. To delete these entries, the standard program RVV05IVB can be run by providing the delivery numbers as input and selecting that the Billing Index needs to be reorganized.
VBRK Sales Org Modification:
During the intercompany invoice creation, the Sales Org value for the field VBRK-VKORG is selected from the delivery header (LIKP-VKOIV). As LIKP-VKOIV is populated based on the first material relevant for intercompany invoice, this must be modified so that the sales org of the plant for the materials in the delivery that are relevant for intercompany billing and have not yet been completely processed is assigned to VBRK-VKORG. E.g. if a delivery of SO01 has first intercompany invoice relevant material belonging to plant PL03 and second intercompany invoice relevant material belonging to plant PL02, then LIKP-VKOIV = SO03. This value is always copied to VBRK-VKORG during intercompany invoice creation and so this needs to be modified to SO02 when creating intercompany invoices for SO02.
During manual creation of intercompany invoices, invoice split should occur and the intercompany invoices will be created for both the Sales Orgs.
If the intercompany invoice is created through a batch job, then invoice consolidation process needs to be done. So the value for the intercompany invoice sales org VBRK-VKORG needs to be selected from the Sales Org present in the selection screen of the program. This assignment will ensure that the invoice will be created only for the Sales Org present in the batch job and no invoice split process occurs. In addition to that, the value for LIKP-VKOIV that is selected in the program structure also needs to be modified to that of the Sales Org present in the selection screen so that the consolidated invoice is created only for the specified Sales Org and not for both SO02 and SO03.
Prior to making the change, check if the invoice type is ‘5’ or ‘6’ (Intercompany Invoice or Intercompany Credit Invoice). All the modifications mentioned to the table fields must be done only at the internal table level selected in the program and not the actual table entry.
This change can be made in the exit RV60AFZC.