05-20-2014 1:21 PM
Good Morning,
First of all, let me tell you i've started doing some ABAP development last week, so i have a lot of things to yet understand.
I received a request to implement a change in the creation of a billing document.
Context:
I have a order - Order 132098723 - with the following header data:
VBAK-VBELN = 0132098723
VBAK-VBTYP = C
VBAK-AUART = ZCV
VBAK-VKORG = 0100
VBAK-VTWEG = T1
VBAK-SPART = 00
VBAK-KNUMV = 0000223615
VBAK-FKARA = ZF3
VBAK-KUNNR = 0010135306
VBAK-TAXK1 = <empty>
VBAK-TAXK2 = <empty>
VBAK-TAXK3 = <empty>
VBAK-TAXK4 = <empty>
VBAK-TAXK5 = <empty>
VBAK-STCEG_L = <empty>
VBAK-LANDTX = <empty>
The items for this Order - Order 132098723 are:
Item | Material | Order Quantity | Un | Description | ItCa | ... |
---|---|---|---|---|---|---|
10 | 0,000 | ZATX | ||||
20 | 1400008183 | 1 | UN | <Description> | ZTAS |
I have a delivery - Delivery 811128713 - with the following header data:
LIKP-VBELN = 0811128713
LIKP-VBTYP = J
LIKP-KUNNR = 0000223615
LIKP-FKARV = ZF3
The items for this Delivery - Delivery 811128713 are:
Item | Material | Delivery. Qty | Un | Description | ItCa | ... |
---|---|---|---|---|---|---|
10 | 1400008183 | 1 | UN | <Description> | ZTAS |
A copy control was created in transaction VTFA - Sales to Billing Document:
Header
Tgt Billing Type Source SalesDoc Type
ZF3 Invoice ZCV Standard Order
Copy Requirements 001 Header/order-related
Determ.export data <empty>
Assignment Number E
Reference number A
Copy item number checked
Item
Target Billing Type ZF3 Invoice
From SalesDoc Type ZCV Standard Order
ItmCt Description
TAD Invoice
ZATX Text Item
ZSCV <Description>
ZTAD <Description>
Step by Step of the process:
I call transaction VF01 and i input two docs to be processed:
132098723 - Order
811128713 - Delivery
Before i Execute i will do a Billing Document Overview (F5) and in the Billing Document Overview two invoices are generated:
Invoice - <Name> - <Net_Value>
Invoice - <Name> -<Net_Value>
THE PROBLEM:
INSTEAD OF TWO INVOICES, ONLY ONE INVOICE SHOULD BE GENERATED. When i do a split analysis the system informs me that the reason for the split is happening because of different header data:
Fld Name | $000000001 | $000000002 |
---|---|---|
Tax classification 1 for customer (TAXK1) | 1 | |
Tax classification 2 for customer (TAXK2) | 1 | |
Tax classification 3 for customer (TAXK3) | 1 | |
Tax Classification 4 Customer (TAXK4) | 1 | |
Tax classification 5 for customer (TAXK5) | 0 | |
Tax departure country | PT |
I've spoken with my colleague who requested the correction of this and he told me that what he wants is that, in this case, only one invoice should be created.
He also told me that in this case only happens when a item with category ZATX exists in the Order (in this case item category ZATX exists in the first item of Order 132098723).
Debugging, i've found out that the reason for the split is that in program SAPLV60A, in include LV60AA95, form VBRK_VBRP_DATENTRANSPORT, the VBRK-TAXK* values are populated with values from KURGV-TAXK* and VBRK-STCEG_L is populated with values from KURGV-LAND1 or KURGV-STCEG_L (conditional). The problem is that the program goes through the section of code where KURGV is changed twice (as far as i've understood it's related with the fact that there are two items in the Order 1320987239 and on the first pass the KURGV-TAXK* and KURGV-LAND1 are empty, and in the second they have values and i think that's why the split occurs.
I'm also attaching a document with screenshots of the debug which i think they can help.
Please let me know if you need specific information.
Can you please help me in finding how can i prevent this split to occur?
All help is welcome
Best Regards,
Pedro Gaspar
05-21-2014 9:13 AM
Hola Pedro
First of all, see SAP Note 11162 - Invoice split criteria in billing document as a checklist.
Second, look for posts in this site with the string or keyword ZUKRI or ZUK. The question is populate the field ZUKRI and force the split according this field. It could be made with a custom VOFM subruoutine, taking any standard as a template.
f you are using values from SO and delivery for populating values in VBRK and VBRP, populate them in SO, doing them mandatories (incomplete schemes,...) or populating data in master data (material, partners,...).
I hope this helps you
Regards
Eduardo