Me_process_po_cust

Hi Guys,
I have a question, i have added a field in a user and i want to save it in the purchase order.
I thought that the badi that i have to implement is the me_process_pos_cust, but when i try to locate it putting a break point in the method get_instance of th class cl_Exithandler and i push save in the me22n transaction this badis name does not appear.
Is there a new badi?
BEst Regards
Jon
Moved to the right forum
Edited by: kishan P on Sep 1, 2010 2:10 PM

Hi Jon,
Try to use this badi or this exit.
ME_PURCHDOC_POSTED .
'EXIT_SAPMM06E_013'
Both exits triggers while PO is saved.
IF active NE space.
*-User Exit:
    CALL FUNCTION 'EXIT_SAPMM06E_013'
      EXPORTING
        i_ekko     = ekko
        i_ekko_old = ls_ekko_old
        i_logsy    = ekko-logsy
        i_vorga    = t160-vorga
      TABLES
        xeket      = lt_usr_xeket
        xekkn      = lt_usr_xekkn
        xekpo      = lt_usr_xekpo
        xkomv      = lt_usr_xkomv
        yeket      = lt_usr_yeket
        yekkn      = lt_usr_yekkn
        yekpo      = lt_usr_yekpo
        ykomvi     = lt_usr_ykomv
        xekbes     = lt_usr_xekbes
        xekes      = lt_usr_xekes
        xekeh      = lt_usr_xekeh
        xekek      = lt_usr_xekek
        xeina      = lt_usr_xeina
        xeine      = lt_usr_xeine
        yeina      = lt_usr_yeina
        yeine      = lt_usr_yeine
        yekes      = lt_usr_yekes
        yekeh      = lt_usr_yekeh
        yekek      = lt_usr_yekek
        xbatu      = lt_usr_xbatu
        xekpa      = lt_usr_xekpa
        yekpa      = lt_usr_yekpa
        xekpv      = lt_usr_xekpv
      EXCEPTIONS
        OTHERS     = 0.
  ENDIF.
*- BAdI ME_PURCHDOC_POSTED
  IF NOT badi_purchdoc_inst IS INITIAL.
    CALL METHOD badi_purchdoc_inst->posted
      EXPORTING
        im_vorga    = t160-vorga
        im_ekko     = ekko
        im_ekko_old = ls_ekko_old
        im_ekpo     = lt_usr_xekpo
        im_ekpo_old = lt_usr_yekpo
        im_eket     = lt_usr_xeket
        im_eket_old = lt_usr_yeket
        im_ekkn     = lt_usr_xekkn
        im_ekkn_old = lt_usr_yekkn
        im_komv     = lt_usr_xkomv
        im_komv_old = lt_usr_ykomv
        im_ekbes    = lt_usr_xekbes
        im_ekes     = lt_usr_xekes
        im_ekes_old = lt_usr_yekes
        im_ekeh     = lt_usr_xekeh
        im_ekeh_old = lt_usr_yekeh
        im_ekek     = lt_usr_xekek
        im_ekek_old = lt_usr_yekek
        im_eina     = lt_usr_xeina
        im_eina_old = lt_usr_yeina
        im_eine     = lt_usr_xeine
        im_eine_old = lt_usr_yeine
        im_batu     = lt_usr_xbatu
        im_ekpa     = lt_usr_xekpa
        im_ekpa_old = lt_usr_yekpa
        im_ekpv     = lt_usr_xekpv
      EXCEPTIONS
        OTHERS      = 0.
  ENDIF.
I hope this may helpfull.
Thank you,
Thanks,
AMS

