Exit/badi for Material group validation on service POs

Hi Gurus,
The requirement is to put validation on 'MATERIAL GROUP' at item level as well as service sub line item level.I have used EXIT_SAPMM06E_017 for line level validation.
For service sub line level 'MATERIAL GROUP' i tried using EXIT_SAPLMLSP_030 but validation is not working properly as
EXIT_SAPLMLSP_030 is triggered before EXIT_SAPMM06E_017.
Kindly suggest any alternatives.
Thanks in advance
Deepika

Hi,
I had finally used BADI ME_PROCESS_PO_CUST method CHECK and PROCESS_ITEM for enjoy transactions i.e ME21N ME22N ME23N and written code in EXIT EXIT_SAPLMLSP_030 for service item validations.
IF sy-tcode = 'ME21N' OR sy-tcode = 'ME22N' OR sy-tcode = 'ME23N' OR sy-tcode = 'MASS' OR sy-tcode = 'ME29N'.
    DATA: wa_zmm_mat_grp TYPE zmm_mat_grp.
    EXPORT header_data-aedat FROM header_data-aedat TO MEMORY ID 'ZDAT24933'.
    EXPORT header_data-bsart FROM header_data-bsart TO MEMORY ID 'ZBRT24933'.
    IF header_data-aedat GE '20090810'.         " Material group mandatory appplicable date.
      IF ( header_data-bsart = 'SRV' OR header_data-bsart = 'SRVF' OR header_data-bsart = 'SRVI') AND ( header_data-bsart NE ' ')  AND
         ( re_data-loekz EQ 'S' OR re_data-loekz EQ ' ' ).
        SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = re_data-matkl AND
                                                                     bsart = header_data-bsart.
        IF sy-subrc NE 0.
          MESSAGE e005(ze1).
        ENDIF.
      ENDIF.
      IF header_data-bsart IS NOT INITIAL.
        IF ( header_data-bsart NE 'SRV') AND ( header_data-bsart NE 'SRVF') AND ( header_data-bsart NE 'SRVI') AND
           ( re_data-loekz EQ 'S' OR re_data-loekz EQ ' ' ).
          SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = re_data-matkl.
          IF sy-subrc EQ 0.
            MESSAGE e006(ze1).
          ENDIF.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.
For service subline item following code:
DATA: wa_zmm_mat_grp TYPE zmm_mat_grp,
      v_bsart TYPE ekko-bsart,
      v_packno TYPE esll-packno,
      v_ebeln TYPE ekpo-ebeln,
      v_aedat TYPE ekko-aedat.
