‎2008 May 01 3:31 PM
Hi all,
This is my requirement. We are trying to consolidate two sales orders using the transaction VF01. The two orders exactly alike except for one partner function 'ZU' at the header level. The invoice can be split for any other partner function but not for this ZU . We need to find a user exit which does this job for me . Can anyone please help me find that.
Awaiting your responses.
Thanks,
Varun.
‎2008 May 01 3:39 PM
You need to do it by the data transfer routine in Copy Control for the billling document.
E.g you can crating F2 invoices from LF deliveries. Than you need to replace the existing data transfer routine with your custom routine which will allow you to avoid the split.
VBRK-ZUKRI is the field which will decide for the splitting criteria.
You can pass anything splitting criteria in this field. E.g. VKORG, VTWEG, KUNNR. So, it will create only one invoice for one customer in one invoice run.
Like:
VBRK-ZUKRI+0(4) = VBAK-VKORG.
VBRK-ZUKRI+4(2) = VBAK-VTWEG.
VBRK-KUNNR+6(10) = VBAK-KUNNR.
Regards,
Naimesh Patel
‎2008 May 01 3:39 PM
You need to do it by the data transfer routine in Copy Control for the billling document.
E.g you can crating F2 invoices from LF deliveries. Than you need to replace the existing data transfer routine with your custom routine which will allow you to avoid the split.
VBRK-ZUKRI is the field which will decide for the splitting criteria.
You can pass anything splitting criteria in this field. E.g. VKORG, VTWEG, KUNNR. So, it will create only one invoice for one customer in one invoice run.
Like:
VBRK-ZUKRI+0(4) = VBAK-VKORG.
VBRK-ZUKRI+4(2) = VBAK-VTWEG.
VBRK-KUNNR+6(10) = VBAK-KUNNR.
Regards,
Naimesh Patel
‎2008 May 01 3:46 PM
Naimesh,
Thanks for the response. But I am not clear with the code you have pasted. Can you please explain a little on how the code will be developed. My requirement here is to create a consolidated invoice using sales orders.
Should I go for copy routines or data transfer routines?
Thanks,
Varun.
‎2008 May 01 4:06 PM
Data transfer routine in Copy Control.
Go to Transaction VTFA.
Here you can select the Source order type and target billing doc type.
Select Items on left.
Select the item category.
Double click on the item will take you to the Item of that item category.
Here, you have to replace the Data VBRK/VBRP data transfer routine.
Now, to create a new routine you can go to VOFM
Select Data transfer > Billing
Here you can create a new routine (starting form 600) by copying the most relevent exsiting routine.
You need to have a access key for that object.
Be careful, when you change this kind of routines.
Regards,
Naimesh Patel
‎2008 May 01 4:14 PM
Naimesh,
Thanks a lot for the detailed description.
Is there a way for us to find out in the code of VF01 where this split is exactly determined ?
Also by doing this data transfer thing do we have this ZU partner in the final invoice or do we loose any data ?
Thanks,
Varun.
‎2008 May 01 4:51 PM
First you need to find out the called data transfer routine as I described in my earlier reply.
Set a breakpoint in that data transfer routine.
Now, in debug you can change the value of the field VBRK-ZUKRI and check what happens.
Regards,
Naimesh Patel
‎2008 May 01 5:28 PM
Naimesh,
I went in the debug mode and changed the value of vbrk-zukri ,
when ever this routine is riggered , but It still came up with the split.
Thanks,
Varun.
‎2008 May 02 10:22 PM
Naimesh,
Thanks a lot for your support and ideas. I solved the problem.
This is something we cannot resolve with copy routine or data transfer routine. This has been solved using an implicit enhancement in the include LV60AB14 (we are on ECC 6.0). But you have been helping me many a times over a period of 2 years. I am very thankful to you.
Thanks,
Varun.
‎2013 Jun 17 9:06 PM
Hi!!
I have a similar case to the one you've posted.
I found out that indeed the only way to solve it if modifying LV60AB14.
However, I have not found a way to make any modifications to the program named above.
How did you work around on this issue??
Kind regards,
Gabmillan10
‎2008 May 06 8:41 AM
Hi Varun,
Your problem is solved using an implicit enhancement in the include LV60AB14.
But, our requirement is to make combined invoice, evenif different Partners are there for PARVW = 'ZZ', with different SOs of same Customer/Payer.
When I am tried to use include LV60AB14, I cleared the flag 'UNGLEICH'. Due to this combined invoice gets created but Parner Number is overwritten for ZZ. So, data is lost.
How can I solve this? Could you please guid me?
Thanks in advance.
Best Regards,
Prasad
‎2008 May 06 2:31 PM
Prasad,
Don't clear the flag there. Even my requirement is exactly simlar to your's.Try to out in this piece of the code and see if it works for you. This is what I have in my implicit enhancement.
SY-SUBRC is the one which plays a key role there not the value of UNGLEICH.
CONSTANTS : c_parvw LIKE vbpa-parvw VALUE 'ZZ'.
IF sy-subrc = 4.
IF xvbpa-parvw = c_parvw OR
xvbpak-parvw = c_parvw .
sy-subrc = 0.
ENDIF.
ENDIF.
My opinion is this should work for you. Please revert back if you were able to solve tis problem.
Thanks,
Varun.
Edited by: varun sonu on May 6, 2008 3:32 PM
Edited by: varun sonu on May 6, 2008 3:33 PM
‎2010 Aug 27 8:57 AM
Dear Varun,
I also have the requirement and i did as you suggested, split is avoided but when we look at the partner in the items all the partner of partner function(ZZ) became same, can you help please explain how to avoid this?
Kind regards,
Sujith
‎2010 Aug 27 8:58 AM
Prasad,
I also have the similiar as yours, did you get the solution for this, if so, can you please explain how to fix this
Kind regards,
Sujith