cancel
Showing results for 
Search instead for 
Did you mean: 

Delivery Split on the basis of total weight of delivery VL10G/VL10C

former_member824350
Discoverer
0 Kudos

I have a requirement to split and reduce line item quantity of the delivery, if the total weight of delivery has exceeded 16,000 LB. And the rest number of quantity of current line item and remaining line items needs to be considered in the next delivery through VL10G processing and this will go on and the total weight can't be more than 16,000 LB.
As the previous solution found over the community, while implementing the solution we need to use the VTLA routines and use the ZUKRL field to split the delivery items which are not needed to be coupled together.
While implementing this solution, can anyone help me in determining how would we get the total weight of the delivery and reduce the quantity of the items automatically through the routine itself, as the routine is triggered for all the line items and only determination of header related differences can be incorporated in the routine.

Also the LIKP-ZUKRL header value is present in the routine for particular line item so we can't loop the upcoming line items or consider VBAP line items as all the line items are not relevant for processing.

If there's any standard config to achieve this or any code which someone can share to implement this solution, will be really helpful. I have not found any weight based split answer which has fulfilled the requirement over the internet.

Business use case is that the truck load can't be more than 16,000 LB that's why they want more number of deliveries not exceeding the weight over 16,000 LB.


Thank you in advance.

jignesh_mehta3
Active Contributor
0 Kudos

Hello Amarnath,

This question came at a perfect time.

I am right working on a requirement to split a Delivery after 20 Tons.

I am not sure if Custom Code in Copy routine will help. We are currently trying to insert Custom code in MV50AFZ1 where we are calculate Weight from XLIPS but calling BAPI to create (another) Delivery.

We are still not sure how will we fill the header details while creating new Delivery and are also not sure of the BAPI will go through all the existing Custom Developments.

I will watch this thread for further information and also update on progress we make.

Thanks,

Jignesh.

jignesh_mehta3
Active Contributor
0 Kudos

Hello Amarnath, Did you made any progress on the requirement?

If yes, can you please share the implemented solution?

former_member871689
Discoverer

Hi Jignesh,

Get into the VOFM->DATA TRANSFER->DELIVERIES->Routine number 001

You can enhance or copy the include and make your changes FV50C001
Please note that, we had done another enhancement to stop the delivery from having more than the limit of weight in a single line item. We had to split only if combined value crosses the limit.
Quantity change is not possible while splitting the line item, that can be achieved with multiple enhancements and with memory ID.


Code attached below for the same.
data: lv_weight type vbap-brgew,
lv_zukrl type dzukrl value '1',
lv_limit type vbap-brgew .

*Tvarvc entry for the limit set by the client
SELECT SINGLE low
into @DATA(lv_limit1)
from tvarvc
where name = 'ZSD_DELIVERY_SPLIT_LIMIT'.
IF sy-subrc is INITIAL.
lv_limit = lv_limit1.
ENDIF.

IMPORT lv_weight lv_zukrl FROM MEMORY ID 'Z_SPLIT'.
IF lv_weight IS INITIAL.
lv_weight = lips-brgew.
IF lv_weight LE lv_limit.
CONCATENATE likp-zukrl lv_zukrl INTO likp-zukrl.
EXPORT lv_weight lv_zukrl TO MEMORY ID 'Z_SPLIT'.
EXIT.
ENDIF.
ELSE.
*add weight of line item to previous item
data(lv_weight_1) = lv_weight + lips-brgew.
IF lv_weight_1 GT lv_limit.
lv_weight = lips-brgew.
lv_zukrl = lv_zukrl + 1.
ELSE.
lv_weight = lv_weight_1.
ENDIF.
*check with the limit of delivery
IF lv_weight LE lv_limit.
CONCATENATE likp-zukrl lv_zukrl INTO likp-zukrl.
EXPORT lv_weight lv_zukrl TO MEMORY ID 'Z_SPLIT'.
EXIT.
ELSE.
CONCATENATE likp-zukrl lv_zukrl INTO likp-zukrl.
EXPORT lv_weight lv_zukrl TO MEMORY ID 'Z_SPLIT'.
EXIT.
ENDIF.
ENDIF.

ENDIF.

Accepted Solutions (1)

Accepted Solutions (1)

former_member871689
Discoverer
0 Kudos

Hi Amarnath,

Get into
VOFM->DATA TRANSFER->DELIVERIES->Routine number 001
You can enhance or copy the include and make your changes FV50C001
Please note that, we had done another enhancement to stop the delivery from having more than the limit of weight in a single line item. We had to split only if combined value crosses the limit.
Quantity change is not possible while splitting the line item, that can be achieved with multiple enhancements and with memory ID.


Code attached below for the same.
data: lv_weight type vbap-brgew,
lv_zukrl type dzukrl value '1',
lv_limit type vbap-brgew .

*Tvarvc entry for the limit set by the client
SELECT SINGLE low
into @DATA(lv_limit1)
from tvarvc
where name = 'ZSD_DELIVERY_SPLIT_LIMIT'.
IF sy-subrc is INITIAL.
lv_limit = lv_limit1.
ENDIF.

IMPORT lv_weight lv_zukrl FROM MEMORY ID 'Z_SPLIT'.
IF lv_weight IS INITIAL.
lv_weight = lips-brgew.
IF lv_weight LE lv_limit.
CONCATENATE likp-zukrl lv_zukrl INTO likp-zukrl.
EXPORT lv_weight lv_zukrl TO MEMORY ID 'Z_SPLIT'.
EXIT.
ENDIF.
ELSE.
*add weight of line item to previous item
data(lv_weight_1) = lv_weight + lips-brgew.
IF lv_weight_1 GT lv_limit.
lv_weight = lips-brgew.
lv_zukrl = lv_zukrl + 1.
ELSE.
lv_weight = lv_weight_1.
ENDIF.
*check with the limit of delivery
IF lv_weight LE lv_limit.
CONCATENATE likp-zukrl lv_zukrl INTO likp-zukrl.
EXPORT lv_weight lv_zukrl TO MEMORY ID 'Z_SPLIT'.
EXIT.
ELSE.
CONCATENATE likp-zukrl lv_zukrl INTO likp-zukrl.
EXPORT lv_weight lv_zukrl TO MEMORY ID 'Z_SPLIT'.
EXIT.
ENDIF.
ENDIF.

ENDIF.

Answers (1)

Answers (1)

p391977
Contributor
0 Kudos

Hi Amarnath,

Please try the below.

Go to VLSP enter the delivery document number and enter the split profile.

Execute the report.

Change the Split delivery qty, initially it will be Zero with editable mode. Change it to the desired qty and click simulate Split than save it to get multiple deliveries.