Skip to Content
author's profile photo Former Member
Former Member

SD Billing: invoice splitting with different billing types

Hallo,

We’re facing an issue about invoice splitting. Customer requirements is: according to some item
characteristic a Sales Order with two items when invoiced must determine au tomatically two different billing documents of different type and different number ranges (Order-related Billing documents).

Example:

Sales Order Z1 with two
items: MAT1 and MAT2. Sales Order is related to Billing Type Z1

Item with MAT1 -->
billing type Z1 / number range 2200020020

Item with MAT2 -->
billing type Z2 / number range 3300020020

We are trying to reach this goal in the following way:

- implementation of exit
USEREXIT_FILL_VBRK_VBRP (RV60AFZC) : if vbrp-matnr = MAT2 then VBRK-FKART = Z2.

- implementation of a new
split routine in copy control.

- implementation of exit USEREXIT_NUMBER_RANGE_INV_DATE
(RV60AFZC): select from TVFK with VBRK-FKART = Z2 and retrieve TVFK-NUMKI

What do you think about this solution? Have you ever faced this issue?

Many thanks in advance,

Marco Sette

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Dec 05, 2013 at 03:48 PM
    according to some item characteristic a Sales Order with two items when invoiced must determine au tomatically two different billing documents

    What are those characteristics ? For information, we can force the system to split the billing with standard configuration itself. Straightaway, dont go for user exit. Explore the possibility to address through standard configuration itself.

    G. Lakshmipathi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Lakshmipathi Ganesan

      Hi G.

      once again thanks for your suggest: we checked both exits USEREXIT_NUMBER_RANGE in program RV60AFZZ and USEREXIT_NUMBER_RANGE_INV_DATE in program RV60AFZC. When we try to invoice a SO with two items we find that USEREXIT_NUMBER_RANGE is accessed only one time, while USEREXIT_NUMBER_RANGE_INV_DATE is accessed twice ( in general once for each item) so we'll try to use the second exit.

      Anyway, I thank you very much for your help.

      Marco

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2013 at 09:37 AM

    Hi,

    is there anyone who faced this issue?

    Thks

    Marco

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2013 at 12:18 PM

    Hi Marco,

    Why don't you copy and create a new routine (based on your requirement) and assign the same in your copy control settings.

    Regards

    Ankit

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Ankit,

      we are trying to do exactly what you suggest, copying an existent split routine and adding in it our rules to determine billing type and a split criteria.

      Still this thing isn't enough, because SAP can't determine the new number range.

      We had to solve this problem through user exit USEREXIT_NUMBER_RANGE_INV_DATE, where we explicitly find and assign the correct number range (from TVFK table) to our billing type.

      A similar solution seems to be implemented by SAP expecially for India: check out standard split routines 349 and 350. Our solution seems to work correctly, but we'd be more confident if someone else would have successfully faced and solved this issue.

      Thanks a lot, regards.

      Marco

  • author's profile photo Former Member
    Former Member
    Posted on Jan 02, 2014 at 11:57 AM

    Hi all, happy new year!

    During the implementation of the solution described above we're experimenting an episodic problem: sometimes, when we split invoices, the "standard" invoice type (that is linked to the sales order) shows a strange behavior: the sistem tries to assign a wrong number to the billing document, causing a rollback and an error business workplace document.

    When we check the last document number assigned into VN01 transaction we find that the last assigned number has been brought back to the first number. The system seems not to check last assignment number, trying to re-assign the first number of the range.

    Example:

    Sales Order Z1 with two
    items product codes: MAT1 and MAT2. Sales Order is related to Billing Type Z1

    Item with MAT1 -->
    billing type Z1 / number range 22000000 and last assignment number 22000036

    Item with MAT2 -->
    billing type Z2 / number range 33000000 (new)

    When we try to create the billing documents we receive the error: ABAP Processor: SAPSQL_ARRAY_INSERT_DUPREC

    Checking out into VN01 we find that number range 22000000 last assignment is 22000001.

    If we manually change last assignment up to 22000036 and try again to invoice the sales order, the error doesn't occur anymore and we obtain invoice documents Z1 (number 22000037) and Z2 (33000001).

    In transaction SNRO the object type RV_BELEG is not buffered.

    Any idea about that?

    Thanks,

    Marco

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.