cancel
Showing results for 
Search instead for 
Did you mean: 

Weight limit check during delivery creation

Former Member
0 Kudos

Hi guys,

our business has the requirement to have a weight limit check during delivery creation. (eg. truck load).

we have batch managed materials with the weights on batch level.

actual we have a custom table where a weight is inserted (this is the max. weight). Then i have the BADI for Delivery Processing

active. My actual coding for this checks are in method IF_EX_LE_SHP_DELIVERY_PROC~CHANGE_DELIVERY_ITEM.

my problem is following: system starts creating of delivery with the first main item. then it allocates the allocated batches and inserts the batches line item after item. i count the weights of the batches and compare it against the table. when the weight limit is reached for eg. the second main item in the first allocated batch of this main item, i can only set the cf_flag_delete_item flag for the batch item. for the linked main item i cannot set this flag, because too late.

when i then save the delivery the main item with quantity 0 and no batches is created.

the requirement is to create a delivery w/o main items with quantity 0.

or does someone know an easy setup in SAP to manage this weight limit stuff (no delivery split handling)

thanks a lot for your help in advance

Michael

Accepted Solutions (1)

Accepted Solutions (1)

harry_wu
Contributor
0 Kudos

Hi,

What's the quantity of main item after you set CF_FLAG_DELETE_ITEM flag forbatch split items in the badi? Is it changed to 0 or is it changed to the original quantity?

When I test, I foudn that the mainitem quantity will be reset to the original quantity, as if there is no batch-split.

Maybe you can user method IF_EX_LE_SHP_DELIVERY_PROC~SAVE_DOCUMENT_PREPARE to do a final check on delivery items and delete the 0 items as you expect.

Former Member
0 Kudos

Hi,

thanks for you first comments. My problem are not the batch items which are over the limit. There i can set the deletion flag CF_FLAG_DELETE_ITEM. This is ok. And these items are deleted at the end.

The problem is the linked main item. During debugging the lfimg of the main item contains the open delivery quantitiy. The deletion flag for the main item i cannot when there are no linked batch items with value because the cs_lips.... contains already the next to be generated item. a backward setting of this deletion flag for the main item is not possible.

it is not easy to explain this case. now i hop it is clearer.

thanks

Michael

harry_wu
Contributor
0 Kudos

Hi Michael,

As I mentioned, it's not easy to fulfill your requirement. It's not possible to delete the main item easily when processing sub-item.

Maybe you can do something in the method I mentioned. IF_EX_LE_SHP_DELIVERY_PROC~SAVE_DOCUMENT_PREPARE.

At that stage, you can see the deleted batch-split items in XLIPS table with UPDKZ =D. You may develop some logic to decide whether to delete main item by manipulating XLIPS and YLIPS table. It's not that easy as setting CF_FLAG_DELETE_ITEM flag, but it's still possible.

Answers (0)