Skip to Content

Process_item not updating EKPO ME21N : S4hana

Aug 03, 2017 at 08:30 PM


avatar image
Former Member

Dear all

I have added custom fields using CMOD at item level in me21n , Based on custom fields value i have to change field weunb value to X in ekpo , i have used BADI method PROCESS_ITEM , it is transferring X to weunb , but it is triggering when user press enter at item level .

in a case if user press SAVE button directly , it is not getting triggered if it is a custom tab.

for other tab at item level , it is getting triggered .

I have tried methods CHECK and POST ,it is not working ...

This is the coding block i have used in all three methods

IF im_item IS BOUND.
 ls_po_item_data = im_item->get_data( ). IF ls_po_item_data-zval = 'CCV'.
 ls_po_item_data-weunb = 'X'.
 im_item->set_data( im_data = ls_po_item_data ).

How to rectify this

Thanks in advance

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raymond Giuseppi
Aug 04, 2017 at 05:25 AM

How did you manage the custom fields, e.g. in ME_GUI_PO_CUST, did you manage the RE_CHANGED parameter in TRANSPORT_FROM_DYNP.

Also did you actually implement a LOOP on every item in the CHECK method of ME_PROCESS_PO_CUST.

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Raymond ,

Thanks for your reply

Yes , i did tried passing X to re_changed but not triggering process_item also i tried with E_CI_UPDATE in exit

Note : i have not used ME_GUI_PO_CUST for custom screen enhancement .

The coding i shown is inside process_item , for check i put this logic inside loop but debugging i have checked method set_data is failed but in process_item set_Data is doing purpose.


A correct solution should be correction of your dynpro to trigger the event changed of item when data is input, so it depends on how you implemented it, could you elaborate?

Nevertheless, the CHECK method should have same success than PROCESS_ITEM (the SAVE method is executed too late, but not the CHECK one) could you post your exact code in the LOOP?

METHOD if_ex_me_process_po_cust~check.
  INCLUDE mm_messages_mac.
  DATA: ls_header TYPE mepoheader,
        lt_items  TYPE purchase_order_items,
        ls_items  TYPE purchase_order_item. " etc.
  CHECK me->trtyp NE 'A'. 
  mmpur_context mmcnt_context_badi.
  ls_header = im_header->get_data( ).
  lt_items  = im_header->get_items( ).
  " Loop at items
  LOOP AT lt_items INTO ls_items.
    ls_item = ls_items-item->get_data( ).
    CHECK ls_item-loekz IS INITIAL.
    " your code here?
    " if some field actually changed
    im_item->set_data( ls_item ).    
  " etc.
Former Member
Raymond Giuseppi

I have done screen enhancement through MM06E005

These are the function exits i have used

EXIT_SAPMM06E_012 --->here i have done validation

EXIT_SAPMM06E_016 --->pushing data into subscreen0111

EXIT_SAPMM06E_018 --->pushing out data from subscreen0111 here i am passing e_ci_update = 'X'.

Screen exit

SAPMM06E 0111

Here is coding block under method check

DATA  lt_po_item TYPE purchase_order_items.
    DATA ls_po_item TYPE purchase_order_item. DATA  ls_po_item_data TYPE       mepoitem. 
IF im_header IS BOUND. lt_po_item = im_header->get_items( ). ENDIF.
LOOP AT lt_po_item INTO ls_po_item. IF ls_po_item-item IS BOUND. ls_po_item_data = ls_po_item-item->get_data( ).
IF ls_po_item_data-val = 'CCC'. ls_po_item_data-weunb = 'X'. ls_po_item-item->set_data( im_data = ls_po_item_data ).