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.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delivery Split Based on Item Quantity in Sales order

Former Member
0 Kudos

Hi,

We have a requirement to split the delivery based on sales order item quantity (it should be an automatic process). We have created a Z table where we maintain the maximum quantity per delivery based on some parameters (like shipping point). If the total quantity (sum of quantity of line items) of delivery reaches the maximum limit then the delivery split should happen. For better understanding of the requirement, please consider the below example.

Consider a sales order with 3 line items.

Order - XXXX                                                            

Item 1 - Qty 4,000

Item 2 - Qty 4,000

Item 3 - Qty 4,200

Maximum quantity per delivery is 3,000 (as per the Z table)

The delivery split should be as follows

Delivery 1

  Item 1 - 3,000

Delivery 2

  Item 1 - 1,000

  Item 2 - 2,000

Delivery 3

  Item 2 - 2,000

  Item 3 - 1,000

Delivery 4

  Item 3 - 3,000

Delivery 5

  Item 3 - 200

We tried splitting the delivery in requirement routine by changing the ZUKRL filed, We could not achieve the exact results as above. We tried some options in user exit even that didn’t work. We can easily split the delivery based on number of line items but could not find anything based on quantity. If you have any idea regarding this requirement please help.

Regards,

Ashish

1 ACCEPTED SOLUTION

Jelena
Active Contributor
0 Kudos

We had a similar requirement in one of my old jobs. There was certain number of cases that could fit on a truck and we had to split the deliveries where this quantity was exceeded. I've just checked my records and it seems that we had a standalone program for that. If memory serves, it ran in a background job at the end of day (large deliveries were only created once at EOD). It used BAPI_OUTB_DELIVERY_SPLIT_DEC (I think we also had to configure the split profile). This BAPI left the "spin-off" items on the original delivery with 0 quantity, so we also had to run WS_DELIVERY_UPDATE afterwards to delete these lines.

If memory serves, we also tried the VOFM route but it just didn't work with our specific requirements. Hope this helps.

11 REPLIES 11

Jelena
Active Contributor
0 Kudos

We had a similar requirement in one of my old jobs. There was certain number of cases that could fit on a truck and we had to split the deliveries where this quantity was exceeded. I've just checked my records and it seems that we had a standalone program for that. If memory serves, it ran in a background job at the end of day (large deliveries were only created once at EOD). It used BAPI_OUTB_DELIVERY_SPLIT_DEC (I think we also had to configure the split profile). This BAPI left the "spin-off" items on the original delivery with 0 quantity, so we also had to run WS_DELIVERY_UPDATE afterwards to delete these lines.

If memory serves, we also tried the VOFM route but it just didn't work with our specific requirements. Hope this helps.

Former Member
0 Kudos

Hi

As jelena suggested the BAPI_OUTB_DELIVERY_SPLIT_DEC can be helpfull in proving you the solution. Check the bellow link for reference.

http://scn.sap.com/thread/140900

Former Member
0 Kudos

Hi Jelena, thanks for the reply. If possible can you please send the stand alone program code (to id <removed by moderator>), we have to check this option and suggest the same to the client <removed by moderator> please help if possible.

Regards,

Ashish

Message was edited by: Thomas Zloch

ThomasZloch
Active Contributor
0 Kudos

Please don't post email addresses, don't ask for code to be sent to you directly, do not use terms that suggest a higher priority than normal. Everybody is on "normal" in the discussion spaces.


Thomas

Jelena
Active Contributor
0 Kudos

Ashish, I can't send you the whole program - it doesn't belong to me and also it wouldn't do you much good since about 80% of it is specific just to the company it was developed for. If I had a program that worked for anyone, I would've posted it on SCN long time ago.

I have confirmed though that split profile was needed - it's passed to BAPI in BUSINESSPROCESS parameter. If you have any specific questions regarding implementation, please feel free to ask.

Former Member
0 Kudos

Thank you Jelena, I will get back to you if i need any information.

Regards,

Ashish

Former Member
0 Kudos

Hi Thomas, thanks for the feedback. I will take care of these things from now on.

Regards,

Ashish

eduardo_hinojosa
Active Contributor
0 Kudos

Hi Ashish,

Standard field MVKE-LFMAX has to do it. Check it in sales views in material master. Have you tried it with this field?

Regards

Eduaro

0 Kudos

Eduardo, the documentation for this field in SE11 says:

Short Text

Maximum delivery quantity in store order processing

Definition

Quantity considered only in store order processing.

Use

If the quantity ordered exceeds the maximum delivery quantity, the system transfers the store order for this item to another internal or external vendor.

It doesn't seem to have anything to do with the delivery split. In our case we had very good consultants working on this. I'm sure if there was a better/standard solution, they would've found it.

Former Member
0 Kudos

Thank you all for the reply. We are still under discussion whether to go for stand alone program or not. Once this is sloved I will post the answer.

Regards,

Harish

0 Kudos

I had the similar requirement but split it by weight and got the solution from this post. However, it takes a while to figure out how to use BAPI_OUTB_DELIVERY_SPLIT_DEC so I post the code snippet on how to use the BAPI. Hope it will help anyone who have similar requirement in the future.

Delivery Split By Weight Using BAPI_OUTB_DELIVERY_SPLIT_DEC - Code Gallery - SCN Wiki

Regards,

Chaiphon