Standard implementatin of ME_PROCESS_PO_CUST

Hi all,
I'm working on a SAP ECC 6.0.
I want to implement the badi me_process_po_cust, but I find a SAP's implementation?!!
(CON_FIN_SUBCONTRACT).
If I make my custom implementatin, the badi does't work because of multiple implementation (I check in in debug).
I thinked to modify the standard implementation (it doesn't requiere key access), but it has a strange behavior, the forward navigation is impossibile, the message says that the interface isn't implemented.
I have to modify anyway this implementation or what else?
thanks
enzo

Hi
The advantage of BADI over User exit is that it allows Multiple Implementations
So no need to worry if an implementation already exist for that BADI
so implement it in SE19 separately and use it
see the sample code
BAdI Name: ZCHECK_PO_LINE_ITEM (Implementation name) PO Account assignment
Definition Name: ME_PROCESS_PO_CUST
Interface Name : IF_EX_ME_PROCESS_PO_CUST
Implementing Class: ZCL_IM_BADIN_ACCOUNT_ASSGN
Method :            PROCESS_HEADER
METHOD if_ex_me_process_po_cust~process_header .
  DATA : re_data TYPE mepoheader.
*get the item data
  CALL METHOD im_header->get_data
    RECEIVING
      re_data = re_data.
  re_header = re_data.
  IF ( re_data-bsart NE 'ZOC' AND re_data-bsart NE 'ZPC' ).
    IF ( re_data-bsart <> 'ZIC' AND re_data-bsart <> 'UB' ).
      IF re_data-bukrs NE '1001'.
        MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'Use only Sipchem Company'
                                        'Code for External Procurement'.
      ENDIF.
    ENDIF.
  ENDIF.
ENDMETHOD.
Method :            PROCESS_ITEM
METHOD if_ex_me_process_po_cust~process_item .
  DATA: v_menge TYPE bamng,   " PR Quantity
        v_statu.              " PR Status
  DATA : re_data TYPE  mepoitem,
       re_data1 TYPE mepoaccounting,
re_accountings TYPE purchase_order_accountings ,
header TYPE purchase_order_accounting.
*get the item data
  CALL METHOD im_item->get_data
    RECEIVING
      re_data = re_data.
  IF ( re_header-bsart NE 'ZOC' AND re_header-bsart NE 'ZPC' ).
    IF re_header-bsart EQ 'ZRL'.
      IF re_data-konnr EQ space.
        MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'You cant create a Release order'
                                                     'without a reference to Outline Agreeement'.
      ENDIF.
    ENDIF.
    IF re_data-knttp NE 'K' AND re_data-pstyp NE '9' .
      IF syst-cprog EQ 'RM_MEPO_GUI'.
        IF re_data-uebto IS NOT INITIAL OR
           re_data-uebtk IS NOT INITIAL OR
           re_data-untto IS NOT INITIAL.
          MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'You cant change delivery settings'.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.
ENDMETHOD.
Regards
Anji

Similar Messages

  • In badi ME_PROCESS_PO_CUST how to get preivious row value from table ctrl?

    hi Friends,
    I am Using ME_PROCESS_PO_CUST badi for validation in Purchase oreder (ME21N),
    For that I implementaed PROCESS_ITEM method which fires during each row now i want to add another validation in same implimentation for that i need privious row's value so how to get that value ?
    following is my current validation code. 
    method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM.
      DATA:ls_poitem TYPE mepoitem.
      DATA:ls_poheader TYPE MEPOHEADER.
      DATA:lm_poheader TYPE ref to IF_PURCHASE_ORDER_MM.
      DATA:w_mara TYPE mara.
      DATA:IT_ZMMTBL039 TYPE STANDARD TABLE OF ZMMTBL039 ,
           WA_ZMMTBL039 TYPE ZMMTBL039 .
      DATA:ls_poitem1 TYPE mepoitem.
      DATA:V_KUNNR1 TYPE KNA1-KUNNR.
      DATA:V_KUNNR2 TYPE KNA1-KUNNR.
      ls_poitem = im_item->get_data( ).
      lm_poheader = im_item->GET_HEADER( ).
      ls_poheader = lm_poheader->GET_DATA( ).
      CLEAR: WA_ZMMTBL039,w_mara.
      REFRESH:IT_ZMMTBL039[] .
      SELECT *
        INTO  TABLE  IT_ZMMTBL039
        FROM ZMMTBL039
       WHERE bsart EQ ls_poheader-bsart.
      IF sy-subrc EQ 0.
        CLEAR: WA_ZMMTBL039,w_mara.
        SELECT SINGLE *
          INTO w_mara
          FROM mara
         WHERE matnr EQ ls_poitem-MATNR.
        IF SY-SUBRC EQ 0.
          READ TABLE IT_ZMMTBL039 INTO WA_ZMMTBL039 WITH KEY  bsart = ls_poheader-bsart
                                                              mtart = w_mara-mtart
                                                              spart = w_mara-spart.

    Hello
    If you had searched the SDN forums you would have found plenty of answers to your question.
    Following is some sample coding:
    method IF_EX_ME_PROCESS_PO_CUST~POST.
    DATA:
        ls_header TYPE mepoheader,
      lt_items   TYPE purchase_order_items,
      ls_item   TYPE purchase_order_item,
      ls_item TYPE mepoitem.
      ls_header = im_header->get_data( ).
      lt_items = im_header->get_items( ).
      LOOP AT items INTO ls_item.
        ls_item = line_item-item->getdata( ).
        " process item data...
      ENDLOOP.
    ENDMETHOD.
    Regards,
      Uwe
    PS: Do not use such kind of pseudonyms instead of your real name. Because my impression is that a nobody (in term of ABAP development competence) tries to claim to be a somebody who fills his knowledge gaps via SDN. Using pseudonyms significantly decreases your changes to get any answers at the SDN forums.

  • Regarding Error message in ME_PROCESS_PO_CUST badi for validation.

    hi Friends,
    I am Using ME_PROCESS_PO_CUST badi for validation in Purchase order (ME21N),
    For that I implemented PROCESS_ITEM method which fires during each row now i  add another validation in same implementation for plant  should be same through out the all line item. Now following code is woking fine but when for second line item user changese plant then it shows error message as per logic which is fine but even after changing plant to correct one the error message is still coming why is it so?
    following is my current validation code
    method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM.
      DATA:ls_poitem TYPE mepoitem,
           ls_poitem_set TYPE mepoitem.
      DATA:ls_poheader TYPE MEPOHEADER.
      DATA:lm_poheader TYPE ref to IF_PURCHASE_ORDER_MM.
      DATA:w_mara TYPE mara.
      DATA:IT_ZMMTBL039 TYPE STANDARD TABLE OF ZMMTBL039 ,
           WA_ZMMTBL039 TYPE ZMMTBL039 .
      DATA:ls_poitem1 TYPE mepoitem.
      DATA:V_KUNNR1 TYPE KNA1-KUNNR.
      DATA:V_KUNNR2 TYPE KNA1-KUNNR.
      DATA:W_WERKS(4),
           w_werks_tmp(4),
           w_flag(1).
      ls_poitem = im_item->get_data( ).
      lm_poheader = im_item->GET_HEADER( ).
      ls_poheader = lm_poheader->GET_DATA( ).
      IF ls_poitem-werks IS NOT INITIAL.
        w_werks = ls_poitem-werks.
        import w_flag to w_flag from MEMORY ID 'FLAG'.
        if w_flag is initial.
          w_flag = 'X'.
          EXPORT w_werks_tmp FROM w_werks TO MEMORY ID 'MEMO1'.
          export w_flag from w_flag to MEMORY ID 'FLAG'.
          clear: w_flag.
        endif.
      ENDIF.
      IMPORT w_werks_tmp TO w_werks FROM MEMORY ID 'MEMO1'.
    break swaroopb.
      IF ls_poitem-werks NE w_werks.
          MESSAGE E010(zparts) with 'Different plants are not allowed in single PO.'.
      ENDIF.
      CLEAR: WA_ZMMTBL039,w_mara.
      REFRESH:IT_ZMMTBL039[] .
      SELECT *
        INTO TABLE IT_ZMMTBL039
        FROM ZMMTBL039
       WHERE bsart EQ ls_poheader-bsart.
      IF sy-subrc EQ 0.
        CLEAR: WA_ZMMTBL039,w_mara.
        SELECT SINGLE *
          INTO w_mara
          FROM mara
         WHERE matnr EQ ls_poitem-MATNR.
        IF SY-SUBRC EQ 0.
          READ TABLE IT_ZMMTBL039 INTO WA_ZMMTBL039 WITH KEY  bsart = ls_poheader-bsart
                                                              mtart = w_mara-mtart
                                                              spart = w_mara-spart.
          IF SY-SUBRC NE 0.
            MESSAGE E009(zparts) WITH ls_poitem-MATNR w_mara-spart ls_poheader-bsart .
          ENDIF.
        ENDIF.
      ENDIF.
    end method

    Hello Swarup
    Since you want to compare all items together (having the same plant) I would suggest to implement this logic either in method CHECK or POST of the interface.
    However, if you want to make your checks within the PROCESS_ITEM method then you should change your logic.
    It does not make sense to work with the ABAP memory within a BAdI implementing class because the class itself is your "memory".
    I would use the following logic to implement your validation:
      lo_poheader = im_item->get_header( ).  " retrieve header instance
      lt_items = lo_poheader->get_items( ).   " retrieve all items
      ls_detail_x = im_item->get_detail( ).  " details of currently processed item
      LOOP AT lt_items INTO ls_item.
        ls_detail = ls_item-item->get_detail( ).
        IF ( ls_detail-werks NE ls_detail_x-werks ).  " validation failed
        " do something...
       ENDIF.
      ENDLOOP.
    However, I would prefer to do this kind of validation in CHECK or POST method.
    Regards,
      Uwe

  • Data from Business Add-In ME_PROCESS_PO_CUST not adopted

    Hi,
    I am trying to find out an exit or badi for Updating Tax Unit of Measure in transaction ME21n.( Auto Po Creation)
    The scenario is like this...
    The system assumes Base Unit of Measure for all its calculations. If the order UOM of a part happens to be different from the base UOM or if an alternate UOM then the system should consider the UOM.
    The Base UOM needs to be passed to BAPI during the upload process into SAP so that the ORDER will either be created in the base UOM or the appropriate conversion factor will be taken into account when calculating the order quantity if the order UOM happens to be different from the base UOM.
    If no UOM is specified in the input of the BAPI call then the system should put the base unit of measure for the part instead.
    For the above I have written logic in BADI ME_Process_PO_CUST and Method Proess_Item..
    The code is below,
      select single meins bstme into (wa_meins, wa_bstme) from mara where
      matnr eq wa_mepoitem-matnr.
      if not wa_bstme is initial.
        if wa_mepoitem-meins <> wa_bstme.
          wa_mepoitem-meins = wa_bstme.
          call method im_item->set_data
            EXPORTING
              im_data = wa_mepoitem.
        else.
          wa_mepoitem-meins = wa_meins.
          call method im_item->set_data
            EXPORTING
              im_data = wa_mepoitem.
        endif.
    When I try to create purchase order ,I am getting the following error message...
    Data from Business Add-In ME_PROCESS_PO_CUST not adopted
    Message no. MEPO151
    Diagnosis
    An endless loop occurred during the processing of the Business Add-In ME_PROCESS_PO_CUST. The system terminated the processing.
    Procedure
    Contact your system administrator.
    Procedure for System Administration
    Check whether standard fields are changed in the implementation of the Business Add-In ME_PROCESS_PO_CUST.
    Changes to standard fields that are part of the Include structure MEPOITEM_TECH and/or MEPOSCHEDULE_TECH are generally not allowed. In addition, no field values that are not changeable through the field settings in the Enjoy transactions can be changed in the BAdI. Correct the implementation accordingly.
    Let me know if anyone face the same issue..
    Regards,
    Kumar

    Hii Shahin ,,
    Thanks for your information but I have done that also  and found Message in Se91 and find message is triggering from another Standard Class CL_PO_HEADER_HANDLE_MM from method IF_FLUSH_TRANSPORT_MM_START so How can we confirm that problem is in Implementation not in method IF_FLUSH_TRANSPORT_MM_START ?
    Thanks

  • Urgent Help Needed in BAdI ME_PROCESS_PO_CUST

    Hello friends,
    I m workin on BAdI ME_PROCESS_PO_CUST , my requirement is to store header level text in po if it is left blank by user , for this i have creadted standard text for every po header text , and implemeted method POST of the badi. so when user is saving the po , i m checking whether all header text is filled by user or not , for this i have called method GET_TEXT , if the text is blank i m reading data from standard text using READ_TEXT function module and setting in perticular text by using method SET_TEXT , every thing is working fine , the respective text ifrom standard text  getting filled to the perticular text of the po , if left blank by the user .  But the actual problem is that when i m going to display the same po again , the text that i was supplied by standard text is not showing in po.
    is there is anything that i missed out , i also done coomit work , but its not working ,
    so please suggest.......
    dont worry abt points

    Dear Mr Mahesh
    I also face similar problem . But my limitation is that I am new to BADI . Sir it will be great help if you can please mail me the steps / procedure and code to be written for implementing the above BADI .
    Sir , I look forward for your kind help please .
    Regards
    B V Mittal
    [email protected]

  • Added custom screen in PO using BADI ME_GUI_PO_CUST and ME_PROCESS_PO_CUST

    Hi All,
    I have added custom screen with two z fields at item level using BADI ME_GUI_PO_CUST and ME_PROCESS_PO_CUST i can see my screen in tcodes ME21N , ME22N , ME23N but I am not able to save data.
    and also screen is coming in change mode even in ME23N .
    thanks.

    Hi,
    I have added two xfields at item level.
    This is the code i have added in zimplementation ZME_GUI_PO_CUST .
    IN Zimplementation ME_PROCESS_PO_CUST I have added code only in method FIELDSELECTION_ITEM . after doing this I can see only screens in ME21N, ME22N, ME23N but when enter data in zfields and trying to save it is giving me message no data has changed.
    method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE.
    DATA: ls_subscriber LIKE LINE OF re_subscribers.
    we want to add a customer subscreen on the item detail tab
      CHECK im_application = 'PO'.
      CHECK im_element     = 'ITEM'.
    each line in re_subscribers generates a subscreen. We add one subscreen in this example
      CLEAR re_subscribers[].
    the name is a unique identifier for the subscreen and defined in this class definition
      ls_subscriber-name = subscreen1.
    the dynpro number to use
      ls_subscriber-dynpro = '0001'.
    the program where the dynpro can be found
      ls_subscriber-program = 'SAPLYMEPOBADIEX'.
    each subscreen needs his own DDIC-Structure
      ls_subscriber-struct_name = 'MEPO_BADI_STRUCT'.
    a label can be defined
      ls_subscriber-label = text-001.
    the position within the tabstrib can be defined
      ls_subscriber-position = 4.
    the height of the screen can be defined here. Currently we suport two screen sizes:
    value <= 7 a sevel line subscreen
    value > 7  a 16 line subscreen
      ls_subscriber-height = 7.
      APPEND ls_subscriber TO re_subscribers.
      ENDIF.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_MODEL.
      DATA: l_item       TYPE REF TO if_purchase_order_item_mm,
            ls_mepoitem  TYPE mepoitem,
            ls_customer  TYPE mepo_badi_exampl.
    system asks to transport data from the business logic into the view
      CASE im_name.
        WHEN subscreen1.
    is it an item? im_model can be header or item.
          mmpur_dynamic_cast l_item im_model.
          CHECK NOT l_item IS INITIAL.
    transport standard fields
          ls_mepoitem = l_item->get_data( ).
    transport customer fields
          CALL FUNCTION 'YMEPOBADIEX_GET_DATA'
            EXPORTING
              im_ebeln = ls_mepoitem-ebeln
              im_ebelp = ls_mepoitem-ebelp
            IMPORTING
              ex_data  = ls_customer.
    store info for later use
          MOVE-CORRESPONDING ls_mepoitem TO dynp_data_pbo.
          MOVE ls_customer-badi_bsgru TO dynp_data_pbo-badi_bsgru.
          MOVE ls_customer-badi_afnam TO dynp_data_pbo-badi_afnam.
        WHEN OTHERS.
      ENDCASE.
    endif.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP.
      CASE im_name.
        WHEN subscreen1.
          CALL FUNCTION 'YMEPOBADIEX_PUSH'
            EXPORTING
              im_dynp_data = dynp_data_pbo.
        WHEN OTHERS.
      ENDCASE.
    ENDIF.
    endmethod.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_DYNP.
      CASE im_name.
        WHEN subscreen1.
          CALL FUNCTION 'YMEPOBADIEX_POP'
            IMPORTING
              ex_dynp_data = dynp_data_pai.
          IF dynp_data_pai NE dynp_data_pbo.
    something has changed therefor we have to notify the framework
    to transport data to the model
            re_changed = mmpur_yes.
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
    ENDIF.
    endmethod.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_MODEL.
    DATA: l_item       TYPE REF TO if_purchase_order_item_mm,
            ls_mepoitem  TYPE mepoitem,
            ls_customer  TYPE mepo_badi_exampl.
    data have to be transported to business logic
      CASE im_name.
        WHEN subscreen1.
    is it an item? im_model can be header or item.
          mmpur_dynamic_cast l_item im_model.
          CHECK NOT l_item IS INITIAL.
          ls_mepoitem = l_item->get_data( ).
    standard fields changed?
         IF dynp_data_pbo-matkl NE dynp_data_pai-matkl OR
            dynp_data_pbo-plifz NE dynp_data_pai-plifz OR
            dynp_data_pbo-webaz NE dynp_data_pai-webaz.
    update standard fields
           ls_mepoitem-matkl = dynp_data_pai-matkl.
           ls_mepoitem-plifz = dynp_data_pai-plifz.
           ls_mepoitem-webaz = dynp_data_pai-webaz.
            CALL METHOD l_item->set_data( ls_mepoitem ).
         ENDIF.
            CALL FUNCTION 'YMEPOBADIEX_GET_DATA'
              EXPORTING
                im_ebeln = ls_mepoitem-ebeln
                im_ebelp = ls_mepoitem-ebelp
              IMPORTING
                ex_data  = ls_customer.
            ls_customer-badi_bsgru = dynp_data_pai-badi_bsgru.
            ls_customer-badi_afnam = dynp_data_pai-badi_afnam.
            CALL FUNCTION 'YMEPOBADIEX_SET_DATA'
              EXPORTING
                im_data = ls_customer.
         ENDIF.
        WHEN OTHERS.
      ENDCASE.
    ENDIF.
    method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM.
    DATA: l_persistent TYPE mmpur_bool.
    CONSTANTS:
    FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection.
    l_persistent = im_item->is_persistent( ).
    *IF l_persistent EQ mmpur_yes.
    READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY
                         metafield = MMMFD_YYMAN_NUM."fd_cust_01.
    IF sy-subrc IS INITIAL.
    <fs>-fieldstatus = '*'. " Display <-- this one was as per the sample code given.
    <fs>-fieldstatus = '+'. " Input <-- this i added to make the field mandatory.
    ENDIF.
    READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY
                         metafield = MMMFD_YYMAN_DES."fd_cust_01.
    IF sy-subrc IS INITIAL.
    <fs>-fieldstatus = '*'. " Display <-- this one was as per the sample code given.
    <fs>-fieldstatus = '+'. " Input <-- this i added to make the field mandatory.
    ENDIF.
    *ENDIF.
    ENDIF.
    endmethod.

  • Rollback BAPI in BADI ME_PROCESS_PO_CUST

    hi guys,
    I used BADI ME_PROCESS_PO_CUST to implement a code before saving the purchase order (Method POST).
    This code contains a BAPI to create a delivery BAPI_OUTB_DELIVERY_CREATENOREF. If this BAPI fails (this is when Return parameter contains 'E' message), I execute function BAPI_TRANSACTION_ROLLBACK.
    Guess what is happening?
    There is no purchase order created even when screen shows message "Standard PO created under the number 45#######".
    What do I want to do?
    - Rollback the bapi executed and let the system continue saving the purchase order.
    - If possible show a message to the user that there is an error, but command MESSAGE doesn't seem to work in this BADI
    Could you share your insights with this wannabe-abapper?
    PD: it says in documentation that it is required ABAP OO to implement this BADI and I think I used it correctly for gathering all data I needed. But I just don't understand why MESSAGE statement and FM POPUP_TO_CONFIRM don't work.

    Hello
    You may try an approach like this:
      IF ( 1 = 1 ).
        MESSAGE 'Creation of outbound delivery failed'  type 'I'.
        data: ld_dummy  type string,
              ls_msg    type SMESG,
              lt_msg    type tsmesg.
          message id '00' type 'E' number '398' with 'Creation of outbound delivery failed'
                                                      space space space into gl_dummy.
        move-CORRESPONDING syst to ls_msg.
        APPEND ls_msg to lt_msg.
        CALL FUNCTION 'FB_MESSAGES_DISPLAY_POPUP'
          EXPORTING
            IT_SMESG              = lt_msg
    *       ID_SMESG_ZEILE        =
    *       IT_RETURN             =
    *       ID_SEND_IF_ONE        =
          EXCEPTIONS
            NO_MESSAGES           = 1
            POPUP_CANCELLED       = 2
            OTHERS                = 3.
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      endif.
    Regards
      Uwe

  • Purchase order ME_PROCESS_PO_CUST  not being called

    Hello,
    I've created an implementation of  ME_PROCESS_PO_CUST, which is automatically migrated to Enhancement (I'm in Netweaver 2004s).
    Then I go to ME21n and the badi is not being called. It is active, I have breakpoints inside the various methods, and I can create a PO from start to finished without opening debug mode.
    Is there any problem with ME_PROCESS_PO_CUST in ECC 6.0?

    hi,
    goto se18 and give definition name and click display button.
    if "multiple use" check box is  not checked means  it is a single use.
    that means for the standard badi definition can any number of implementations,
    but only one will be in active state others in inactive mode.
    u can check all the detail by goingin se18 -> implentation menu->overview
    if implementation is active it will glow in yellow color.all other inactive in blue color (description color).if u want u code to execute go to  others and press(shiftf8) to make others inactive then come to ur code and make it active ctrlf3.
    then it will work.this is for single use.
    for multiple use system will predict its sequences. we abaper no need to worry of the sequences.because if it is multiple use all implementation are in  active stage .so all the code will work in some sort of order.
    thanx
    zenthil

  • ME_PROCESS_PO_CUST~PROCESS_ITEM Shipping data doesn't get populated

    Hi Gurus,
    I need your help to solve one issue while populating shipment data  via 'BAPI_PO_CREATE1' to create a PO I am populating poshipping[] and poshippingx[] with Route field and and also 'X' but the value I am passing it is overwritten by other value.
    Then I have implement ME_PROCESS_PO_CUST BADI method PROCESS_ITEM where I was trying to pass the value what I have pass through my custom program but when PO is created shiping tab is missing.
    Attaching my code written in BADI method:
      ASSIGN (lc_ship_table) TO <lfs_ship_tab>.
        IF <lfs_ship_tab> IS ASSIGNED.
    Retrieve Item level details
          lw_ship = ir_purchase_order_item_mm->get_shipping_data( ).
    Read item
          READ TABLE <lfs_ship_tab> ASSIGNING <lfs_ship_line>
          WITH KEY po_item = lw_ship-ebelp.
          IF sy-subrc EQ 0.
            lw_ship-route = <lfs_ship_line>-route.
            CALL METHOD ir_purchase_order_item_mm->set_shipping_data
              EXPORTING
                IM_EKPV = lw_ship.
    Any suggesions and how to acheive this.
    Dip

    Hello All,
    I am also facing the same problem.
    Can anyone help me to make the standard fields non editable ?
    Either user exit or badi.
    Thanks in advance..
    Regards
    Prapul Kumar

  • User exit in ME22N to change standard fields

    Dear all,
    I'm trying to change the delivery date from exit EXIT_SAPMM06E_013 but the system doesn't keep my changes. I'm able to change the delivery date in exit EXIT_SAPMM06E_017 but I need to make it from exit 013 because I need know the confirmations from tables XEKES/YEKES.
    I'm on release 4.6C and I don't have the chance to use the BADI ME_PROCESS_PO_CUST.
    Is there a way to make this from exit 013?
    Here is the code I'm trying to use:
      DATA : wa_table(100) TYPE c,
             t_ett         TYPE STANDARD TABLE OF beket,
             wa_ett        TYPE beket.
      FIELD-SYMBOLS: <fs_ett> TYPE ANY TABLE.
      IF sy-tcode = 'ME22N'.
        wa_table = '(SAPLMEPO)ETT[]'.
      ELSEIF sy-tcode = 'ME22'.
        wa_table = '(SAPMM06E)ETT[]'.
      ELSE.
        EXIT.
      ENDIF.
      ASSIGN (wa_table) TO <fs_ett>.
      t_ett[] = <fs_ett>[].
      LOOP AT t_ett INTO wa_ett.
        IF sy-tcode(4) = 'ME21'.
          wa_ett-eindt = sy-datum.
        ELSEIF sy-tcode(4) = 'ME22'.
          wa_ett-eindt = sy-datum.
          wa_ett-updkz  = 'U'.
        ENDIF.
        MODIFY t_ett FROM wa_ett.
      ENDLOOP.
      <fs_ett>[] = t_ett[].
      UNASSIGN <fs_ett>.
    Thanks for your help.
    Elio

    Hi,
    I am facing the same pbm.
    I am trying to change PO Order Qty (Menge) based on a formula.
    I have tried writting the code at the exits :
    EXIT_SAPMM06E_016 and EXIT_SAPMM06E_013
    I am also working on REL 4.6c. facing the same pbm. The value does not stay...!!
    By now, you must have resolved the pbm.
    How did you?
    Regards,
    remi

  • FIELDSELECTION_ITEM method in ME_PROCESS_PO_CUST Badi

    Hi all, this question was posted before but looks not answered directly so I am posting again as I have similar problem.
    We have implemented BADI ME_PROCESS_PO_CUST especially on method FIELDSELECTION_ITEM, I look at the sample code and apply almost the same logic in our implementation of this badi. We implemented FIELDSELECTION_ITEM method, however, no matter what breakpoint I put on this method, the debugger does not stop.
    In some methods such as OPEN, PROCESS_ITEM, PROCESS_HEADER, etc, they are all ok, i.e., it stop at the breakpoint.
    Looks like this method is not being triggered. My question is at what point is this method being triggered?
    Anything we missed here? Or any prerequisite I need to do before.
    Pls advise.
    Thanks in advance.
    UPDATE: I ask SAP about this and they told me that this is only applicable to custom fields and not for SAP standard fields. They acknowledged that the documentation is somehow wrong since it did not say that it is only restricted to custom fields.
    Message was edited by: ABAPOne

    Hello,
    I was wondering if found an answer to your question (abou the debugger). I have a similar problem.
    Thank you,
    Jennet

  • PROCESS_HEADER not fired in BADI ME_PROCESS_PO_CUST

    Dear experts,
    I face the problem, that the method PROCESS_HEADER of BADI ME_PROCESS_PO_CUST is not fired, when I am changing po header text. My requirement is to set a customer po header field, whenever a po header text is existent.
    Does anybody know, if this is the standard behaviour and how I can work around it?
    Thanxs

    Hi Aparna,
    actually I tried this, too.
    In the methods Check and Post (which both are fired normally) I coded my requirements, but in this methods I faced the problem that I was not able to save my programatic header field changes. (Even with the trick to cast the IM_HEADER to CL_PO_HEADER_HANDLE_MM to allow changes of internal attributes, used in method set_data(), any changes of po header fields were not saved.) But maybe I am wrong with my implementation? You may have a look:
      DATA: lv_val_id TYPE thead-tdid.
      DATA: lv_val_name TYPE thead-tdname.
      DATA: lv_val_object TYPE thead-tdobject.
      DATA: p_mepo_header TYPE MEPOHEADER.
      DATA: it_tline TYPE TABLE OF TLINE.
      DATA: lv_cl_po_header_handle_mm TYPE REF TO CL_PO_HEADER_HANDLE_MM.
    check existents of po header text
      lv_val_id = 'F09'.
      p_mepo_header = im_header->get_Data( ).
      lv_val_name = p_mepo_header-ebeln.
      lv_val_object = 'EKKO'.
      CALL FUNCTION 'READ_TEXT'
      EXPORTING
          client = sy-mandt
          id = lv_val_id
          language = sy-langu
          name = lv_val_name
          object = lv_val_object
        TABLES
          lines = it_tline
        EXCEPTIONS
          ID = 1
          LANGUAGE = 2
          NAME = 3
          NOT_FOUND = 4
          OBJECT = 5
          REFERENCE_CHECK = 6
          WRONG_ACCESS_TO_ARCHIVE = 7.
    any text there, then update customer po header field
      IF sy-subrc = 0.
        p_mepo_header-zzfield = 'X'.
      else.
        p_mepo_header-zzfield = ' '.
      endif.
    QD
      lv_cl_po_header_handle_mm ?= im_header.
      lv_cl_po_header_handle_mm->my_cust_firewall_on = 'X'.
      im_header->set_Data( p_mepo_header ).
      im_header->set_changed( ).
    po is still same as before and field zzfield was not updated.

  • MEPO151 - ME_PROCESS_PO_CUST / IF_FLUSH_TRANSPORT_MM~START

    Dear All,
    I'm using ME_PROCESS_PO_CUST (PROCESS_ITEM) to make some modifications. Everything is working ok but when I want to create a PO with reference to another PO, after I press Adopt button - the system issues this message.
    As I read in the information about this error message - it seems the problem is in my coding for ME_PROCESS_PO_CUST. I did not understand what I should change .... If somebody can give me a sample code for how I should use set_data method (it seems this one is the problem) - please do it.
    Thanks.
    Florina R.

    A sample where some log fields are appended to standard tables and automatically filled.
    An internal table of lines already updated (2 tables actually), and some fields, are defined as an instance attributes of the implementation class
    In open method such attributes are initialized
    * Initialize
      me->trtyp = im_trtyp.
      REFRESH me->t_matnr_displayed.
      REFRESH me->t_item_updated.
    In process item some fields are updated first time the method is triggered (if user change a data)
    ls_item = im_item->get_data( ).
    READ TABLE me->t_item_updated WITH TABLE KEY table_line =  ls_item-ebelp TRANSPORTING NO FIELDS.
    IF sy-subrc NE 0.
      INSERT ls_item-ebelp INTO TABLE me->t_item_updated.
      im_item->get_persistent_data( IMPORTING ex_data = ls_item_old EXCEPTIONS no_data = 1 OTHERS  = 2 ).
      IF sy-subrc NE 0.
        " Added line - update some fields
      ENDIF.
        " Changed line - update some fields
      ENDIF.
      im_item->set_data( ls_item ).
      ENDIF.
    ENDIF.
    This is just a sample, adapt to your change logic.
    Regards,
    Raymond

  • How to issue warning message in BADI ME_PROCESS_PO_CUST

    Hi Guys,
    I have already checked the forum regarding this. There are lots of threads. Unfortunately none of them helped me. I must be missing some thing in my code.
    I tried issuing warning message in BADI ME_PROCESS_PO_CUST and method PROCESS_ITEM.
    First i tried with normal message statement
    MESSAGE w001(00) WITH text-001 text-002.
    Didn't worked.
    Next tried calling standard macros
      DATA:mmmfd_cust_01 TYPE mmpur_metafield VALUE 90000000.
      call method cl_contextfield_mm=>set_current_field
                                      exporting im_field = mmmfd_cust_01.
      mmpur_metafield mmmfd_cust_01.
    mmpur_message_config 'W' 'X' ' '.      "Tried all permutations here
    mmpur_message_forced 'W' '00' '001' text-001 text-002 '' ''.
    Still no solution
    Tried with macro mmpur_message also
    Can some one helpme out to solve this issue.
    Thanks,
    Vinod.

    Hi all,
    Thanks for the responce.
    Not sure whether you have looked into BADI documentation or not. Please check below.
    "Further notes
    The above-mentioned macros are defined in the program MM_MESSAGES_MAC. Please include this program in your own application.
    Never issue messages in BAdI ME_GUI_PO_CUST! This is the task of the business logic and must therefore be done via the BAdI ME_PROCESS_PO_CUST.
    "Never use the ABAP statement MESSAGE in the BAdI ME_PROCESS_PO_CUST. Please use the macro mmpur_message_forced only. This macro only writes a message in the message collector.
    If you wish to mark the business object as invalid in order to prevent posting, you must additionally use the INVALIDATE ( ) method of the relevant interface. In this connection, see also the code example in the PROCESS_ITEM method of the BAdI ME_PROCESS_PO_CUST.
    I have tried almost all macros including mmpur_message_forced 'E' 'ME' '083' l_text ' '  ' '  ' '.
    Not sure where i am missing:(
    If i give error using MESSAGE statement it is working perfectly i.e. give error and save the PO. Only wanted to know if there are any implications.
    Thanks,
    Vinod

  • How to Assign Custom Search Help to the standard tcode ME53N.

    Hi All,
    Can any help me  out.
    I have created a custom Collective Search ZH_T023_MEPO, I want it to be assigned it to the Tcode ME53N. Replacing the standard one H_T023_MEPO. and i also need to restrict it for only one Plant for other Plantu2019s  standard search help H_T023_MEPO should work as usual

    Hello
    The search help in the item overview (of the purchase order) is H_T023_MEPO whereas in the item details section (tabstrip Material Data ) it is H_T023.
    Thus, there would be at least two search helps that you need to change or modify.
    I would suggest a different approach assuming that your requirement is to restrict the search help under certain conditions (e.g. plant). Implement the BAdI ME_PROCESS_PO_CUST and implement two methods:
    PROCESS_ITEM = check material group of item and invalidate if required
    (IF_PURCHASE_ORDER_ITEM_MM~INVALIDATE)
    CHECK = closing check of entire PO (in case of invalid material groups return CH_FAILED = 'X'
    Regards
      Uwe

Maybe you are looking for