01-09-2015 7:27 AM
Hello,
I m trying to change the shipping point in ME21N ...
I am using the badi me_process_po_cust and the method process_item.
After the execution of badi nothing happens.
Here is my code:
" GET PO Items
CALL METHOD im_item->get_data
RECEIVING
re_data = lt_item.
CHECK lt_item-reslo IS NOT INITIAL.
I read the new shipping data from a z table
" Compare shipping Data
CALL METHOD im_item->get_shipping_data
RECEIVING
re_ekpv = ls_ship.
" 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.
ENDIF.
I have the endless loop problem ( i ll deal with later), for the moment I am stopping the seond iteration in debugging by changing the value of the lv_shipupdate variables.
I ll be waiting for your comments.
Best regards.
01-09-2015 7:54 AM
Hi Achref.
DATA: im_header TYPE REF TO if_purchase_order_mm,
cl_po TYPE REF TO cl_po_header_handle_mm.
im_header = im_item->get_header( ).
IF lv_shipupdate = 'X'.
CALL METHOD im_item->set_shipping_data
EXPORTING
im_ekpv = ls_ship.
cl_po ?= im_header.
IF NOT cl_po->my_recheck_queue IS INITIAL.
CLEAR cl_po->my_recheck_queue.
ENDIF.
ENDIF.
Hope it helpful.
Regards,
Venkat Ramesh.V
01-09-2015 7:54 AM
Hi Achref.
DATA: im_header TYPE REF TO if_purchase_order_mm,
cl_po TYPE REF TO cl_po_header_handle_mm.
im_header = im_item->get_header( ).
IF lv_shipupdate = 'X'.
CALL METHOD im_item->set_shipping_data
EXPORTING
im_ekpv = ls_ship.
cl_po ?= im_header.
IF NOT cl_po->my_recheck_queue IS INITIAL.
CLEAR cl_po->my_recheck_queue.
ENDIF.
ENDIF.
Hope it helpful.
Regards,
Venkat Ramesh.V