cancel
Showing results for 
Search instead for 
Did you mean: 

Invoice splitting

rey_miranda
Explorer
0 Kudos

Hi guys.

How can I check config how the system splits the invoice?

Our users process invoice per company, all customers in one go.

Our business user reported that a specific invoice should have been split into 2 immediate invoices with consecutive invoice numbers, but apparently the second invoice got assigned an invoice number ex invoice 1, then the second one is invoice 18.

Can something be done to split them into two invoices with consecutive number range?

I suddenly remember that our number ranges are buffered. Can this be one factor to consider?

Thanks for your time.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi

It is true that when number range buffering is used you cannot guarantee the numbers assigned are done so sequentially.

However perhaps the order in which SDBILLDL is processing the billing due entries from VKDFS
is a factor ? The sorting of the internal table is carried out in function module SD_COLLECTIVE_RUN_EXECUTE so you check you example and if required drive the sorting and the order in which the VKDFS entries are processed in the collective billing run.

You can see it here in running VF04

function module SD_COLLECTIVE_RUN_EXECUTE
...
MAX_DOCUMENTS = 1000.
  CALL CUSTOMER-FUNCTION '009' (EXIT_SAPLV60P_009)

...
  SORT V60P_INPUT_VKDFIF BY KUNNR VKORG V_FKART V_FKDAT SORTKRI
                            FKDAT FKART VBELN.

  CALL CUSTOMER-FUNCTION '010' (EXIT_SAPLV60P_010)
       TABLES
            CT_VKDFIF = V60P_INPUT_VKDFIF

...  
LOOP AT V60P_INPUT_VKDFIF WHERE SELKZ NE SPACE.
    ON CHANGE OF V60P_INPUT_VKDFIF-KUNNR OR
                 V60P_INPUT_VKDFIF-VKORG OR
                 V60P_INPUT_VKDFIF-V_FKART.
      IF COUNTER > 0.
        CLEAR SY-CALLD.
        DELETE ADJACENT DUPLICATES FROM XKOMFK.
        PERFORM RV_INVOICE_CREATE                  >>>>

If you are billing many entries for the same customer at the same time a billing split can be caused by the MAX_DOCUMENTS parameter. For example there are 1030 due entries in VKDFS for the same customer, billing type and billing date. The system would create 2 billing document one with 1000 items and one with 30. Not sure if this is a factor in your case.

The question for your case is were the documents with numbers 1 and 18 processed one after the other in this LOOP. If they were and the numbers were not sequential in this way the reason is the buffering. Otherwise they were not processed sequentially and therefore got the different numbers.
You can influence the sorting of the billing due list with user exit EXIT_SAPLV60P_010 (see above)
likewise you can influence the max_documents with user exit EXIT_SAPLV60P_009

I hope this helps you further with your analysis.
Kind regards

Brian 

Answers (0)