Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Invoice Split based on Cummulative Quantity

0 Kudos

Hi Friends,

I have one requirement for Invoice Split based on quantity. Suppose total qty exceeds 100, invoice should be splitted. I tried with the routine which are already there. I modified the routine 001(copy) with my code. I have given the quantity field also. Splitting is happening but it is taking quantity as one category.

For example, if 50, 25, 25 and 20 qty is there in three line items, invoice is splitting for 50 in one invoice 25 & 25 in another invoice and 20 in another. This means it is considering 50 as one category ,25 as another category and 20 as another and then splitting into 3 invoices.

But my requirement is that it should be splitted with 100 qty in one invoice and rest of the qty in other invoice.

Please suggest how to do this.

Thanks in advance.


0 Kudos

No reply

Former Member
0 Kudos

Hi Grace,

You can do like this.

1. In your routine declare two static variable.

2. Keep adding quantity in one variable.

3. check this variable against your limit i.e. 100

4. if <static_variable_1> ge 100.

<static_variable_2> = <static_variable_2> + 1.

concatenate <static_variable_2> <static_variable_1> into vbrk-zukri.

clear: <static_variable_1>.

with regards,

Siddharth Patel