Similar Messages

  • Error Message: Data from Business Add-In ME_PROCESS_PO_CUST not transferred

    Hi All,
    I have done a BADI implementation for ME_PROCESS_PO_CUST and when I try to convert a PR to PO using ME59N in ECC u2013 AFS System I am getting below error message.
    Data from Business Add-In ME_PROCESS_PO_CUST not transferred.
    I am trying to populate certain PO fields ( ekko and ekpo ) from PR fields. But the above error occurs when I update the Ex Factory Date manual that is EKPO-J_3AEXFCM.
    I am updating this in the method PROCESS_ITEM and what I found while debugging is in the class CL_PO_HEADER_HANDLE_MM, in the implementation of IF_FLUSH_TRANSPORT_MM~START, the contents of field u2018my_iteration_countu2019 keeps increasing and becomes 10 and raises this error.
    I read few of the related questions raised by others in this forum and understood that this can happen if I try to change the field that is disabled ( greyed) in ME22N. But this field that I am talking about is enabled.
    I also tried to move my code of populating the field EKPO-J_3AEXFCM from the PROCESS_ITEM to the enhancement point just above the user exit EXIT_SAPMMO6E_018 but still it doesnu2019t resolve the error.
    (We donu2019t want to use User Exit and hence we are trying with BADIs or enhancement point.)
    Can anyone please help me with this. I also found an OSS note 1334046 but not sure if that can resolve my issue.
    Thanks in advance.
    Ameesha.

    Hi Ameesha,
    i think u need to implement the BADI ME_PROCESS_PO_CUST in SPRO settings.
    SPRO>Purchasing>Business Add-in Purchasing-->BAdI: Enhance Processing of Enjoy Purchase Order
    try this once.
    All check this link.
    [Error Message: Data from Business Add-In ME_PROCESS_PO_CUST not transferred;
    Hope it helps.
    Regards,
    Raj

  • Custom tab data not saving in ME22N w/ BAdI ME_PROCESS_PO_CUST

    Hello all,
    I have implemented BAdis ME_PROCESS_PO_CUST & ME_GUI_PO_CUST and created a custom tab at the header level in ME21N/ME22N. I have fields such as Delivery Date and Ex Factory Date in my tab.
    We are able to put data in these fields and have that data populate their respective fields in the Purchase Order.
    Our users would like to be able to run ME22N and select certain line items and have only those items changed with the data from the custom fields. 
    So, my question is how do I handle line selection in the context of these BAdIs?  Is there a way to know which lines have been selected and then only change the data in those items?
    I have looked in Class CL_PO_ITEM_HANDLE_MM for an attribute or method that might help but I haven't found anything as of yet. 
    I have found that the field MEPO1211-TCSELFLAG is set when a line is selected in ME22N.  However, I haven't found a way to work with it.  It doesn't get passed to any of the methods in the BAdIs, as far as I know. 
    January 27, 2012  **************
    We were able to capture the lines selected by using code from method mass_change in Include LMEGUICJK, Function Group MEGUI.  The lines are in the lt_models table. 
    So, now my issue is getting data to save in ME22N.  When I put data in my custom tabs and select a line, the data gets changed on the screen but does not save.  It does work when I make a change in another field, like changing the description for instance.  I'm using the set_changed method in Process_Header from ME_PROCESS_PO_CUST but it doesn't work. 
    I'm getting the idea that I'm the first ABAP developer to try this...
    Thanks for any help.
    Kind Regards,
    Chris
    Edited by: Chris  Mowl on Jan 11, 2012 10:33 AM
    Edited by: Chris  Mowl on Jan 11, 2012 4:24 PM
    Edited by: Chris  Mowl on Jan 27, 2012 10:57 AM
    Edited by: Chris  Mowl on Jan 27, 2012 2:00 PM

    Hi,
    Checkout the below link :
    <link to blacklisted site removed by moderator>
    Shailaja Ainala.
    Edited by: Thomas Zloch on Jan 28, 2012 9:06 PM

  • 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.

  • ME_PROCESS_PO_CUST allows save in ME21n despite error message triggered

    Hello MM Experts,
    We have a business requirement to prohibit the use of account assignment "A" (assets) on 2 particular document types that are used by departmental end users that should NOT be allowed to buy assets.  The purchase of assets is retricted to our centralized purchasing buyers who use a different document type. 
    We recently upgraded to ECC 6.0 from 4.6c, so we want to try BADi ME_PROCESS_PO_CUST instead of a user exit.  We applied the BADi to ME21n and the developer referenced methods 'check' and 'save', as well as 'post' and 'close'. 
    Our new error message is successfully triggered when a check is done in ME21n (error says "Account Assignment "A" is only valid for PO's and CSO's).  But, depending on the sequence of entry steps for required fields, when I use the save icon or do another check, the box "SAVE" or "EDIT" appears.  You can then save the order and by pass the error message. 
    Other times, depending on a different sequence of entries in the ME21n screen, for the required fields, the correct box "HOLD" or "EDIT" appears and you cannot save the order with the incorrect account assignment A/asset (you can only correct it or hold it as a faulty order and correct later).
    Thanks for any advice,
    Suzanne

    Dear Suzanna ,
    In that case, you need to track all of the "action" or "button" in ME21N, you need to use "sy-ucomm" in the badi code to track all the check. like when you display a PO in ME23N than you switch to change mode, then the sy-ucomm = METOGG, and so on, tell the abaper to use sy-ucomm,there'll know about it.

  • 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

  • ME_PROCESS_PO_CUST Plant and Cost Center Validation Isuue

    Hi Friends,
                      I have a requirement to validate ME21N PO creation with Account assignment 'K'. In our Business Process, we have 2 plants lets say 3000 and 5000. Plant 3000 is linked to Business Area say 4000 and Plant 5000 is linked to Business Area 9000. Now we have unique cost center assignment in both Business areas.
    My requirement is when i enter wrong cost center then system has to validate it with plant and has to pop up error message in PO creation. With BADI ME_PROCESS_PO_CUST, i am able to populate the error message when i enter wrong cost center but i can save the PO which is wrong.
    Please help me on this issue.
    I have written in my logic in BADI ME_PROCESS_PO_CUST -> PROCESS_ACCOUNT.
    Thanks,
    -Ziad

    hello ziad
    Some sample code, same code is there in POST also. just refer it, not as per your requirement.
    CHECK
    METHOD if_ex_me_process_po_cust~check.
    Konstanten
      CONSTANTS: lc_e(1)  TYPE c VALUE 'E',
                 lc_x(1)  TYPE c VALUE 'X',
                 bsart    TYPE bsart VALUE 'FO',
                 ekorg    TYPE ekorg VALUE 'REPL'.
      DATA: ls_mepoheader TYPE mepoheader.
      INCLUDE mm_messages_mac.
    Rechungspläne müssen mit der Belegart FO und in der
    EKORG = REPL angelegt sein
    Get header data
      ls_mepoheader = im_header->get_data( ).
      IF ls_mepoheader-bsart EQ bsart AND ls_mepoheader-ekorg NE ekorg.
    Create Message
        mmpur_message_forced
                lc_e
                'ZI_MM'
                '007'
                ls_mepoheader-bsart
                ls_mepoheader-ekorg
        CALL METHOD im_header->invalidate( ).
      ELSEIF ls_mepoheader-bsart NE bsart AND ls_mepoheader-ekorg EQ ekorg.
    Create Message
        mmpur_message_forced
                lc_e
                'ZI_MM'
                '008'
                ls_mepoheader-bsart
                ls_mepoheader-ekorg
        CALL METHOD im_header->invalidate( ).
      ENDIF.

  • How to fetch newly updated item data in BADI  ME_PROCESS_PO_CUST?

    Hi Everyone,
    While changing a PO, I have a requirement where I need to only modify fields of newly added items of a purchase order and keep the values of existing items as it is. I have implemented the BADI ME_PROCESS_PO_CUST for this. but not able to know how to achieve this requirement. please suggest a solution.
    Thanks and Regards,
         Indudhar P.G

    Hi,
    interfaces for PO header and item have method is_persistent. This method returns true if the item/header is persistent which is equal to that it has been written to DB. So new items are not be persistent and old items are persistent.
    Cheers

  • BADI ME_PROCESS_PO_CUST

    hi experts,
    we are using me59n to create the stock transfer orders from stock transport requisitions. the requirement is during the creation of STO we need to stop the creation of STO for some of the STR based on custom logic. the logic needs the STR number.
    i tried "check" method  of BADI ME_PROCESS_PO_CUST and it seems working. i was able to stop the creation of PO based on some condition. but, in the actual requirement i need to to know STR ( that is purchase requisition number ) number in the method. based on the values in STR i need to stop the PO creation. i have checked the import parameters of the method but could not find anything.
    but when i went inside IM_HEADER associated type IF_PURCHASE_ORDER_MM I this is the importing parameter of the "check" method) i found a method IF_MESSAGE_OBJ_MM~GET_PARENT. I am not sure whether this will help? or is there any other way u think i can get the STR number in this method.
    or is there any other BADI / exit to meet this requirement.
    thanks

    no replies from anybody

  • BADI ME_PROCESS_PO_CUST for changing header data

    Hello Experts,
    I'm using Method PROCESS_HEADER in Badi ME_PROCESS_PO_CUST in order to change some header data.
    I want to change header data depending on the partner data which are on header level.
    It works fine as long as there are data changed in the header or item level and not only on the partner screen.
    The method in this Badi isn't processed if only partner data are changed. But for me it is necessary to set a special field on the header depending on the partner data.
    Regards,
    Sven

    Hi,
    Firstly, for changing Header data without any INSERT/UPDATE?MODIFY statement, badi - ME_PROCESS_PO_CUST  will not be useful.
    As method you mentioned has no header parameters under CHANGING / EXPORTING clause.
    You can use the badi which has the parametrs you want in either change/ Export mode. It can be defined under table also.
    Below is the list of important badis gettign called, however none of them contains header values in change/export clause.
    ME_CCP_ACTIVE_CHECK
    MD_STOCK_TRANSFER
    ME_DEFINE_CALCTYPE
    ME_PO_PRICING
    ME_FIELDSTATUS_STOCK
    ME_COMMITMENT_STO_CH
    ME_COMMITMNT_PARKING
    ME_INFOREC_SEND
    ME_CHECK_SOURCES
    ME_PURCHDOC_POSTED
    Instead you can use enhacement MM06E005  Customer fields in purchasing document.
    Create a project under Transaction CMOD.
    Assign enhancement as Project component.
    You'll find Exit 012. At time of save you can change header im_ekko based on you parterner data tab.
    Regards,
    Amee.

  • 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

  • BADI - ME_PROCESS_PO_CUST - To update Condition Types at time of creation

    Hi All
    I'm relatively new to Implementing BADIs. I'm using the BADI ME_PROCESS_PO_CUST.
    I have to update certain condition types with values determined from a custom table maintained for related Vendors.
    I have created a 'Z' implementation for ME_PROCESS_PO_CUST and activated the implementation. But when I try to create a PO, the code doesn't seem to be execute!
    Following is the code bundle -
    METHOD if_ex_me_process_po_cust~process_header .
      DATA : l_items TYPE purchase_order_items.
      DATA : l_single TYPE purchase_order_item.
      DATA : l_item_cond TYPE mmpur_tkomv.
      CALL METHOD im_header->get_items
        RECEIVING
          re_items = l_items.
      LOOP AT l_items INTO l_single.
        CALL METHOD l_single-item->get_conditions
          IMPORTING
            ex_conditions = l_item_cond.
      ENDLOOP.
    ENDMETHOD.       "IF_EX_ME_PROCESS_PO_CUST~PROCESS_HEADER
    Could you please give me your inputs on this?
    Regards
    Kripal
    [email protected]

    Kripal,
           The method PROCESS_HEADER gets trigerred only when you make an entry in any of the header fields and then press ENTER or do some action.
    For a simple case of analysis put a break-point at
    CALL METHOD im_header->get_items
    RECEIVING
    re_items = l_items.
    in your code.
    Now if you execute ME21N you will see that the code will not get triggered.But make an entry for one of the fields say fpr purchasing organisation.Now if you press ENTER or click on any other tab your code will get triggered.
    Hope this helps.
    <i>Reward helpful answers</i>
    Cheers
    Nishanth

  • 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

  • Badi ME_GUI_PO_CUST and ME_PROCESS_PO_CUST

    Dear All,
    I am implementing a customer subscreen in the PO header. I have created the screen, implemented both Badi's int following way.
    Somehow, the customer data is not getting saved. It is not being passed into the Badi's, am not sur what I have missed because I have implemeted it exactly like the example implementation, only the example is for item and I am using a PO Header subscreen. This is what I have done, please suggest.
    First in ME_GUI_PO_CUST
    Methods :-
    METHOD if_ex_me_gui_po_cust~subscribe .
      ls_subscriber-name = subscreen1.
      ls_subscriber-dynpro = lc_dynpro.
      ls_subscriber-program =  lc_repid.
      ls_subscriber-struct_name = lc_struc.
      ls_subscriber-label = text-001.
      ls_subscriber-position = 10.
      ls_subscriber-height = 7.
      APPEND ls_subscriber TO re_subscribers.
    ENDMETHOD.
    METHOD if_ex_me_gui_po_cust~map_dynpro_fields .
      FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.
      LOOP AT ch_mapping ASSIGNING <mapping>.
        CASE <mapping>-fieldname.
          WHEN 'ZZDEPT'.
            <mapping>-metafield = mmmfd_cust_01.
        ENDCASE.
      ENDLOOP.
    ENDMETHOD.
    METHOD if_ex_me_gui_po_cust~transport_from_model .
      DATA: l_header       TYPE REF TO if_purchase_order_mm,
            ls_mepoheader  TYPE mepoheader,
            ls_customer  TYPE ci_ekkodb.
      CASE im_name.
        WHEN subscreen1.
          mmpur_dynamic_cast l_header im_model.
          CHECK NOT l_header IS INITIAL.
          ls_mepoheader = l_header->get_data( ).
          MOVE ls_mepoheader-zzdept TO dynp_data_pbo-zzdept.
          MOVE gs_data-zzdept TO dynp_data_pbo-zzdept.
        WHEN OTHERS.
      ENDCASE.
    ENDMETHOD.
    METHOD if_ex_me_gui_po_cust~transport_to_dynp .
      CASE im_name.
        WHEN subscreen1.
          CALL FUNCTION 'ZF00MM_POHEADER_PUSH'
            EXPORTING
              im_dynp_data = dynp_data_pbo.
        WHEN OTHERS.
      ENDCASE.
    ENDMETHOD.
    METHOD if_ex_me_gui_po_cust~transport_from_dynp .
      CASE im_name.
        WHEN subscreen1.
          CALL FUNCTION 'ZF00MM_POHEADER_POP'
            IMPORTING
              ex_dynp_data = dynp_data_pai.
          IF dynp_data_pai NE dynp_data_pbo.
            re_changed = mmpur_yes.
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
    ENDMETHOD.
    METHOD if_ex_me_gui_po_cust~transport_to_model .
      DATA: lv_header       TYPE REF TO if_purchase_order_mm,
            lw_ekkodb       TYPE mepoheader.
      CASE im_name.
        WHEN subscreen1.
          mmpur_dynamic_cast lv_header im_model.
          CHECK NOT lv_header IS INITIAL.
          lw_ekkodb = lv_header->get_data( ).
          IF dynp_data_pbo-zzdept NE dynp_data_pai-zzdept.
            MOVE dynp_data_pai-zzdept TO lw_ekkodb-zzdept.
            gs_data-zzdept = lw_ekkodb-zzdept.
          ENDIF.
          lv_header->set_data( lw_ekkodb ).
      ENDCASE.
    ENDMETHOD.
    ME_PROCESS_PO_CUST
    Set the field status in method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER
    METHOD if_ex_me_process_po_cust~open .
      DATA: ls_mepoheader TYPE mepoheader.
      CHECK im_trtyp EQ 'V' OR im_trtyp EQ 'A'.
      ls_mepoheader = im_header->get_data( ).
      SELECT SINGLE zzdept FROM ekko INTO gs_data_old-zzdept
                          WHERE ebeln = ls_mepoheader-zzdept.
      gs_data = gs_data_old.
    ENDMETHOD.
    METHOD if_ex_me_process_po_cust~post .
      DATA: ls_mepoheader  TYPE mepoheader.
      ls_mepoheader = im_header->get_data( ).
      ls_mepoheader-zzdept = gs_data-zzdept.
    ENDMETHOD.
    Can somebody please suggest what is going wrong ? All the methods are being called but the field ZZDEPT is not being transferred into the BADI structures and hence is not saved/changed or displayed.
    Appreciate your help.
    Thanks in advance.
    Edited by: SAP ABAPer on Jan 25, 2010 4:55 PM

    Tried very hard to improve the formatting of the post, but it doesn't seem to work for me !!

Maybe you are looking for

  • Troublesho​oting Dropped Camera Frames

    Hi there, I'm using Point Grey Flea3 gigE cameras in LabVIEW, and on some computers the camera seems to be dropping frames. Though I don't get a blank frame, I get a noisy frame without the objects I am looking at. I have attached two example picture

  • Using a Contract upgrade to get an unlocked version of the phone

    I have the ability to upgrade my phone on the at&t network but instead of getting the version that favors at&t network could i some how get or ask for the CDMA version of the phone such as online or by asking for it at the store?? Is that possible wi

  • Is there any way i can keep pages documents and numbers documents in the same file?

    Im trying to group pages and numbers documents in the same file is this possible?

  • Posting stock lot wise

    Hello all, Can any one can tell me once the usage decision is done for a lot. Now my stock quantity is in block state i want it to be in unrestricted state. how can i do it. I know through mb1b i can do but there i can transfer the stock for the whol

  • Graph control reference array conflict

    My vi has 6 graphs, and I need to modify them through property nodes through out my vi, so I wanted to store all the graph references into an array and pass it along.  When I do that, I am getting a class conflict between my input array and array in