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: 

Adopt PR to PO BADI or User Exit

Former Member
0 Kudos

Need advise if there any one exprience on creating User Exit or BADI for adopting PR to PO (ME21N) .

I create custom tab for both PR (ME51N) and PO (ME21N), what i need to do when adopting PR to PO the customer tab value not copied even its field name are the same.

Need expert advise on this if there is any BADI or User Exit i can used to copied over the custom tab value.

Thanks

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

Use BAdI ME_PROCESS_PO_CUST, there in method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM, and when PR number changes (im_item->get_previous_data failure or result differs from result of im_item->get_data) and copy values using im_item->set_data.

Regards,

Raymond

7 REPLIES 7

Former Member
0 Kudos

Hi ,

Any one can help? What i had done is to look for any BADI related when i'm perform the adopt PR to PO but not sure which is the right BADI

Here is the list

LFM2_DB_STRG

ADDRESS_SUBSCREEN

ME_CHECK_ALL_ITEMS

ME_CCP_ACTIVE_CHECK

LUMER_BADI_ROUND_INT

EAPS_HRKFT_EXTENSION

FAGL_DERIVE_SEGMENT

FAGL_DERIVE_PSEGMENT

CHECK_COBL_ADDON

MD_STOCK_TRANSFER

ME_DEFINE_CALCTYPE

ME_PO_PRICING

ME_PO_PRICING_CUST

REFERENCE_SITE

SD_COND_ACCESS_A

ADDR_LANGU_TO_VERS

p/s i'm using SXV_GET_CLIF_BY_NAME to find the BADI.

0 Kudos

Hi Lee,

I am not sure about BADI,But if you try from OMET Tcode like this link

https://scn.sap.com/thread/1908600

Hope it may solve your problem with out any BADI !!

Thanks

Gourav.

0 Kudos

currently i'm looking options using BADI or User Exit,

Using OMET seems not working for custom tab.

0 Kudos

Purpose of the BADI or User Exit is to fill or copy the Customer Tab which is same field name as in PR and PO.

chundru_ravindra
Participant
0 Kudos

Hi,

Check for these may be useful,

ME51N: MEREQ001-----Exit

ME21N:

ME_GUI_PO_CUST---- BAdI

AMPL0001-----Exit

Regards,

Ravindra.

raymond_giuseppi
Active Contributor

Use BAdI ME_PROCESS_PO_CUST, there in method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM, and when PR number changes (im_item->get_previous_data failure or result differs from result of im_item->get_data) and copy values using im_item->set_data.

Regards,

Raymond

0 Kudos

Hi Raymond,

Yes Currently using this BADI it seems ok and able to manually select the PR value base on the PR Doc Number. I'll closed this msg once everything confirmed and OK

BADi: ME_PROCESS_PO_CUST

PROCESS_ITEM

Below is the code snippet

check  sy-tcode = 'ME21N'

     or sy-tcode = 'ME21'

     or sy-tcode = 'ME22N'

     or sy-tcode = 'ME22'

     or sy-tcode = 'ME23N'

     or sy-tcode = 'ME23'.

   data: ls_mepoitem          type mepoitem.

   data :ls_header     type ref to if_purchase_order_mm.

   data : tp_zzpprctr type eban-zzpprctr.

   include mm_messages_mac.

* get current data from business object

   ls_mepoitem = im_item->get_data( ).

*-Get the header data

   ls_header     = im_item->get_header( ).

   if not ls_mepoitem-banfn is initial.

     select single zzpprctr into tp_zzpprctr

     from eban where banfn = ls_mepoitem-banfn

                                 and bnfpo = ls_mepoitem-bnfpo.

     if sy-subrc = 0.

       ls_mepoitem-zzpprctr = tp_zzpprctr.

       call method im_item->set_data

         exporting

           im_data = ls_mepoitem.

endif.

p/s  i don't have time to test the raymond suggestion but any user can try his options and feedback here.