IF sy-tcode = 'ME21N' OR sy-tcode = 'ME22N' OR sy-tcode = 'ME23N' OR sy-tcode = 'MASS' OR sy-tcode = 'ME29N'.
  IF srv_esll-matkl IS NOT INITIAL.
    IMPORT header_data-bsart TO v_bsart FROM MEMORY ID 'ZBRT24933'.
    IMPORT header_data-aedat TO v_aedat FROM MEMORY ID 'ZDAT24933'.
    IMPORT re_data-bsart TO v_bsart FROM MEMORY ID 'ZBRT24933'.
    IMPORT re_data-aedat TO v_aedat FROM MEMORY ID 'ZDAT24933'.
    IF v_bsart IS INITIAL OR v_aedat IS INITIAL.
      SELECT SINGLE packno FROM esll INTO v_packno WHERE sub_packno = srv_esll-packno.
      IF sy-subrc EQ 0.
        SELECT SINGLE ebeln FROM ekpo INTO v_ebeln WHERE packno = v_packno.
        IF sy-subrc EQ 0.
          SELECT SINGLE bsart aedat FROM ekko INTO (v_bsart, v_aedat) WHERE ebeln = v_ebeln.
        ENDIF.
      ENDIF.
    ENDIF.
    IF v_aedat GE '20090810'.         " Material group mandatory appplicable date.
      IF ( v_bsart EQ 'SRV' ) OR ( v_bsart EQ 'SRVI' ) OR ( v_bsart EQ 'SRVF' ) AND ( v_bsart NE ' ' )
      AND srv_esll-del = ' '.
        SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = srv_esll-matkl AND
                                                                     bsart = v_bsart.
        IF sy-subrc NE 0.
          MESSAGE e005(ze1).
        ENDIF.
      ENDIF.
      IF ( v_bsart NE 'SRV' ) AND ( v_bsart NE 'SRVI' ) AND ( v_bsart NE 'SRVF' ) AND ( v_bsart NE ' ' )
      AND ( srv_esll-del = ' ').
        SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = srv_esll-matkl .
        IF sy-subrc EQ 0.
          MESSAGE e006(ze1).
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.
ELSEIF sy-tcode = 'ME21' OR sy-tcode = 'ME22' OR sy-tcode = 'ME23'.
  IF srv_esll-matkl IS NOT INITIAL.
    IMPORT i_ekko-bsart TO v_bsart FROM MEMORY ID 'ZPOT24933'.
    IMPORT i_ekko-aedat TO v_aedat FROM MEMORY ID 'ZDTA24933'.
    IF v_bsart IS INITIAL OR v_aedat IS INITIAL.
      SELECT SINGLE packno FROM esll INTO v_packno WHERE sub_packno = srv_esll-packno.
      IF sy-subrc EQ 0.
        SELECT SINGLE ebeln FROM ekpo INTO v_ebeln WHERE packno = v_packno.
        IF sy-subrc EQ 0.
          SELECT SINGLE bsart aedat FROM ekko INTO (v_bsart, v_aedat) WHERE ebeln = v_ebeln.
        ENDIF.
      ENDIF.
    ENDIF.
    IF v_aedat GE '20090810'.         " Material group mandatory appplicable date.
      IF ( v_bsart EQ 'SRV' ) OR ( v_bsart EQ 'SRVI' ) OR ( v_bsart EQ 'SRVF' ) AND ( v_bsart NE ' ' )
      AND srv_esll-del = ' '.
        SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = srv_esll-matkl AND
                                                                     bsart = v_bsart.
        IF sy-subrc NE 0.
          MESSAGE e005(ze1).
        ENDIF.
      ENDIF.
      IF ( v_bsart NE 'SRV' ) AND ( v_bsart NE 'SRVI' ) AND ( v_bsart NE 'SRVF' ) AND ( v_bsart NE ' ' )
      AND ( srv_esll-del = ' ').
        SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = srv_esll-matkl .
        IF sy-subrc EQ 0.
          MESSAGE e006(ze1).
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.
ENDIF.
hope this will help u.

