Purchase order item - avoid delete

Hi Expert,
I have to make a control to avoid the deletion of an item of purchase order.
In other word, when the user press the delete button in the item of purchase order, I have to check variable A.
If A = 'X' --> avoid delete item, and pop for info
else.
delete item
endif.
How I can make it ? There's a BADI, or an user exit ?
Tks a lot.

Hello,
Please implement the Badi "ME_PROCESS_PO" in that go to
if_ex_me_process_po_cust~process_item.
Write the code
  DATA : re_data TYPE mepoitem.
  DATA : mmmfd_preq_no       TYPE mmpur_metafield VALUE 003.  "Banfnummer
  INCLUDE mm_messages_mac. "useful macros for message handling
  CALL METHOD im_item->get_data
    RECEIVING
      re_data = re_data.
  IF re_data-lokez ne space.
    CALL METHOD im_item->invalidate( ).
    mmpur_metafield mmmfd_preq_no.
  mmpur_message_forced 'E' 'ME' '083' text-003 'Deletion not allowed' '' ''.  ENDIF.

Similar Messages

  • PURCHASE ORDER STATUS :When Deleting ALL ITEMS.

    Hi experts,
    I need  to make purchase order status stay  " Release Compleated " when deleting all items.
    Anyone Know How to do it?
    Or anyone Know how to use BAPI_PO_CHANGE in BAdI : ME_PROCESS_PO_CUST 
    In my project , I use Release Strategy of purchase orders, and there is a case of deleting all items.
    In this situation, purchase order status returns to "Active " and release strategy tab disappears.
    This is our problem.
    I need to make purchase order status stay  " Release Compleated " and prevent  release strategy tab disappearing.
    I tried to update the fields EREKZ(final invoice) and ELIKZ(delivery completed) in
    BAdI : ME_PROCESS_PO_CUST  Method : PROCESS_ITEM using BAPI_PO_CHANGE according to SAP Note 456691.
    But BAPI_PO_CHANGE couldn't update EREKZ because of our customize , and I couldn't find how to use
    BAPI_PO_CHANGE in the BAdI.
    Anyone know solutions to solve this problem?
    Thanks a lot.
    Regards,
    TKD

    Hi,
    please review the following information in SAP Note No. 456691 as
    copied below:
    18. Question:
    When are the header conditions updated if a purchase order item is
    deleted?
    Answer:
    If a purchase order item is deleted, the item is marked as 'statistical'
    (field EKPO-STAPO = X) and the change is reflected in the header
    conditions.
    However, if for the item the final invoice indicator(EKPO-EREKZ) or the
    inward delivery completed indicator (EKPO-ELIKZ) is set, the item is not
    marked as 'statistical' (EKPO-STAPO is not set) and thus the header
    conditions are not updated.
    I hope this helps you
    BR
    Nadia Orlandi

  • MCEKPO-MENGE issue through 2LIS_02_ITM for Statistical Purchase Order Items

    Hello Everyone,
    I have come across this strange scenario where a given Purchase Order Item in the Source system - SAP R/3 has been changed in the following sequence,
    1. First the PO Item was marked as a Deleted PO - LOEKZ = L which set the STAPO = X (Statistical) and
    2. The Deletion Indicator was removed for the PO Item which means LOEKZ now is not having "L" and the STAPO also has been removed.
    Due to the above scenario, now the Order Quantity in the SAP BW system has 0 as the value whereas the Quantity in the SAP R/3 System shows up as 1.
    I was curious to know if there are any OSS Notes or processes in place to avoid this from happening. As I searched the forum and service place for the OSS notes related to this issue and could not find anything related.
    The Order Quantity in our system is extracted from 2LIS_02_ITM (MCEKPO-MENGE) field.
    Thanks in advance for the help.
    Dharma.

    hi Dharma..
    Did you find a solution for this post?
    I Have similar issue....
        I Have an issue (I think is issue)...with extractor 2LIS_02_ITM about reversal or deleted indicator….
    Some PO are created on R/3 and mark for deleted some line items… I try or I hope  received a “R” indicator…. But I didn´t receive the indicator…..
         I only receive “X” on this field.. (delete indicator). or in other examples  blank on this field
        What’s the difference between “X” , “R” and blank indicator?... when is posible receive X, R or blank value??
        I was thinking that when on R/3 some lines of PO orders were deleted.. I receive "R" indicator when I extract to  BW (on the PSA)... but I didn't...
       If you know how work this kind of cases or examples, please explain me more.. or let me know where can I find more information please.
        I will assign points to all the answer.
       Thank you
    Alice

  • How can I terminate the purchase order item?

    Dear all,
    I have created and released a purchase order, which had two items. like following
    Item Material no qty delivery date
    10 Material-A 1000 pcs 12-25-2008
    20 Material-B 300 pcs 12-28-2008
    This purchase order has been released. And the vendor production order had been released and producted too. Item 10 has been producted and deliveried 300 pcs to our company. Now the purchase department asked to terminate the item 10. They didn't want the 700 pcs left.
    So we have to cancel the purchase order item 10. But we couldn't terminate this item.
    How can I do? Please tell me how to do step by step.
    Thank you very much!
    Paul.

    Dear,
    You can't delete purchase order at header level.
    You have to deleter purchase order line item wise.
    You can do it with ME22N t-code.
    Enter t-code ME22N, Select all line item of purchase order and click on delete indicator.
    Otherwise click on Delivery complete indicator of purchase order.
    You can also delete purchase order line item wise with MASS t-code.
    Enter t-code MASS, Select object BUS2012, Go in Field tab and select field MASSEKKO-LOEKZ and click on execute button.
    Then enter your purchase order documents number and enter indicator for deletion as X.
    Regards,
    Sri

  • Controlling the output when purhcsae order item is deleted

    HI
    Here is our scenario, we have two outputs automatically determined ( by condition records) when a purhcase order is changed, now when we delete the purchse order item we want only one put type to be triggered and not the other one.
    NEU    - When the PO line item is deleted  we want  trigger this output
    NEU1  - When the PO line item is deleted  we dont want to trigger this output
    Obviously we cannot  use "Fields Relevant to Printouts of Changes"  config to deactivate the EKPO-LOEKZ field as it impacts both the outputs.
    Is there a way to achieve this?
    Thx,
    Krishna.

    Hi Mohan,
    Thanks for the reply, we did try to use that requiremnet option but then how do you know if the purchase order item is being  deleted?  You have this field in the routinue KOMKBEA-DRUVO which gets pouplated with '2' means change.
    Obviously you cannot do a select query on EKPO because the PO is not yet updated at this point of time.
    Thx
    Krishna.

  • Class for Purchase order item components and Production order components

    I'm looking for a some classes.   I'm very new to objects, so I could be searching for them incorrectly.
    The first class I'm looking for is a purchase order class that contains the item components.  I've looked at CL_PO_ITEM_HANDLE_MM and CL_PO_HEADER_HANDLE_MM.  I couldn't find components as a part of either of the classes.
    The second one I'm looking for is not as critical.  It is for the components for a production order.   I have a function module: BAPI_PRODORD_GET_DETAIL that gets the components for the order.  However, to take advantage of objects - I read somewhere - that if possible I should avoid calling a function module.
    Any help that you could give would be greatly appreciated.
    Thank you!
    Michelle

    Hello Michelle
    I do not think there are already classes available on ERP 6.0 for reading production order (yet I might be wrong...). However, regarding purchase order you are already on the right track.
    *& Report  ZUS_SDN_OO_READ_PO
    *& Thread: Class for Purchase order item components and Production order components
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1206523"></a>
    "& NOTE: Coding adapted from BAPI_PO_GETDETAIL1
    REPORT  zus_sdn_oo_read_po.
    TYPE-POOLS: abap, mmpur.
    PARAMETER:
      p_ebeln   TYPE ebeln  DEFAULT '3000000045'.
    DATA: gs_document    TYPE mepo_document,
          go_po          TYPE REF TO cl_po_header_handle_mm,
          gs_header      TYPE mepoheader,
          gd_tcode       TYPE sy-tcode,
          gd_result      TYPE mmpur_bool.
    data: gt_items       type PURCHASE_ORDER_ITEMS,
          gs_itm         type PURCHASE_ORDER_ITEM,
          gs_item        type mepoitem.
    START-OF-SELECTION.
    *  prepare creation of PO instance
      gs_document-doc_type    = 'F'.
      gs_document-process     = mmpur_po_process.
      gs_document-trtyp       = 'A'.  " anz.  => display
      gs_document-doc_key(10) = p_ebeln.
    *  object creation and initialization
    **  l_ebeln = purchaseorder.
      CREATE OBJECT go_po.
      CALL METHOD go_po->po_initialize( im_document = gs_document ).
      CALL METHOD go_po->set_po_number( im_po_number = p_ebeln ).
      CALL METHOD go_po->set_state( cl_po_header_handle_mm=>c_available ).
    *  read purchase order from database
      gd_tcode = 'ME23N'.
      CALL METHOD go_po->po_read
        EXPORTING
          im_tcode     = gd_tcode
          im_trtyp     = gs_document-trtyp
          im_aktyp     = gs_document-trtyp
          im_po_number = p_ebeln
          im_document  = gs_document
        IMPORTING
          ex_result    = gd_result.
    *  there was a problem in reading the PO
      IF ( gd_result EQ mmpur_no ).
    **    l_messages = l_handler->get_list_for_bapi( ).
    **    PERFORM return TABLES l_messages return
    **                          poitem poschedule poaccount.
    **    CALL METHOD l_po->po_close( ).
      ELSE.
        gs_header = go_po->if_purchase_order_mm~get_data( ).
        WRITE: / gs_header-ebeln,
                 gs_header-bukrs,
                 gs_header-bsart,
                 gs_header-lifnr.
      ENDIF.
      gt_items = go_po->if_purchase_order_mm~get_items( ).
      LOOP AT gt_items INTO gs_itm.
        gs_item = gs_itm-item->get_data( ).
        write: / gs_item-ebelp,
                 gs_item-matnr,
                 gs_item-menge.
      ENDLOOP.
    END-OF-SELECTION.
    Regards
      Uwe

  • Purchase Order Items open vs ME2M discrepancy

    First posting so if this is not the right section please move this topic.  Was the closest I could come to correct forum placement.
    Hello all,  I am in the process of setting up BPM to monitor u201CN* of Purchase Order Items openu201D from various plant locations and I am noticing the number BPM gives is different than what the system you give if I used ME2M.
    For example:  I am setting up BPM to monitor Number of Purchase Order Items Open for plant location 2102.  The set up is scarce and I only have a few fields filled out in the set-up:
    -Document Type u2013 Single Value u2013 NB, UB, FO, ZPC, ZGR
    -Plant (Item) u2013 2102
    -Doc. Category u2013 F (Purchase Order)
    -All of fields are left blank
    When this runs I will get an example of 1487 (it changes on an hourly basis so I canu2019t give a static value).
    When I try to verify this number using ME2M I get a value of 1237.  A difference of 250.
    The configuration I am using for ME2M is as follows:
    -Plant u2013 2102
    -Scope of List u2013 ALLES
    -Selection Parameters u2013 WE101
    -Document Type - NB, UB, FO, ZPC, ZGR
    -All other fields at left blank
    Any reason for this discrepancy?  The closest I can guess is SAP is pulling in some additional information OR my configuration is incorrect.  Anybody run into this issue that has some tips?
    Thank you
    -nic

    I know that ME2M has nothing to due to with BPM.
    I am confused as to why when I set up BPM, in Solution Manager, to monitor Purchase Orders that are open I am getting a different number than when I use the transaction ME2M in SAP ECC.
    For example:
    When the process runs in Solution Manager I get back 1425 open POs
    When I go into SAP ECC and use the transaction ME2M it will only pull up 1175 open POs
    Somewhere along the lines I am missing or adding 250 POs.  The current setup (listed above; not sure if BPM is configured the same for everyone) is listed above.
    I have tried various set-up options in both BPM Solution Manager and SAP ECC (ME2M) but can't seem to find where these additional numbers are coming from.
    Thank you
    -nic

  • Standard program for unbilled  sales orders and purchase order items

    Can anyone advice,  is there any standard program which gives the unbilled sales order and purchase order items.

    Hi,
    Use the T.Code VA05/VA05n for list of all the sales order s which are open.
    Take T.Code:VA05N
    Select the option "Open Sales Orders".
    Execute.
    It will give you all the orders which are open.
    The standard program for this is:"SD_SALES_ORDERS_VIEW".
    The same you can also get by using the T.Code VF04.
    In this if your scenario is "Order related",then select the option "Order related".
    Else if it is "Delivery related",then select "Delivery-related".
    Execute.
    The standatd program for this is:"SDBILLDL".
    T.Code:VF05/VF05n is for list of billing documents.
    Regards,
    Krishna.
    Note:Pls search the forum.

  • In MR11 - u201CNo (suitable) purchase order/item found     u201C.

    Hi Friends,
    We are having issue with MR11 in 4.6 B. While doing MR11 for a PO where Delivery costs have not been balanced, we are getting message u201CNo (suitable) purchase order/item found     u201C.
    In the research, we found that in 4.6 B, MR11 is using program SAPMM08K, where as in ECC 6.00, it is using program SAPRCKM_MR11.
    Initial fetch from PO history table :
    4.6 B -> In 4.6 B we are using EKBI view (Join via EKKO / EKPO / EKBE for MR11) to fetch the PO history table. (It is not considering EKBZ table for delivery cost records)
    Program is checking the Quantity of EKBI, if there is no difference in quantity then it is coming out of loop and showing message
    No (suitable) purchase order/item found
        Message no. M8 401
    3CAUSE&
        No purchase order exists which corresponds to your entry for a quantity
        difference posting.
    ECC 6 -> In ECC 6.00 we are using view V_CKMLGRIR (DB View: Selection for MR11 Clearing GR/IR Clearing Account Table u2013 EKKO, EKPO and EKBE)
    Here also program is checking the Quantity in the View, if there is no difference in quantity then it is going for another fetch (which is missing in 4.6 B).
    In the another fetch, it is checking View V_CKMLGRIR_FR (DB View: Selection for MR11 Clearing Freight Clearing Accnt Table u2013 EKKO, EKPO and EKBZ)
    I've searched sap notes but couldn't find much help. I've tried different search criteria but no luck. Could anyone able to help me?
    Thanks,
    Ramesh S

    HI
    MR11 will show only the blocked invoices due to quantity/price difference.
    First of all please check your invoice (MIRO of your required PO) that it is blocked for invoice verification or not .(Please note block for payment is not relevant for MR11).
    Further please check if you have mainatined any tolerance in GRN (MIGO) for under or over delivery , so it is not escaping the PO due to under/over tolerance limit.
    Cheers
    Mukta

  • Free Item in Purchase Order Item

    Hello All,
    I would like to ask where in table level can I identify Purchase Orders which have "Free Item".  Because on the screen field i saw from the technical definition that the "Free Item" is of field MEPO1211-UMSON, but when I go to EKPO I cannot find the corresponding field.
    I have this idea but I don't know if it is right or not, in case I uncheck the "Invoice Receipt" in the Purchase Order Item details, the "Free Item" check box appears.  So I am thinking is all Purchase Order Items which have "Invoice Receipt" (EKPO-REPOS) uncheck considered as a "Free Item".
    Thanks.

    Hi,
    When we are talking about Free Items, in SAP terms, it means that we would not have any conditions/Gross/Net Price.
    Also, Invoice Receipt will be unchecked because for free items, there would not be any invoice right?
    So we can conclude that, once Invoice Receipt is unchecked + Free items is checked, this particular line item will be received as free goods.
    Note that if the material is valuated, it will affect your MAP (moving average price).

  • Create additional field in sales order item and copy to purchase order item

    Dear SAP Gurus,
    I am hoping that someone could help me by providing me with how to implement the following 2 requirements in the SD order and in the purchase order.
    1. I am wanting to add a custom field to the SD sales order item copying a value from the vendor customer master.
    2. I then want to add a custom field to the purchase order item and copy the value from my custom field in 1. to this new custom field..
    Can you please advise how I would go about implementing the above requirements?  I am assuming that there are exits to allow me to implement these 2 requirements.
    Many thanks
    Henry

    Hi,
    For the first requirement you can use the USEREXIT_MOVE_FIELD_TO_VBAP in report MV45AFZZ.
    For the second, as I think that you will create a RFQ you can try to use the enhancement MEREQ001.
    Regards,
    Eduardo

  • Profit Segment not activated during creation of purchase order item

    Hello,
    While I create a Purchase Order Item, in the account assignment tab, I may fill in at least a cost center or a cost center and an internal order.
    If I fill in only a cost center and key the enter buton, the profit segment is activated.
    If I fill in the cost center and the Internal Order at the same time and afterwards I key the enter button, the profit segment is not activated. I have to click on the Profit segment button and validate the profit segment manually.
    Could you tell me what the problem is?
    Thank you in advance
    Regards

    Hi
    That makes sense to me
    In any entry you can enter One REAL Object and more than one Stat Object...
    SInce you entered Cost Center in Option 1 - You were proposed with PSG and IO as the option
    Since you entered Cost center *** REAL IO in Option 2 - The system got what it wanted i.e. One REAL OBJECT.. hence, no more objects are proposed to you... However, you can manually enter PSG or WBS if allowed in your Field Status Group in FI
    br, Ajay M

  • Qty in Purchase Order Item

    Hi ...sorry friends I am very new to SAP and that's why sending my foolish queries to u ... hope u will not mind.
    I am using ECC6.0 and here at my end I encountered a strange issue (may be this is std SAP functionality but I couldn't understand the logic behind it.)
    Issue is like...
    Even in partially or fully delivered orders , I can change (increase) Ordered qty in Purchase Order items and even for the PO items  for which "Delivery Completed" is set , I can change qty.
    Also I wanted to know is there any setting by which i can lock this functionality (like users will not allow to change qty if material is recd (partially / fully )against this Po item.
    Thx to all for yr valuable support and guidance.
    Regards
    SANDEEP

    Hi!
    In order to prevent the users from changing the PO quantity when they are fully delivered, you may maintain a system message for this in:
    SPRO - Materials Management - Purchasing - Environment Data - Define Attributes of System Message - System Message
    Set 00 06 744 to E (error) =)

  • Issue with purchase order item

    Hi Guys,
    When entering or changing an order in SAP via VA01/VA02, the system will not allow the entry of leading zeros in the Purchase Order Item (VBAP_POSEX) field which is defined as character 6. Leading zeros can be entered in the Customer Material (VBAP_KDMAT) which is also defined as character. Some customer PO Item numbers begin with leading zeros and they want to see them on output. Does SAP have an OSS note for this?  any helpful suggestion would be well appreciated.
    Thanks!
    Edited by: MK18774 on Oct 5, 2009 9:57 PM

    there is a include FV45PF0V_VBAP-POSEX_PRUEFEN
    that checks PO number and item number .... with your own EKPO (purchase order item) table.
    and this include has as well the routines to convert the number: CONVERSION_EXIT_ALPHA_INPUT

  • Import data to Purchase Order Item Level Text from DMS system

    Hi,
    I have the material PO Text maintained against the Material in the DMS system.
    In R/3, when I am creating the Purchase Order, I want the system to retreive the PO Text maintained in DMS against the material in the Purchase Order and paste it in the Purchase Order Item details - Material PO Texts.
    Could anyone suggest me which User Exit or BAPI and the Function Module to fetch this data from DMS.
    Thanks in advance.
    Regards,
    Jeetendra

    Dear Gurus,
    We are able to populate the "Import Data" in the backend PO in our backend system 4.6C, thorugh user exit
    EXIT_SAPMM06E_004   &   EXIT_SAPLV50E_004.
    Now when we create PO from SRM , the import related foreign trade data gets filled up from the master data.
    Problem: In Header and Line item condition: We are not getting the condition type GRWR automatically, if the PO is comming from SRM. Because of this the statistical value is 0.
    ( If we create manual PO, the condition GRWR appears in PO - and the Statistical value gets filled in automatically )
    How can we put the condition type GRWR into the PO using user exit ?
    Thanks and regards,
    Anil Rajpal
    Edited by: ANIL on Aug 12, 2010 6:18 PM

Maybe you are looking for

  • Why do all of my apps no longer work?

    So.... this morning all of my downloaded apps stopped working. The icons are still there but initiating any of them results in seeing the apps initial screen and then promptly being returned to the iPhone icon panes (home). It appears to not have aff

  • IMac 2011 Mini Displayport not displaying 1080p

    Hi all, So my 2011 21.5'  iMac is only allowing me to display at 1080i with my mini displayport  to HDMI adapter. When I go up to 1080p the TV has no signal. To check that the TV was able to show 1080p, I connected it to my 2009 macbook pro and sure

  • Mobility Group Requirements for Guest Anchor WLC

    Hello - I've alway assumed you can't create a guest tunnel between a local WLC and an anchor WLC that are in different mobility groups.   However, I was told recently (without much detail) that this is possible.  So I have set out to test this.   I a

  • What is the best Apple notebook for video editing and pro music creation?

    What is the best Apple notebook for video editing and pro music creation? I know I could opt for the most expensive and probably get what I want that way, but I´m not made of money, so what are your suggestions for minimum criteria and which would yo

  • Host String for Newbie

    I'm trying (in vain) to start sql*plus but am failing on the Host String: parm. I know my instance is up because oem, auqa-studio and jdbc all operate a-okay. Where do you suppose Oracle keeps its' documentation on this cryptic parm? Certainly this "