BADI ME_PROCESS_PO_CUST get item nr

Hi experts,
I would like to get the item number EBELP in a purchase order ME21N, ME22N.
My problem is that when I change of item, I can't get the item n° in the BADI ME_PROCESS_PO_CUST
Thks for help,
Ant

Yes , you can get that values.check this .
badi: ME_PROCESS_PO_CUST
method:PROCESS_ITEM
data:ls_mepoitem TYPE mepoitem,
       ls_mepoitem_prev TYPE mepoitem,
    ls_mepoitem = im_item->get_data( ).
    CLEAR ls_mepoitem_prev-netpr.
    SELECT SINGLE netpr FROM ekpo
    INTO ls_mepoitem_prev-netpr
    WHERE ebeln = ls_mepoitem-ebeln
      AND ebelp = ls_mepoitem-ebelp.
      if  ls_mepoitem-netpr GT ls_mepoitem_prev-netpr.
       MESSAGE 'Not Allowed to change values of Previous years WBS'
        TYPE 'E'.
        ENDIF.

Similar Messages

  • 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

  • HAVE TO Generate IDOC in badi ME_PROCESS_PO_CUST, UNABLE TO READ ITEM DATA

    ME_PROCESS_PO_CUST                "IMPLEMENTING CLASS
       IF_EX_ME_PROCESS_PO_CUST  " INTERFACE
         POST                                         "METHOD
    POST HAS TWO PARAMETERS
    IM_EBELN
    IM_HEADER TYPE REF TO IF_PURCHASE_ORDER_MM
    IF_PURCHASE_ORDER_MM   "INTERFACE
        GET_DATA                          "METHOD , WORKIG FINE
        GET_ITEMS            "METHOD
    GETI_ITEMS HAS PARAMETER REITEMS
    REITEMS IS TABLE TYPE PURCHASE_ORDER_ITEMS
    WHICH IS LINE TYPE PURCHASE_ORDER_ITEM
    AND THIS LINE TYPE HAS FIELD
    ITEM WHICH IS TYPE IF_PURCHASE_ORDER_ITEM_MM
    AND AGAIN IN THIS INTERFACE THERE IS METHOD GET_DATA TO GET ITEM DATA.
    PLEASE SUGGEST ME HOW TO ACCESS  ITEM DATA ,
    IF POSSIBLE PLEASE WRITE THE CODE AS I AM VERY POOR  AT 'OOPS' AND ITS VERY VERY URGENT.
    THANKS AND REGARDS
    Edited by: TRY-N-TRY on Jan 7, 2008 6:23 PM

    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.

  • BADI ME_PROCESS_PO_CUST not getting triggered

    Hello Experts,
    i implemeted BADI ME_PROCESS_PO_CUST to ZME_PROCESS_PO_CUST.
    there is only one badi implemented for this.
    And it is working fine in development and transported to Quality system.
    in Quality system this badi itself is not getting triggered.
    Please help me any body have any idea about this.
    Thanks in advance
    Mahammad Farooq

    Hi,
      check the below thread:
    LINK[BAdi - ME_PROCESS_PO_CUST  not trigger.;
    if every thing is active then the only issue could be multiple implementatins
    check in table SXC_EXIT to check the status .
    if there are any inactive implementations delete all and put in a request and transport to you QA system.
    Regards,
    Himanshu

  • Reg. Exit/BADI for changing item data of PO in ME22N

    Hi all,
    My requirement is to update the field LABNR (Order Ack.) of few specific line items of a PO, in the Transaction ME22N, using Exit/BADI.
    I have tried the BADI  ME_PROCESS_PO_CUST. But the PROCESS_ITEM method of this BADI processes only the line item which has been changed/inserted in ME22N transaction. But my requirement is to update line items irrespective of whether that line item was "changed/not changed" during the process in ME22N screen.
    Could you please suggest me some suitable Exit/BADI for this requirement.
    Regards,
    Anbarasan K

    Thanks Martin.
    Problem solved by implementing the method Process_Header.
    1. Get the items from Header                              -  im_header->get_items
    2. Loop the item list and get the line item record   - re_item-item->get_data
    3. <- Logic to Update the line item - >.
    4. Update the line item                                       - re_item-item->set_data
    Thank you very much.. Martin.
    Regards,
    Anbarasan K

  • 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

  • User exit/BADI for PO item blocking

    Hi All,
    Is there any userexit/BADI available for blocking PO item?
    We want block PO item based on some header and item data validations. We need an exit which will be triggered before displaying the first screen(In case of PO change-ME22N). While creating/changing existing the item we got the BADI ME_PROCESS_PO_CUST. Here we can set im_item-loekz to value S so that item will be blocked. This is working fine only for creation/Change of item. Because this BADI will be triggered when ever we make some change in existing PO item/Creating new item.
    But say we have blocked a PO item now. later we have maintained necessary data which is used in validations. Then when we enter into same PO for next time it should automatically unblock that item.
    So we need exit which will be triggered before displaying first screen. If one exit is not available the we can use EXPORT/IMPORT logic to get all the data at one place. Hope there is no confusion in the requirement.
    Please let me know if there is any EXIT/BADI available for this scenario.
    Thanks for your help in Advance.
    Does any one has some solution for this?
    Thanks,
    Vinod.
    Edited by: Vinod Reddy Vemuru on Dec 10, 2008 12:37 PM

    Hi vinod,
    I have come accross similar issue of blocking PO at item level. but we wanted to do it using Tcode MEMASSPO .Can you please give any suggestion in this regard.

  • 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

  • Badi: ME_PROCESS_PO_CUST Method: IF_EX_ME_PROCESS_PO_CUST~PROCESS_SCHEDULE

    Hi,
    in method: IF_EX_ME_PROCESS_PO_CUST~PROCESS_SCHEDULE of Badi ME_PROCESS_PO_CUST
    i will get schedule-data and item data.
    I try this:
    METHOD IF_EX_ME_PROCESS_PO_CUST~PROCESS_SCHEDULE.
      DATA: LS_ITEM TYPE MEPOITEM.
      LS_ITEM = IM_ITEM->GET_ITEM( ).
      DATA: LS_SCHEDULE TYPE MEPOSCHEDULE.
      LS_SCHEDULE = IM_SCHEDULE->GET_DATA( ).
      BREAK-POINT.
    ENDMETHOD.
    LS-SCHEDULE are filled correct.
    in Line   LS_ITEM = IM_ITEM->GET_ITEM( ). i get an syntax error -> IM_ITEM are unknown.
    Has anyone an idea how i can get the ITEM Data?
    Thanks.
    Regards, Dieter

    Hi Vinod,
    thanks, it solved my Problem.
    I have another thread for ME_PROCESS_PO_CUST.
    Question to Z_ME_PROCESS_PO_CUST with item catagory L
    Do you have an idea for this problem?
    Thanks.
    Regards, Dieter

  • Implementing Badi ME_PROCESS_PO_CUST

    Hi all,
    I'm trying to implement the BADI ME_PROCESS_PO_CUST, the method PROCESS_ITEM, and I'm trying to change the field ls_positem-lebre, but it doesn't works. I've seen that this field is in the mepoitem_tech structure in the method set_data and it restores this value to his old value, anyone knows how to change this field?
    ..and another question...
    In the same BADI, I'm trying to change the sale's area in the shipping data, but when I call the method set_shipping_data there is a firewall that only allows me to change the fields vstel, lprio, vsbed, route and ablad. Is there any way to change the other fields?
    Thanks,
    Xavi

    Hi,
    By implementing the above badi you can change limited fields at item level.
    I am using this to change the following and it is working fine for me.
    a) Chaning field -- PLIFZ and RESWK and NETPR based on some header conditions
      DATA  : LS_MEPOITEM TYPE MEPOITEM.
      DATA  : ZZPLIFZ TYPE EKPO-PLIFZ.
    Get the Item data
        LS_MEPOITEM = IM_ITEM->GET_DATA( ).
         LS_MEPOITEM-PLIFZ = ZZPLIFZ.
         LS_MEPOITEM-NETPR = V_NETPR.
    Set the Item data
        CALL METHOD IM_ITEM->SET_DATA
          EXPORTING
            IM_DATA = LS_MEPOITEM.
    Try this.
    I hope this will help.
    Message was edited by: Lanka Murthy

  • BADI ME_PROCESS_PO_CUST Implementation is not called

    Hello,
    I have created a test implementation(local object) for BADI ME_PROCESS_PO_CUST and implemented the Process_Item method to compare item price with material master commercial price. I have also activated the implementation.
    When I create a PO using ME21N, this implemenation is not getting called. I have put a breakpoint in the implementation but processing doesn't stops here. Also I am not able to find 'Where used' of the BADI name or the interface 'IF_EX_ME_PROCESS_PO_CUST'.
    What are the reason for above behaviour? Do we maintain this BADI name in some Customizing Table?
    Please help.
    Regards,
    Shubham

    i did the same as you did and the code is clearly getting triggerred.
    Samle Code:
      DATA : l_header TYPE REF TO if_purchase_order_mm.
      DATA : l_conditions TYPE mmpur_tkomv.
      DATA : l_item LIKE LINE OF l_conditions.
      DATA : l_data TYPE mepoheader.
      CALL METHOD im_item->get_header
        RECEIVING
          re_header = l_header.
      CALL METHOD l_header->get_data
        RECEIVING
          re_data = l_data.
      CALL METHOD im_item->get_conditions
        IMPORTING
          ex_conditions = l_conditions.
      CALL METHOD im_item->set_conditions
        EXPORTING
          im_conditions = l_conditions.
    if i put break-point on any of these methods the implementation is getting trigerred.

  • BADI ME_PROCESS_PO_CUST Method:PROCESS_ITEM

    Hi,
    I have to update the vendor material field through BADI ME_PROCESS_PO_CUST.
    I have created an implementation for this BADI.Can anyone help me find the solution for the same.
    Thanks.

    DATA: wa_ekko TYPE ekko,
            wa_ekkn TYPE ekkn,
            wa_ekpo TYPE ekpo,
            wa_vbap           TYPE vbap.
      DATA : lt_item TYPE mepoitem.
      IF im_item->is_persistent( ) EQ mmpur_no. "Only check for new items
    * Retrieve item data into BADI buffer
    *get data
        CALL METHOD im_item->get_data
          RECEIVING
            re_data = lt_item.
        ENDIF.
        SELECT SINGLE * FROM ekko
          INTO wa_ekko
          WHERE reswk NE ''.
        IF sy-subrc EQ 0.
          SELECT SINGLE * FROM ekkn
              INTO wa_ekkn
              WHERE ebeln = wa_ekko-ebeln.
          IF wa_ekkn-vbeln <> ''.
            SELECT SINGLE * FROM ekpo
              INTO wa_ekpo
              WHERE ebeln = wa_ekko-ebeln
              AND   idnlf = ''.
            IF sy-subrc EQ 0.
            SELECT SINGLE * FROM vbap
              INTO wa_vbap
              WHERE vbeln = wa_ekkn-vbeln
              AND   posnr = wa_ekkn-ebelp.
            IF sy-subrc EQ 0.
              lt_item-idnlf = wa_vbap-kdmat.
            ENDIF.
          ENDIF.
        ENDIF.
            ENDIF.
    * Update changes
        CALL METHOD im_item->set_data
          EXPORTING
            im_data = lt_item.

  • Issue with BADI 'ME_PROCESS_PO_CUST'

    Hi People,
           I have a requirement wherein we need to make the Delivery Date in Schedule line of PO as Uneditable. This needs to be done for specific User-Group. Hence I have decided to use the BADI 'ME_PROCESS_PO_CUST' to attain the solution.
    I am facing a problem in using the BADI. I have created 2 different Field Selection(one with editable and other without) through SPRO and  am trying to swap the field selection based on user in the Method 'FIELDSELECTION_ITEM_REFKEYS' of the BADI interface. This swapping doesn't seems to be working. Can anyone give me some idea on why is this not working, Eventhough the Method is getting trigerred.
    Also i have tried the other method 'FIELDSELECTION_ITEM' to make them uneditable by changing the Field Selection Properties. but still no luck as this method not getting trigerred at all.
    Regards,
    Simin Raveendran.

    Hi Simin,
    Did you check the sample code which is delivered with the BADI. This code can be accessed by following:
    GOTO->Sample Code->Display.
    Check the method FIELDSELECTION_ITEM to see an code example. It appears to me that you should do something like that by changing the properties for field mmmfd_deliv_date.
    Below is the documentation for the method FIELDSELECTION_ITEM:
    Special Field Selection Item
    Functionality
    The FIELDSELECTION_ITEM method enables you to influence the field selection properties for a field.
    Parameters
    The following parameters are available:
    IM_HEADER - Document header
    The interface reference is of the type IF_PURCHASE_ORDER_MM.
    IM_ITEM - Document item
    The interface reference is of the type IF_PURCHASE_ORDER_ITEM_MM.
    CH_FIELDSELECTION - Fiele selection table
    By making changes to this table, you can influence the display properties of a field.
    This table consists of value pairs <METAFIELD|FIELDSTATUS>.
    The Metafield represents a business content (e.g. the PO quantity). Thus, for example, the database field EKPO-MENGE is linked to a certain metafield value just like the field MEPO1211-MENGE on the item overview screen in the purchase order.
    Through this abstraction, reference can be made to business contents on a uniform basis.
    Standard metafields are defined in the type group MMMFD.
    The field selection status has four possible instances:
    '-' Field is suppressed
    '*' Field is purely a display field
    '.' Input field
    '+' Mandatory field
    Notes
    Under no circumstances make any changes to the database within this method. On no account use Commits.
    Kind regards,
    Robert

  • BADIs which get triggered in ME25 transaction

    Hi ,
    I want to know the list of BADIs which get triggered in ME25 transaction ONLY.
    Please provide me the list.
    Thanks,
    Shivaa......

    List of BADI's for ME25
    EXTENSION_US_TAXES   Extended Tax Calculation with Additional Data
    ME_ACTV_CANCEL_PO    BAdI for Activating the Cancel Function at Header Level
    ME_BAPI_PO_CUST      Customer BAdI for BAPI_PO_CREATE1 and BAPI_PO_CHANGE
    ME_BAPI_PR_CUST      Customer BAdI for Enjoy Purchase Requisition BAPIs
    ME_BAPI_PR_IBS       BAdI: Enjoy BAPIs for Purchase Requisitions
    ME_BSART_DET         Change document type for automatically generated POs
    ME_CCP_BESWK_AUTH_CH BAdI for authorization checks for procuring plant
    ME_CCP_DEL_DURATION  Calc. of Delivery Duration in CCP Process (Not in Standard)
    ME_CHANGE_CHARACTER  Customer-Specific Characteristics for Product Allocation
    ME_CHECK_ALL_ITEMS   Run Through Items Again in the Event of Changes in EKKO
    ME_CHECK_SOURCES     Additional Checks in Source Determination/Checking
    ME_CIN_LEINRF2R      BADI for CIN India - Delivery charges
    ME_CIN_LEINRF2V      BADI for LEINRF03 excise_invoice_details
    ME_CIN_MM06EFKO      Copy PO data for use by Country version India
    ME_CIP_ALLOW_CHANGE  Configuration in Purchasing: Changeability Control
    ME_COMMITMENT_STO_CH BadI for checking if commitments for STOs are active
    ME_COMMTMNT_PO_REL_C Check for Commitment-Relevance of Purchase Orders
    ME_COMMTMNT_REQ_RE_C Check of Commitment Relevance of Purchase Requisitions
    ME_DEFINE_CALCTYPE   Control of Pricing Type: Additional Fields
    ME_GUI_PO_CUST       Customer's Own Screens in Enjoy Purchase Order
    ME_HOLD_PO           Hold Enjoy Purchase Orders: Activation/Deactivation
    ME_MMPUR_EINM_CUST   BAdI Methods for Processing IDoc Data in the SUS Scenario
    ME_PO_SC_SRV         BAdI: Service Tab Page for Subcontracting
    ME_PROCESS_COMP      Processing of Component Default Data at Time of GR: Customer
    ME_PROCESS_PO_CUST   Enhancements for Processing Enjoy Purchase Order: Customer
    ME_PROCESS_REQ_CUST  Enhancements for Processing Enjoy PReqs: Customer
    ME_PURCHDOC_POSTED   Purchasing Document Posted
    ME_RELEASE_CREATE    BAdI: Release Creation for Sched.Agrmts with Release Docu.
    ME_REQ_OI_EXT        Commitment Update in the Case of External Requisitions
    ME_REQ_POSTED        Purchase Requisition Posted
    ME_TAX_FROM_ADDRESS  Tax jurisdiction code taken from address
    ME_TRIGGER_ATP       Triggers New ATP for Changes in EKKO, EKPO, EKPV
    MM_EDI_DESADV_IN     Supplementation of Delivery Interface from Purchase Order
    SMOD_MRFLB001        Control Items for Contract Release Order

  • 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

Maybe you are looking for

  • How do I unlock my keyboard

    How do I unlock the keyboard on my HP Pavilion dv6.It worked fine until my two year old touched it. I don't know if there is a key to lock and unlock it. It does not work at all.

  • Ichat can't see buddy

    i'm confused, i used to use ichat to video chat with friends regularly and for some reason recently cannot see the person i am chatting with when i attempt a video chat.  the other user can see/hear me, but i can't see/hear them.  help!

  • Metadata for color temperature

    I can't find a metadata entry for Kelvin temperature, in IPTC or EXIF. If I can have the timezone why can't I have the color temperature? Kelvin temp is in the metadata, because I can see it in EOS Utilities. Can I create a custom metadata slot and s

  • Missing Image Data in CS6 screen

    I'm am sporatically encountering missing image data when opened in the CS6 image screen.  Missing data is displayed with transparency grid.  The problem occurs opening an existing PSD or when launching CS6 from ACR.  Reloading the image may or may no

  • How shall I cancel /kill the Batch job that is to be scheduled daily in BI.

    Hello Experts, We have a background batch  job used to trigger an event to execute the Porcess Chain that is to be scheduled daily in BI. Now we don't required this functionality any more.So I try to cancel this job using transaction SM37 but unfortu