Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8894

Update EKPV-KUNNR in shipping tab of ME21N/ME22N

$
0
0

Hello,

 

I have a requirement where I have to update EKPV-KUNNR with a new value.

I tried to use BADI ME_PROCESS_PO_CUST Method PROCESS_ITEM.

 

I am using get_shipping_data to get the shipping details and then modifying EKPV-KUNNR and calling set_shipping_data but this is not getting updated.

 

I found out that in set_shipping_data, there is an old record and new record, and in new record only few fields are changed and because of that old_record is always equal to new_record and that is why my changed customer number is not updated.

 

Code in set_shipping_data

 

 

  l_data_old = me->if_purchase_order_item_mm~get_shipping_data( ).

* initial transfer from BAPI interface (old_data always empty)

  IF l_parent->for_bapi EQ mmpur_no.

    CHECK NOT l_data_old IS INITIAL.

  ENDIF.

  l_data_new = l_data_old. 

 

 

 

 

MOVE: im_ekpv-vstel TO l_data_new-vstel,

        im_ekpv-lprio TO l_data_new-lprio,

        im_ekpv-vsbed TO l_data_new-vsbed,

        im_ekpv-route TO l_data_new-route,

        im_ekpv-ablad TO l_data_new-ablad,

        im_ekpv-spe_auth_number  TO l_data_new-spe_auth_number,

        im_ekpv-spe_src_dlv_no   TO l_data_new-spe_src_dlv_no,

        im_ekpv-spe_src_exidv    TO l_data_new-spe_src_exidv,

        im_ekpv-spe_inspout_guid TO l_data_new-spe_inspout_guid,

        im_ekpv-spe_follow_up    TO l_data_new-spe_follow_up.

 

 

  IF l_data_new NE l_data_old.

 

 

    READ TABLE po_ekpv_hash_table INTO wa WITH TABLE KEY item = me.

    IF sy-subrc IS INITIAL.

      wa-data = l_data_new.

      MODIFY TABLE po_ekpv_hash_table FROM wa.

    ELSE.

      wa-item = me.

      wa-data = l_data_new.

      INSERT wa INTO TABLE po_ekpv_hash_table.

    ENDIF.

    ekpv_changed = mmpur_yes.

 

 

The issue is that none of the aforementioned fields are being changed so code never goes to l_data_new NE l_data_old where EKPO table is updated.

 

Can anyone help??


Viewing all articles
Browse latest Browse all 8894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>