Similar Messages

  • User exit/BADI for material Po text

    HI,
    can any one suggest me User Exit/BAdi for material PO text in item level in PO
    Regards

    USE ME_PROCESS_PO_CUST
    METHOD : PROCESS_ITEM
    REGARDS
    KANISHAK

  • Looking UserExit or BADI for Material Group Description

    Hi,
    I am looking for BADI or User Exit for Material Group Description.
    My Scenariio is Whenever the user Enter in to MM01or MM02 in Basic Data 1 view Materail Group Field ,the user press F4 It is displaying material group number and corresponding Description.Those Description are in English because that materail group are created in English Longon Language,but the other language User Enter in to MM01 or MM02 Transaction in the basic data 1 view Press the F4 key for Materail Group it showing only material group number no description is displaying,but my requirement it should translate and show it to the corresponding longon language description when Press F4.Regarding this i maintaining other language description for the existing material group in a ZTable.
    The table for Material Grop Description in all the language  is T023T table.
    Get back to me your valuable suggestion for the above requirement.
    Thanks & Regards,
    sanjeevkumar

    Hi Sanjeev,
    If you wanna search for BADIs, you can follow this method:
    go to SE80 transaction and select the class/interface CL_EXITHANDLER, then you have to select the Get_Instance method and put a break-point in the following call:
    call method cl_exithandler=>get_class_name_by_interface
    exporting
    instance = instance
    importing
    class_name = class_name
    changing
    exit_name = <b>exit_name </b>
    exceptions
    no_reference = 1
    no_interface_reference = 2
    no_exit_interface = 3
    data_incons_in_exit_managem = 4
    class_not_implement_interface = 5
    others = 6.
    the value of exit_name will give you the name of the BADI that is been call from the transaction. Then you have to execute the transaction MM01 or MM02 and it will stop on each Badi's call.
    Regards,
    Eric
    Reward any helpful answer

  • User exit / BADI for batch classification validation

    Dear Gurus,
    I would like to know what is the user exit / BADI that can use to validate chracterisitcs value entered under batch classification?
    Thanks & regards,
    LOI

    Try to use EXIT_SAPLCLFM_002.
    Best Regards, Dirk

  • User Exit  / BADI for Delievry Text Validation

    Hello Gurus,
    I have one requirement to Validate if the Header Text has been entered in one of the Text ID and if the same is blank I will have to make hard coded error message.
    Please provide me with the Table name or Structure name which holds the value of Header Texts entered in Delivery.
    I will appreciate for the help.
    Regards
    Saurabh

    any standard text are stored in table STXH
    to get data from that table you will need TDID , td name, tdobject

  • Issue Search Help Exit for Material Group

    Dear Expertsl,
    I developed a search help exit for material group for the search helps both H_T023 and H_2023_MEPO to restrict certain material groups from the actual display as follows
    1)  I developed custom table to hold the Invalid material groups
    2) Developed search help as same as in the bellow link
    link:[https://wiki.sdn.sap.com/wiki/display/Snippets/CaseInsensitiveSearchHelpExitforMaterial+Group]
    3) Before the statement
        SELECT matkl wgbez wgbez60 FROM t023t INTO s_t023t
          WHERE matkl IN t_matkl
    i selected the Invalid materials from the custom table into an internal table
    4)    i am restricting the entries with the following code.
    LOOP AT a_tab.
    only move values that meet the requirements
    after you convert to upper case.
         MOVE a_tab-wgbez60 TO a_tab-wgbez60_test.
         TRANSLATE a_tab-wgbez60_test TO UPPER CASE.
            MOVE      a_tab-wgbez        TO a_tab-wgbez_test.
            TRANSLATE a_tab-WGBEZ_test   TO UPPER CASE.
            MOVE      a_tab-wgbez60      TO a_tab-wgbez60_test.
            TRANSLATE a_tab-wgbez60_test TO UPPER CASE.
          IF a_tab-wgbez60_test IN i_wgbez60 AND
             a_tab-wgbez_test   IN i_wgbez   AND   
             a_tab-matkl        IN i_matkl.
            ADD 1 TO findex.
            MOVE a_tab-matkl   TO temp_tab-matkl.
            MOVE a_tab-WGBEZ   TO temp_tab-WGBEZ.   
            MOVE a_tab-wgbez60 TO temp_tab-wgbez60.
            IF findex > callcontrol-maxrecords.
              MOVE 'X' TO callcontrol-maxexceed.
              EXIT.
            ENDIF.
            READ TABLE i_invalid INTO w_invalid
            WITH KEY matkl = a_tab-matkl.
            IF sy-subrc NE 0.
              APPEND temp_tab.
            ENDIF.
            CLEAR temp_tab.
          ENDIF.
        ENDLOOP.
    This is working fine when we press F4 in ME21N Transaction and give some description and then press enter the popup screen.
    But my requirement is user will enter some description in ME21N material group field and press enter ( Not pressing the F4 here) at this moment this is not going through the search help exit and displaying all the entries including the Invalid materials.
    Note: We can delete the Invalid material groups but the documents which are having the invalid material already will have an issue and need to be corrected all the documents. But our requirement is only to use the correct materials  groups from now onwards.
    I would appropriate if any one can helping this regard.
    Thanks in advance.,
    Regards,
    Venkat

    Hi Venkat,
    You can call your ZSEARCH_HELP from the PAI , on the event SY-UCOMM = Enter using the function module F4IF_FIELD_VALUE_REQUEST.
    For example, your screen field is MARA-ZXXXX, screen 0100 and search help :  ZSEARCH_HELP
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
        EXPORTING
          tabname                   = 'MARA'
          fieldname                  = 'ZXXXX'
          searchhelp               = 'ZSEARCH_HELP '
          dynpnr                      = '0100'
          dynprofield                =  'MARA-ZXXXX'
    TABLES
       return_tab                = lt_returntab.
    This F4IF_FIELD_VALUE_REQUEST will call your custom search help exit.
    Regards
    Deepa.

  • User-Exit / Badi  for ML81n (create service entry sheet)

    Dear experts,
    I am looking for a User-Exit / Badi  for ML81n (create service entry sheet),  which will enable me to compare its date with the referenced PO's item's delivery-date,   befor saving ,  and send an error message (with no update) if the check is not OK.
    Remark :  I have tried MB_DOCUMENT_BADI   but with no success because you can't send an error message from it.
    Thank you
    Yaacov

    hi check below thread
    User-Exit for Service Entry Sheet via ML81N?
    regards
    vijay

  • User Exit or BADI for Material master

    When save in MM1 or MM02,  we need a user exit or Badi to <u><b>get ECM data</b></u> (which is saved in AENR or AEOI table). Please help for this.

    Hi Krishna,
    Enhancement/ Business Add-in            Description
    Enhancement
    MGA00001                                Material Master (Industry): Checks and Enhancements
    MGA00002                                Material Master (Industry): Number Assignment
    MGA00003                                Material Master (Industry and Retail): Number Display
    Business Add-in
    MG_MASS_NEWSEG                          User-Specific Fields & Segments in Mass Maintenance
    MATGRP_SKU_UPD
    CDT_CHECK_MATERIAL                      Checks for Existence of a Material in a CDT
    BADI_MM_MATNR
    BADI_MAT_F_SPEC_SEL                     BAdI for Material Special Field Selection
    BADI_MATNR_CHECK_PVS
    BADI_MATERIAL_REF                       Addition of customer-defined default data for material
    BADI_MATERIAL_OD
    BADI_MATERIAL_CHECK                     Enhanced checks for material master table
    BADI_GTIN_VARIANT
    BADI_EAN_SYSTEMATIC
    o.of Exits:          3
    o.of BADis:         11
    These ar ethe avilable exits and badis.
    Rgds,
    P.Naganjana Reddy

  • User Exit/ BADI for ME01- Sourcelist creation

    Hiii
    We need a place exit/ BADi to do vendor validation before saving soource list in transaction ME01.
    Please provide suitable exit / badi for above requirement.
    Thanks ...in advance.!!
    Regards,
    Nilesh

    EXIT_SAPLMBMP_003     AMPL0001     User subscreen for additional data on AMPL
    EXIT_SAPLMEKO_001     LMEKO001     Extend communications structure KOMK for pricing
    EXIT_SAPLMEKO_002     LMEKO002     Extend communications structure KOMP for pricing
    EXIT_SAPLMEQR_001     LMEQR001     User exit for source determination
    EXIT_SAPLMEQR_001     LMEQR001     User exit for source determination
    EXIT_SAPLQBCK_002     QBCK0002     Extended check in procurement

  • G/L Accounts for Material Group

    I have been serching over the forum but couldn't find Table that will Relate to  G/L Accounts for Material Group.
    Actually we would need to know which (service) material group brings GL account 53**** when creating purchase request.
    Is anyone aware of the Tables regarding this??
    <<Text removed>>
    Regards
    Edited by: Matt on Oct 12, 2011 6:43 AM

    Ajit,
    Thanks for reply. My requirement is not to maintain GL which will decault in PR or PO but I just want to know which (service) material group brings GL account 530000 when creating purchase request.
    Regards

  • Source List for Material Group

    Hi All,
    How do I maintain a source list for a material group.? Since ME01 requires a material, I cannot create source list in this tranasction.
    The client want a the Source (for material Group) to be assigned automatically in PR assignment step.
    Again, within a material group there can be several infor records, For example:
    Mater Group: Office Supp.....I can have two infor rec for the same vendor....one with "Short Text" Notepad and another info rec with "Short Text": Paperclips. Or the second info record could be a different vendor also.
    How could the system know which one to assign as a source since it's the same material group (one for Notepads and the other for paperclips)??
    Thanks in advance

    Hi duke,
    In SAP we have a choice of creating source list for a "Material Group ". Following is the method.
    You may have the outline agreements related to material group rather than a single specific material - For ex. outline agreement with a item category M( Material unknown) or      W ( material group).In doing so you can decide whether to exclude or include certain materials of the relevant material group by means of the source list.
    To create the source list for a material group proceed as follows.
    1) On the outline agreement overview screen, select the items for which you wish to enter the source list record & choose Item --> Maintain source list
    2) To exclude the particular material keep the "Exclusion" indicator set against a material with a validity period.
    I hope this will be useful to you.
    Vivek

  • Restrict Vendor for material group

    Hello Friends,
    My client has a new requirement as below:-
    I have material groups : 0001, 0002 and 0003
    For Material Group 0001 : Only Vendors A, B & C are allowed.
    For Material Group 0002 : Only Vendors  B, C & D are allowed.
    For Material Group 0003 : Only Vendors  A, C & D are allowed.
    Is this possible any ways. Please help.. If it is not possible in standard, please help with some user exit if any..
    Thanks & have a great week end...

    Friends,
    I am closing this thread since I could find an answer myself the same is shared below hoping that the same will be useful for atleast few..
    1) Create the Info record with material group without price (Make price non-    mandatory in the config.)
    2) Control creation of Info records and price update for Info records thru    EVO Parameter and assign the same with user.
    3) Make Info record mandatory for the PO
    4) Make sure that Info records are maintained for the material vendor combination only where the vendor is a selected (If you dont any one of them control them thru sourcelist or block the vendor)
    If this is done if you have not maintained atleast one PIR for material group vendor combination, you can not create a PO.
    Guys, Pls let me know if this makes sense..
    Regards

  • User Exit / BADI for Transaction IW31 to create a POP-UP.

    Hi,
    I need to have a POP-UP Message in transaction IW31 on the press of ENTER. Could you give me the name of the EXIT or BADI which can be used for this purpose.

    Hi!
    In IW31/IW32, there is no user-exit/badi for pressing Enter. User-exits are attached to well determined event (enabling, closing, saving the order and so on).
    If you wanted to solve it, it seems, you have to modify the standard COIH function group. Use SE80 transaction for it. The first dynpro is 3000.
    Regards
    Tamá

  • Looking for Exit/Badi for VA03 TC for blocking the sales order

    Dear Experts,
    I would like to know the user exit/badi for sales order(tc VA03)and program name:SAPMV45A
    1)if the minimum order quantity is less than the order quantity.the order will block and in the second line item for the same material they are charging 100$ and then they will release. the existing logic is user dont want this now.
    2)If a line item is created below the minimum order quantity, the order should get blocked and the user should get a warning message regarding the addition of ZMOQ condition type [u201C Line item Quantity is less than minimum order quantity, ZMOQ condition type is missing u201C
    Please provide the exit name and provide some inputs.
    Thanks,
    V.V.

    Hi Gurus,
    I am trying to find out the exit for warning messages where the SAP has maintained.
    whenever the salesorder creating if the order quantity is less than the minimum order quantity it will give two warning messages. 1.Take minimum order quantity 400 DEV into account in item 000010
                       2.Consider delivery unit 40 DEV in item 000010
    so i want to add the third warning message for condition type is missing.
    I am trying to find the exit in the program SAPMV45A and include names MV45AFZZ and MV45AFZB.
    Please let me know if anyone knows the exit name. where the warning messages maintaining.
    Thanks
    V.V.

  • User Exit / Badi for MIRO / MB60

    Hi,
         I want a user exit or badi for the MIRO /MB60 Transactions.
    When select something on GL Account Number(from table control of these transactions) and press on enter then I want to add some code. Can you please let me know the exit/badi for this scenario.
    Thanks,
    Srinivasa Rada

    hi
    Following exits are available for MIRO.
    Transaction Code - MIRO                     Enter Incoming Invoice
    Exit Name           Description
    LMR1M001            User exits in Logistics Invoice Verification
    LMR1M002            Account grouping for GR/IR account maintenance
    LMR1M003            Number assignment in Logistics Invoice Verification
    LMR1M004            Logistics Invoice Verification: item text for follow-on docs
    LMR1M005            Logistics Inv. Verification: Release Parked Doc. for Posting
    LMR1M006            Logistics Invoice Verification: Process XML Invoice
    MRMH0001            Logistics Invoice Verification: ERS procedure
    MRMH0002            Logistics Invoice Verification: EDI inbound
    MRMH0003            Logistics Invoice Verification: Revaluation/RAP
    MRMN0001            Message output and creation: Logistics Invoice Verification
    <b>
    BADI...
    </b>
    To search for a badi, go to se 24 display <b>class cl_exithandler.</b>
    double click on method get_instance, get a break point on case statement.
    execute and start the required transaction in new session.
    look for variable <b>exit_name.</b> It would show the available badi's.
    Please do reward if useful
    Regards
    Dinesh

Maybe you are looking for

  • Bridge CS4 won't open .NEF file in camera raw

    It says because photoshop CS4 does not recognize this type of file. I've opened plenty of Nikon .NEF files in Bridge. The difference is this is a D90 file and I've been getting D80 files. Is there a patch for newer camera models?

  • Java Home on Solaris 10

    Hi All , Config tool and JSPM are not opening for PI 7.1 on Solaris 10. It was working fine before.Seems the issue is with Java home . But i am not sure how to check Java home in Solaris. Also PI 7.1 ,JDK is inbuilt and we didn't set Java Home. But n

  • Missing Audio File

    I worked on a project (Logic 8) a few months ago...everything was great...recorded some audio, did some editing, hid some tracks, exported an MP3, removed unused audio from the bin, everything was great and dandy. I opened the same project last night

  • TargetDataLine.start() event doesn't occur

    Hello everybody, I've got a problem with a LineListener that is not informed about a specific LineEvent. I created a class Recorder that implements LineListener and uses a TargetDataLine object on which it registers itself as listener. Here's the cod

  • Iphone 3gs shows white screen for a second and reboots.

    While I play games, watch videos or do anything, the iphone displays a totally white screen for less than a second and then it reboots. After this it starts normally and then this all happens again after about 10-20 mins. Plz give me any suggestions