cancel
Showing results for 
Search instead for 
Did you mean: 

Invoice Splitting - for some shipping points and not others

Former Member
0 Kudos

Dear Gurus, I have a requirement where for some shipping points I need to be able to split an invoice on sales order (i.e. a separate invoice for each customer order) and for other shipping points I require a single invoice for multiple customer sales orders. Using the copy control rules for LF to F2, I have set the Refence Number to B but this does not achieve what I want. Would it be possible to achieve this via a copy requirements routine and by setting the values in VBRK-ZUKI? Do I just copy the standard 003 routine and apply my changes here? If yes, where do I insert the code - the top or bottom? Regards

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

In VOFM, first of all "Copying requirements" are used when we want to stop creating a target document from a source document or to prevent certain items from copying to target document under certain conditions. Copying requirements can't be used to do invoice split.

Data transfer routines are the ones that allow invoice split (in addition to allowing copying fields from source to target). Although "copying requirements" is a loosely used terminology, it is important we make distinction between copying requirements and data transfer routines as both are different and perform different functions.

SAP uses field VBRK-ZUKRI (a 40 character field) to store the combination of field values that are used as basis of invoice split. Invoice split happens if any of the fields stored in VBRK-ZUKRI differ across orders/deliveries (or their items) from which invoices are created.

We assign VBRK-ZUKRI during item copy control in data transfer routines. The fields are simply concatenated and assigned to VBRK-ZUKRI.

in VOFM, "Data transfer" routine 003 for Billing documents for example splits the invoice for each reference document, as shown by code below

Include FV60C003

*---------------------------------------------------------------------*
*       For each reference document an invoice is created
*---------------------------------------------------------------------*
FORM DATEN_KOPIEREN_003.
  DATA: BEGIN OF ZUK,
          MODUL(3) VALUE '003',
          VTWEG LIKE VBAK-VTWEG,
          SPART LIKE VBAK-SPART,
          VGBEL LIKE VBRP-VGBEL,
        END OF ZUK.
  ZUK-VTWEG = VBAK-VTWEG.
  ZUK-SPART = VBAK-SPART.
  IF KURGV-PERFK = SPACE.
    ZUK-VGBEL = VBRP-VGBEL.
  ENDIF.
  VBRK-ZUKRI = ZUK.
ENDFORM.

In the above coding we are concatenating VBAK-VTWEG (Distr channel), VBAK-SPART (Division), VBRP-VGBEL (Reference Order from billing item) as the criteria for invoice split. So if any of these field differ then it will cause a split. So basically we are creating one invoice for all items that reference a single order

So what you need to do for your requirement, is to copy the logic of data transfer routine 003 in VOFM to your own custom 9XX routine and make the assignment to ZUK / VBRK-ZUKRI only when shipping point (LIKP-VSTEL) is not equal to certain values that you don't want split to happen. It is better to maintain those shipping points in a custom table and make the check on the table rather than hard coding, so that in future it is easy to add more shipping points or remove existing ones if needed.

Also remember to assign the new data transfer routine number 9XX to all relevant item categories in VTFL for your target billing type and reference delivery type

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

It can be done by adding simple logic to ZUKRI field. Ask Abaper to write in the following fashion.

If (Shipping point= shipping points that you want to create single invoice)

Do not add anything to ZUKRI field.

Else

Add shipping point to the ZUKRI field. So that invoice is splitted automatically.

This way you can satisfy your requirement.

Regards

Ashok

former_member217082
Active Contributor
0 Kudos

Hi

For your requirement you have to include a new logic and assign it in the copying requirements in VTFL copy control.Copy the standard copying requirements 003 to 901 and in 901 requirement you have to include the logic that for only those shipping points invoice split should take place.So you need to interact with your ABAP team and you have to give the input feilds ,logic to your ABAP team. Dont change the standard copying requirements 003 as it might can be used for other process.

Regards

Srinath

eduardo_hinojosa
Active Contributor
0 Kudos

Hi Jacqueline,

You need create your own subroutine VOFM with your algorithm to populate the field VBRK-ZUKRI and set it in your copy rules. Remember that the field is for 40 char, so, define ZUK up to 40 char. See Note 327220 - VOFM function and its objects for a further information.

I hope this helps you

Regards

Eduardo