cancel
Showing results for 
Search instead for 
Did you mean: 

Invoice split due to Header data.

Former Member
0 Kudos

Hi Friends,

I have a requirement that invoice are spliting into two...and i have to stop that spliting and all items should be in one invoice...

I have two routines 601 and 602.

In routine 601 --one of the item is storing and creating the new invoice.

Billing type -F2

Delivery type -LF

item category - ZICV

In routine 602-all the remaining items are stored.

Billing type -F2

Delivery type -LF

item category - ZTH1...

Can some help me regarding this;;

Edited by: vansri$99 on Oct 5, 2011 10:33 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Try to check how vbrk-zukri is filled

Max

Answers (1)

Answers (1)

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

First of all, see SAP Note 11162 - Invoice split criteria in billing document. After, as Max suggests you, try to populate the field ZUKRI in table VBRK. For this purpose, create in each VOFM a structure called ZUK with the fields. Remember that the concatenation of fields defines the value of ZUKRI up to 40 characters, and different values for ZUKRI is a different billing document. See for instance, the subroutine 351 as a template (include FV60C351).

I hope this helps you

Regards

Eduardo

Former Member
0 Kudos

Thanks you Max and Hinojosa for your quick reply.

The answer was really helpful.

I have couple of questionS:

1.I am unable to debug the routines 601 and 602.I have set the break point in the routines and staRted executing the VL03 but the routine is not triggeing in debuging mode...Am i doing the beduging correct?

2.The routine 601 has the Dien material item and routine 602 has the reamining items..so I am trying to add the logic in the routine 602..

In routine 602 they have passed the spart,vtweg,vgbel to the structure ZUK3 and then passed to VBAK-ZURKI.

So do i need to add the logic in the routine 602?

3.The Dien material has a Different Iten category ZTH1 and all remaining items has ZCV1.Does the Dien materials has the same Item Caterory.If yes, Can i add the

CASE KNA1-KATR10,

WHEN 'ZZ2'

ZUk3-PSTYV= VBRP-PSYV,

VBAK-ZURKI = ZUK3.

END CASE.

Former Member
0 Kudos

1.I am unable to debug the routines 601 and 602.I have set the break point in the routines and staRted executing the VL03 but the routine is not triggeing in debuging mode...Am i doing the beduging correct?

Those routine are triggered while creating bill, so transaction vf01 or vf04.

2.The routine 601 has the Dien material item and routine 602 has the reamining items..so I am trying to add the logic in the routine 602..

In routine 602 they have passed the spart,vtweg,vgbel to the structure ZUK3 and then passed to VBAK-ZURKI.

So do i need to add the logic in the routine 602?

I suppose you mean VBRK-ZUKRI, not VBAK-ZUKRI.

That mean it's created a bill for only one delivery (VGBEL):

It depends on how the routines are called, if those routines are always called, it's better to manage the split logic in a routine only, because it's a header data, so it's better to manage it centrally.

If it's called 602 or 603, you need to repeat that logic in both routine,

So it's depends on if the bill can alwyas have at least one item of category ZTH1

3.The Dien material has a Different Iten category ZTH1 and all remaining items has ZCV1.Does the Dien materials has the same Item Caterory.If yes, Can i add the 
CASE KNA1-KATR10,
WHEN 'ZZ2'
ZUk3-PSTYV= VBRP-PSYV, 
VBAK-ZURKI = ZUK3.
END CASE.

That mean if a delivery has item of category ZTH1 and ZCV1, and KNA1-KATR10 is equalt to ZZZ you'll create 2 bills:

one for items ZTH1

one for items ZCV1

If you need to do it, yes you can do it, but in this case you need to place the logic above in both routines: they are assigned in copy routines to item category, so I suppose ZCV1 triggers 602 and ZTH1 triigers 603 (see VOFM transacation)

Max

Former Member
0 Kudos

Hi MAx,

In VOFM, the item Caterory ZICV IS routine 602

the item Caterory ZTH1 IS routine 601

can we chage the routine 602 to 601.

Former Member
0 Kudos

Hi

Yes if you need to avoid the split of yhe invoices you need to change theose routine in order they set the same data in VBRK

Max

Former Member
0 Kudos

Hi Max,

thank for you reply.

But one of my OM Consultant not willing to change the routine..so we adding the adding logic to that routine 601....

1. Under the functionality where u2018ZZ1u2019 and u2018ZZ2u2019 customers exist, (If code doesnu2019t exist add)

If CTO order (I.E.if vbrp-augru_auft = '915'

or vbrp-augru_auft = '916')

if higher-level item > 0 (i.e. vbrp-uepos)

2. Include Code

Read copy control routine, using the item category from the base product number (I.E. UEPOS item #), in the CTO configuration from table, TVCPF by the delivery type, billing type, and item category. The fields are as follows:

FKARN = Billing type (i.e. F2)

LFARV = Delivery type (i.e. LF)

PSTYV = item category (i.e. ZICV)

GRURP = routine for copy controls (i.e. 602)

3. ZUK2 or ZUK1- MODUL = TVCPF-GRURP u2013 Code to add after the include

I am not under standing the secondpoint ...can you help me in this regard. I have written the below code:

DATA: BEGIN OF ZUK2,

FKARN LIKE TVCPF-FKARN, "Billing type

LFARV LIKE TVCPF-LFARV, "Delivery type

PSTYV LIKE TVCPF-PSTYV, "Item category

GRURP LIKE TVCPF-GRURP, "Data transfer VBRK/VBRP

END OF ZUK2.

SELECT FKARN LFARV PSTYV GRURP FROM TVCPF INTO TABLE ZUK2 WHERE PSTYV EQ VBAP-PSTYV.