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: 

ME22n PO item updation

Former Member
0 Kudos

Hello,

My requirement is that if I make change to one of the Z-fields of a PO item then I need to make those changes in all items of that PO.

I am unable to find the place where I can make these changes.
I have checked in post method of badi 'ME_PROCESS_PO_CUST' and also checked customer exits for enhancement 'MM06E005'. but could not do that.

Kindly let me know if someone has any idea.

Regards,

Suchender

9 REPLIES 9

Former Member
0 Kudos

Hi,

Try use this code in method POST of the implementation BADI ME_PROCESS_PO_CUST.

DATA: re_items TYPE purchase_order_items.

DATA: re_item TYPE purchase_order_item.

DATA: me_item TYPE mepoitem.


* Get PO items

CALL METHOD im_header->get_items

     RECEIVING

       re_items = re_items.


LOOP re_items INTO re_item.


CALL METHOD re_item-item->get_data

       RECEIVING

         re_data = me_item.

me_item-zzfield = 'Example'.

* Here you can modify item

CALL METHOD re_item-item->set_data

           EXPORTING

             im_data = me_item.


ENDLOOP.



Regards.

David Cárceles.

0 Kudos

Hello David,

I have already tried that but the values are not updated.

Former Member
0 Kudos

Please check function exit EXIT_SAPMM06E_012 in the enhancement mentioned by you. Check the value of I_TRTYP ( you need to consider the change scenario; I_TRTYP = 'V'). Write your logic to modify changing internal table  C_CI_EKKO and see if this works.

0 Kudos


Hello Mohit,

I found one to change for EKPO in EXIT_SAPMM06E_018 with table E_CI_EKPO.

I tried to change value in debugging but these were not relected.

0 Kudos

In my previous developments I used 012, not sure about 018, but yes, this addition changing parameter was not there (in 4.6 C). We used field symbol to modify one other internal table. let me check if I have those details.

0 Kudos

Hi,

Use this->

FIELD-SYMBOLS: <fs_table> TYPE STANDARD TABLE OF BEKPO.

ASSIGN '(SAPMM06E)pot[]' TO <fs_table>.

if field symbol is assigned.

"your logic

else.

ASSIGN '(SAPLMEPO)pot[]' TO <fs_table>.

" this is another program of PO creation/change I believe

if field symbol is assigned.

"your logic.

endif.

endif.

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

Try,

After modifying item, clear the queue.

Data cl_po  TYPE REF TO cl_po_header_handle_mm.

        im_header TYPE REF TO if_purchase_order_mm.

im_header   = im_item->get_header( ).

cl_po ?= im_header.

    IF NOT  cl_po->my_recheck_queue IS INITIAL.

        CLEAR cl_po->my_recheck_queue.

      ENDIF.



Hope it helpful,


Regards,

Venkat

0 Kudos

Venkat, still it's not working.

0 Kudos

Hi,

Try,

Data lv_flag type c.

if lv_falg is initial.

im_item->set_data( EXPORTING im_data = ls_mepoitem ).

lv_flag = 'X'.

endif.

Dont clear the variable.

Hope it helpful,

Regards,

Venkat