BADI to uncheck free item indicator (field UMSON) in PO through ME21N)

Hi All,
I have a requirement to remove the UMSON ( free item ") indicator while creating a PO using ME21N transaction based on the input from user. If material starts with 'P' and it is a standard order, then this field should be unchecked for that particular item. I am implementing the BADI ME_PROCESS_PO_CUST and method CHECK. However, I find that though the PO is held and not saved, the value of UMSON field is not changed.
This is the code.
DATA:   lt_mepoitem   TYPE purchase_order_items,
        ls_mepoitem   TYPE purchase_order_item,
        ls_mepoheader TYPE mepoheader,
        ls_head       TYPE REF TO if_purchase_order_mm,
        ls_item       TYPE mepoitem,
        ls_local      TYPE ttyp_fieldselection_mm,
        ls_inval      TYPE REF TO if_purchase_order_item_mm,
        l_error       TYPE c.
  INCLUDE mm_messages_mac. "useful macros for message handling
  ls_mepoheader = im_header->get_data( ).
  lt_mepoitem = im_header->get_items( ).
  IF ls_mepoheader-bsart = 'NB' .
    LOOP AT lt_mepoitem INTO ls_mepoitem.
      ls_item = ls_mepoitem-item->get_data( ).
      IF ls_item-matnr(1) = 'P' AND ls_item-umson IS NOT INITIAL .
        ls_item-umson = space.
        l_error = 'X'.
        CALL METHOD ls_mepoitem-item->set_data
          EXPORTING
            im_data = ls_item.
      ENDIF.
    ENDLOOP.
    IF l_error = 'X'.
      ch_failed = 'X'.
      mmpur_message_forced 'E' 'ME' '303' text-001 '' '' ''.
    ENDIF.
  ENDIF.
Can anyone tell me what I am missing or where this can be implemented?
Thanks
S R

hi,
With Error it won' t allow you to save PO.
What i would suggest is that
  either you give message that indicator need to checked or unchecked as per condition. and let user change is manually and 
  you check it in BADI and then save it .
  or  you change free item check as per your requirement in BADi and give a information message that this item is to be checked for  free goods or need to be unchecked .

Similar Messages

  • Migration of PO with "free item" indicator not working (BAPI_PO_CREATE1)

    Hi experts,
    we are using the BAPI_PO_CREATE1 to migrate POs. However, when we try to create a line item with a price of 0.0  and a "free item" indicator, the PO is created with a price and without the "free item" indicator (price seems to be coming from source list).
    Did anyone run into this problem before with BAPI_PO_CREATE1?
    Thanks!

    Hi
    I suggest you not to use any price in the field
    POITEM - NET_PRICE & donot flag the same in POITEMX
    & flag the field POITEM - FREE_ITEM & also check the same in POITEMX
    I have tested this & it works fine.
    Thanks & Regards
    Kishore

  • Free item indicator

    Hi experts,
    Pls help me how to configure the Free item indicator in PO screen will be defaulted as "check" for specific PO doc type.
    appreciate your urgent response.
    Thanks

    Hi,
    Check the field variant assign to document type in spro->MM->Purchasing->PO->Define Document Types
    and check the field status of the  field Free item indicator  for that variant in spro->MM->Purchasing->PO->Define Screen Layout at Document Level
    Regards,
    Chetan

  • Free Item indicator is SET but value appearing in MB51

    Hello MM Guru’s,
    I have PO with Acc Assignment – Q (Project) and activated Free Item indicator when I do GR with Movement type – 101 / Q accounting document gets generated. As per my understanding SAP standard behavior is if I perform GR for FOC item accounting document should not trigger.
    When I check the same in transaction MB51, I could able to view the Amount in LC for the respective PO which in turn makes inconsistencies in system.
    Please let me know how to clear these inconsistencies in system.
    Revert back in case of any additional information required from my end.
    Note: In PO history tab page Amount in LC not appearing but it is appearing only in transaction MB51.
    Regards,
    Kumar S

    SAP Guru's,
    Replicated the issue in Q environment and issue is appearing as similar to P environment.
    Created 2 Purchase requisition via network
    Created 2 POs w r to Purchase requisition that is Free item tick is activated.
    GR done for 1st PO --> Amount in LC not appearing in MB51
    GR done for 2nd PO --> Amount in LC appearing in MB51.
    In this case price control-V then as per my understanding the stock is updated on a quantity basis only,not on a value basis.
    Hence for the 2nd PO while doing GR amount should not get updated in transaction MB51.
    Please let me know how to clear the inconsistencies in Q environment.If no solution then please let me know whether I can reach out SAP for the same or not.
    Need your valuable input on the same.
    Cheers,
    Kumar.S

  • Free Item Indicator on PO and SAP standards

    Hi,
    1. I'm trying to find the 'free item' indicator on my PO, but I'm not sure where it can be found. Where on the screen would this be located? Can I not find it because it's not configured in SPRO?
    2. Just to confirm, say company X receives 110 items when they made a PO for 100. 10 items are free. Is the SAP standard to GR 100 and make a PO for 10 free items, and then finally GR these 10 free items?
    I've searched on the forum but couldn't come up with anything.
    Thanks in advance,

    Hi,
    According to the description, the scenario can be achieved by "free goods item" via condition
    NR00 in info record.
    1. you allow "grant discount in kind" in vendor master-> purchasing view
    2. allow "Qual.f.FreeGoodsDis" in material master-> purchasing view
    3. in info record-> condition screen->press "Free goods" button, and maintain the condition
        NR00 for example 100 PC/10 PC free.
    4. customizing
        OLME
        ->Discount in Kind (Discount in Form of Bonus Goods)
        ->Define And Assign Discount-in-Kind Schema
        ->Determine Free Goods Schema
        set schema = NR0001 for "purchase group"/"Calculation Schema" combination
    Then when creating PO with quantity 100 PC, apart from the main item, there would be another
    subitem with "subitem category" = 4 derived by system automatically.
    When doing the GR, 2 lines will be proposed, however only main item will be reflected in
    accounting.
    When doing invoice, also only the main item will have amount.
    Hope it helps.
    Thanks and regards,
    Polly

  • Free item Indicator in PR (ME51N)

    Free Item check box not appearing in PR- item overiview (ME51N).
    How can I get that in PR item overview screen????

    Hello Atul,
    PR is an internal document that User/Department gives to Purchase department for giving details about the requirement that is why SAP doesn't provide free indicator in this transaction me51n.
    As PO is an external document and we need to provide the price for making a PO, so that is why SAP provides field in me21n from marking free indicators.
    As pricing available in PO is not available in Me51n in the same way free indicator is not availble.
    Regards

  • Returns and Free Item indicator in Purchase Requsition

    Can we get the FREE Item and Returns Item indicator (as available in PO) in Purchase requsition.
    Can we create returns PR or free item PR.
    Thanks,

    PR is an internal document. You do not need a FREE indicater at that level

  • Exit/bAdI for changing the item level field in VA02.

    Dear Guruss...
    I am facing a problem while trying toi change the account assignment group in VA02. The field is present at the iteem level in the tab BILLING.
    When I change the field by choosing one of the values provided in the search help and enter, the value is again reset to its initial value. However if I change the value and SAVE (without pressing enter) then the value is saved.
    The technical field name is VBAP-KTGRM, I have checked in the include:MV45AFZZ by putting break-points at all the forms but unfortunately none of them is getting triggered when I press enter.
    During the debugging I found tha the values of the structure VBAP are overwritten by those of XVBAP everytime I press enter.
    I also checked for the bAdI but can not get any help.
    Is there any bAdI or exit that can help me for this????
    Thanks in Advance......
    Abhi.....

    Hi Digvijay
       these are some of the enhancements/badi's which is related to t-code va02. just check it out
    Transaction Code -               VA02          Change Sales Order
         Enhancement/ Business Add-in               Description     
         Enhancement                    
         V60F0001               SD Billing plan (customer enhancement) diff. to billing plan     
         V46H0001               SD Customer functions for resource-related billing     
         V45W0001               SD Service Management: Forward Contract Data to Item     
         V45S0004               Effectivity type in sales order     
         V45S0003               MRP-relevance for incomplete configuration     
         V45S0001               Update sales document from configuration     
         V45P0001               SD customer function for cross-company code sales     
         V45L0001               SD component supplier processing (customer enhancements)     
         V45E0002               Data transfer in procurement elements (PRreq., assembly)     
         V45E0001               Update the purchase order from the sales order     
         V45A0004               Copy packing proposal     
         V45A0003               Collector for customer function modulpool MV45A     
         V45A0002               Predefine sold-to party in sales document     
         V45A0001               Determine alternative materials for product selection     
         SDTRM001               Reschedule schedule lines without a new ATP check     
         SDAPO001               Activating Sourcing Subitem Quantity Propagation     
          Business Add-in                    
         BADI_SD_SCH_GETWAGFZ               Scheduling Agreement: Read WAGFZ from S073     
         BADI_SD_V46H0001               SD Customer functions for resource-related billing
      Regards
    Zulfikhar ali
    Edited by: Zulfikhar Ali Bhutto.N on Sep 23, 2011 11:15 AM

  • Screen BADI for MIRO/FB60 item level field addition

    Hi,
    I need to add 'Material Group" (MATKL) field in item level similar GL Account. Material group will appear like GL account column in FB60/ MIRO screen ( GL posting).
    I want to do without modification with help screen BADI.
    Anyone, can suggest which BADI's method / User Exit can allow to add 'MATKL' field screen?
    regards,
    Rahul Mandale

    Dear Rahul,
    Please check IMG path :
    Material management>Logistic Invoice verification>incoming invoice-->Maintain item list variant.
    Or use Tcode SHD0, enter transaction Code MIRO and create  a screen variant.
    You can create your own screen variant , Untick the invisible check box for material group.
    Regards,
    w1n

  • Free item indicator in purchase order

    hello all,
    can you please help me how to find below include.
    included in MM06EO0R_RM06E-UMSON
    thanks in advance.

    how to change condition ,
    IF EKPO-REPOS EQ SPACE AND EKPO-EBELP NE SPACE.
       RM06E-UMSON = 'X'. 
    ELSE.
        RM06E-UMSON = ' '.
    ENDIF.

  • Save custom fields value  in EKKO through ME21N

    Hello Friends,
    putting a new inputfield in the header of ME21N - PO transaction must be inserted within existing tabstrib "Additional Data".
    This the new requirement.
    I have used the enhancement "MM06E005". I have only implemented and activated the USEREXIT without writing
    any code in any Function Module.
    Additionally I have added through the screen painter (Function Pool MEGUI) into screen 1229 the customer
    ZFIELD (Textinputfield).
    I can see this field in the transaction ME21N, ME22N, ME23N but if I enter any value and save it. This Field has only 0000000 in the EKKO instaed of the entered value by me.
    In the other transaction like ME21 ME22 ME23 this problem is not existing. I can save the enterd date without any problem.
    I have already implemented the structure CI_EKKODB too. There is the zcustom field added.
    I need your  help for in how to save the data in EKKO with me21n.
    Kindly Regards
    Marco

    Dear Marco,
    Dont use User Exit for this . Use the BADI's .If uses the USer Exit it will create u some probs at later stage.
    There are 2 BADI's available for this.
    1) ME_PROCESS_PO_CUST.
    2) ME_GUI_PO_CUST.
    1) ME_PROCESS_PO_CUST.This BADI is for Validating the PO at various Level. Methods for this BADI is
    1.Open.
    2.Initialize.
    3.Process Header.
    4.Process Item.
    5.Check.
    6.Post.
    Etc.
    So u can Validate the Entire PO ..
    2. ME_GUI_PO_CUST.
    Adding the Customer Own Screen to Enjoy Purchase Order.
    The Process is that Just Create a Function Group with the Screen with Screen Which u want to Add to the Header Level.
    Through this BADI u can add N Number of Screen to PO.
    In the First Method of this BADI just Add the Screen. For Better Understanding goto the Sample Coding of Both BADI's.
    With Regards,
    Sumodh.P

  • Field name of free item in ME21N

    Hi All,
    I have a small issue hear in ME21N I wan the table and the field which will be updated when the we check the check box for free item in the line items, I tried to find that using CDHDR, CDPOS, using ST05 and other methods but I was unable to do that can any of u please help me in finding that field along with table mane which will be updated and to give further information the screen field name is UMSON
    Regards,
    Antony

    Hello Antony,
    The 'Free Item' indicator is only used to facilitate the switching off of the 'Inv.Receipt' flag. 
    The flag UMSON is not contained in any table, only in structures.  
    But there is a correlation between the flag UMSON and the field EKPO-REPOS. So if you flag field EKPO-REPOS (an invoice is expected) the flag UMSON will be cleared and the other way around.
    For further information about this flag: You will not be able to enter any conditions in your purchase order item (not even the delivery costs) once the flag for 'Free item' has been set.
    In case the 'Inv.Receipt' flag is unticked, the system will not allow you to maintain any conditions in the purchase order, not even the delivery costs. In ME21N you can see that even the condition tab disappears as soon as you set the 'Free item'  indicator or as soon as you de-select the 'Inv.Receipt' flag.                                                                               
    Whenever the 'Inv.Receipt' flag is not set, we are indicating to the system that all the goods are to be delivered free of charge. In other words, there can be no delivery costs associated with the PO. Also, no delivery costs are allowed without an invoice receipt.                 
    I hope this helps.
    Esther.

  • BADI to uncheck Invoice indicator and set net price as 0 while creating PO

    Hi all,
    Is there any BADI to uncheck the Invoice indicator and set the net price as "0" while creating Purchase order?
    Im creating Purchase order in SRM and for certain vendor and material group net price should be set to zero and invoice receipt to be unchecked so that user wont get invoice receipt.
    Can anyone tell me how to do this?
    Thanks,
    Amal

    Pradeep,
    Thanks for your response.
    I will tell you the actual senario im having.
    Using Shoppin Cart, user will order for some items in SRM and once it was completed PO will be created in R/3 system. Here(R/3) when i check in ME23 for the created PO, the IR flag has been set. But i want the PO should be created as IR flag not checked and amount is changed to ZERO for certain vendor and material group combination.
    I searched some threads and found few function modules ( BBP_PD_PO_GETDETAILS, BBP_PD_PO_UPDATE, BBP_PD_PO_SAVE) which can be used in BADI BBP_DOC_CHANGE_BADI. But im not aware of the fields in which we can found vendor, material group, amount, IR indicator.
    Can you please guide me how to resolve this?
    This is my first task in SRM and im not aware of all terms in SRM.
    SRM version: 4.0
    R/3 version: ECC 5.0
    Thanks,
    Amal

  • Where is Free Goods Indicator Stored?

    Hi All,
    Looking at the PO screen, Free Goods Indicator, Free Item Indicator is stored in UMSON, but I can't find that in any table.
    Does anybody know what table this is in?
    Please help
    Thanks,
    Thang

    Hi Prabu,
    First you have to uncheck the free goods indicator in info record in Tcode ME12.
    Now try PO, if still free goods indicator is coming then you have to go to the following path:
    Spro - MM- Purchasing-PO - Define Screen Layout at Document Level-click on ME21N
    Here check.
    Cheers!!
    Utsav

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

Maybe you are looking for