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: 

BADI ME_PROCESS_PO_CUST set shipping data not working

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

VenkatRamesh_V
Active Contributor
0 Kudos

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

1 REPLY 1

VenkatRamesh_V
Active Contributor
0 Kudos

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