Skip to Content
0
Former Member
Jan 21, 2015 at 09:28 AM

BADI ME_PROCESS_PO_CUST set shipping data not saved

457 Views

Hello,

I am implementing BADI IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM to set the shipping point based on my own customizing ( SM30).

The implementation works fine and the correct data is populated to the screen, But after I save the shipping point goes back to previous value.

Scnéario: ME21N: create the order and change the shipping point via the badi.

Save

ME22N: after saving the purchase order has the old value.

Thanks for you help.

Here after my code:

" GET PO Items
CALL METHOD im_item->get_data
RECEIVING
re_data = lt_item.

CHECK lt_item-reslo IS NOT INITIAL.

SELECT SINGLE shipping_point
FROM ZSHIPPOINTDET
INTO lv_ship
WHERE plant = lt_item-werks
AND storage_location = lt_item-lgort
AND issu_storage_loc = lt_item-reslo.

" Compare shipping Data
CALL METHOD im_item->get_shipping_data
RECEIVING
re_ekpv = ls_ship.

CHECK ls_ship IS NOT INITIAL.

" Setting the shipping Point
IF lv_ship <> ls_ship-vstel.
ls_ship-vstel = lv_ship.
lv_shipupdate = 'X'.
ENDIF.

IF lv_shipupdate = 'X'.
CALL METHOD im_item->set_shipping_data
EXPORTING
im_ekpv = ls_ship.

cl_po ?= lo_ref_header.
IF NOT cl_po->my_recheck_queue IS INITIAL.
CLEAR cl_po->my_recheck_queue.
ENDIF.
ENDIF.