Skip to Content

This document would give in formation on how to access or change the PO item data before save using different methods.

 

Create implementation for BADI ME_PROCESS_PO_CUST

 

go to Method PROCESS_ITEM(This method can be used to change the Item)

 

DATA:

  Flg_pers type c,

  ref_pohdr TYPE REF TO if_purchase_order_mm,

  wa_pohdr  TYPE mepoheader,

  wa_item   TYPE mepoitem,

  wa_pitem   TYPE mepoitem.

* This method can be used to get referance(Pointer) for header data

  ref_pohdr = im_item->get_header( ).

* Read header data from above referance

  wa_pohdr = ref_pohdr->get_data( ).

* im_item of PROCESS_ITEM can be used as a referance to get item data

  wa_item = im_item->get_data( ).

* IS_PERSISTENT can be used to check whether item is already created or it is nw entry

  flg_pers = im_item->is_persistent( ).

* We can apply logic for only new items

IF flg_pers IS NOT INITIAL.

      EXIT.

ENDIF.

* in this example I am modifying GR indicator for few conditions

IF wa_pohdr-ekorg EQ ‘1001’ AND wa_item-knttp = ‘F’.

      wa_item-wepos = space.

      im_item->set_data( EXPORTING im_data = wa_item ).

ENDIF.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Mithun Kumar

    Hi Rambabu,

    Thanks for this helpful blog. I just noticed that the method “im_item->get_persistent_data” returns the current delivery date (EINDT) instead of the last posted delivery date, for the item.

    Do you know if there’s any better way to get the delivery date changes, from last posted to current on-screen in ME22N?

    (0) 

Leave a Reply