2013 Sep 26 9:26 AM
Hello,
The tcodes ME21N/ME22N/ME23N/ME29N and ME23N-SAVE are working fine in BADI ME_PROCESS_PO_CUST~PROCESS_ITEM for the logic to change the GR date.
But how to make the logic work for the save PO through ME21N. and get the user entered data.
Can anyone help on this??
Regards,
Prema
2013 Sep 26 9:47 AM
(Not sure to undestand your requirement)
In methods IF_EX_ME_PROCESS_PO_CUST~CHECK or POST, get the list of items, and for each item execute the same code than in PROCESS_ITEM.
ls_header = im_header->get_data( ).
lt_items = im_header->get_items( ).
LOOP AT lt_items INTO ls_items.
ls_item = ls_items-item->get_data( ).
" etc.
ENDLOOP.
Regards,
Raymond
2013 Sep 26 1:04 PM
Hey Raymond,
Thanks for your reply...
But how do i put a check in method CHECK or POST that it should get triggered only for ME21N/ME21-SAVE option..???
Regards,
Prema
2013 Sep 26 1:55 PM
Check with
IF Sy-Tcode = 'ME21N' OR SY-T-CODE = 'ME21' .
WRITE YOUR Custom Code .
ENDIF .
Regard's
Smruti
2013 Sep 26 3:21 PM
Define an instance attribute in your implementation class of type TRTYP (transaction type) - Save it in method IF_EX_ME_PROCESS_PO_CUST~OPEN
me->trtyp = im_trtyp.
Then check in IF_EX_ME_PROCESS_PO_CUST~CHECK method that you are in creation (value "H" for ME21N, "V" for ME22N and "A" for ME23N)
But may/will some users create a PO, less than allowsed amount, then back with ME22N and change amount/add lines ?
Regards,
Raymond