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: 

ME21N-SAVE not getting triggered in BADI ME_PROCESS_PO_CUST~PROCESS_ITEM

Former Member
0 Kudos
1,610

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

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos
295

(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

0 Kudos
295

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

0 Kudos
295

Check with

IF Sy-Tcode = 'ME21N' OR SY-T-CODE = 'ME21' .

WRITE YOUR Custom Code .

ENDIF .

Regard's

Smruti

0 Kudos
295

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