Badi Implementation in transaction ME21N

HI,
while creating / changing the purchase order through ME21N, ME22N, ME23N and MEPO Storage Location (EKPO-LGORT) at line item level (EKPO-EBELP) needs to be made mandatory. if line item is deleted or if PSTYP equal to nine then system should not validate "Storage Location" as mandatory.  using BADI ME_PROCESS_PO_CUST and Method: Process_item. 
Any help in this matter would be highly appreciated.
Thanks & Regards,
kumar

Hi Binit,
You have choosen right BADI & Method. Code like this:
If ' item is NOT deleted' OR PSTYP NE 9.
    IF EKPO-LGORT IS INITIAL.
    Message E0001   ---> Raise an error message
    ENDIF.
endif.
Reddy

Similar Messages

  • Creating the BAdI implementation: se19(OSS note )

    Hi Experts,
    I have to apply a Note 1330434 ( FBL5N: Performance improvement by changed selection.) in our ECC.6.0.
    The 1330434 note says,
    Solution
    When you implement a new BAdI in the line item display, the selection logic can be optimized. The system only reads the clarification case attributes for the line items that are also displayed.
    Import the specified Support Package.
    To implement the correction instructions manually, proceed as follows:
    1...
    2. Implement the corrections in accordance with the correction instructions.
    3. Creating the BAdI implementation:
    Call transaction: SE19.
    Under "Create Implementation", choose "Classic BAdI".
    BAdI name: FI_ITEMS_CH_DATA
    Implementation name: FDM_AR_ITEM_ATTR_GET
    Implementation short text: FSCM-DM: Selection of attributes in FBL5N
    Activate the implementation.
    How to do the third step --> .."3. Creating the BAdI implementation: " ?
    when I go to se19,
    Under "Create Implementation", choose "Classic BAdI"... give FI_ITEMS_CH_DATA or FDM_AR_ITEM_ATTR_GET
    and then press button 'create impl.'
    then it says  "Badi definition FI_ITEMS_CH_DATA does not exist."
    I struck up at 3rd part of the note (BADI creation/implementation part of the note.).
    Please suggest me how to apply this Badi part of the note ?
    YOUR HELP WILL BE HIGHLY APPRECIATED!
    Thanks in advance.
    Edited by: sam kumar on Jul 22, 2009 12:22 AM

    Are you sure this note is for your system. I am also working in ECC6. I checked but I couldn't find the defibition too. Make sure note is for your component version and if it is report this problem to OSS.
    Edited by: Gungor Ozcelebi on Jul 22, 2009 8:37 AM

  • Using BADI to change the field value in standard transaction ME21N

    Hello People,
    In transaction ME21N to create PO, i have a field where i want to allocate the batch ( CHARG )  NONRETG to all the PO's that are created. I have a BADI for that, however i do i implement the BADI so that the Batch 'NONRETG' is automatically allocated to all the PO's that are created. Please advise whether a USER EXIT would be better or a BADI would do the work. Right answer would be rewarded.
    regards,
    Sandeep Salaria

    Hi,
    YOU can very well implement.Use this BADi->ME_GUI_PO_CUST
    Incase you are going to implemet userexit U can use the Exit: MM06E005.
    Regards
    Kiran Sure

  • User-exit or BADI in WBS validation (via transaction ME21N)

    Hi all.
    I have to validate field WBS Element (COBL-PS_POSID) in transaction ME21N. I have found BADI ME_PROCESS_PO_CUST but I can't find a method which have got field WBS Element. Do you know some BADI, exit, enhancement,... where I can check this field?
    Thanks a lot.

    Do this way..
    Method  IF_EX_ME_PROCESS_PO_CUST~PROCESS_ACCOUNT
    data:  re_account type ref to IF_PURCHASE_ORDER_ACCOUNT_MM.
    DATA: header type mepoaccounting.
    header = im_account->get_data( ).
    or in this way..
    Method IF_EX_ME_PROCESS_PO_CUST~CHECK
    Coding to get WBS Element
    DATA: head TYPE mepoheader,
    items TYPE purchase_order_items, " internal table
    line_item TYPE purchase_order_item, " work area
    po_item TYPE mepoitem.
    head = im_header->get_data().
    items = im_header->get_items().
    LOOP AT items INTO line_item.
    po_item = line_item-item->getdata().
    ***you have the data now, you can do your logic now..
    ENDIF.
    ENDLOOP
    you will get ps_psp_pnr
    then get POSID , using PRPS / PROJ table
    Edited by: playsuji on Oct 20, 2011 4:53 PM

  • BAPI Check in BADI Implementation

    Dear All,
    We have made an enhancement through BADI in ME21N / ME22N transaction like validating certain entries, in that I am checking the t-codes ME21, ME21N, ME22 and ME22N. If it fails then PO wonu2019t create and populate some messages.
    Now there is one custom program which creating POu2019s through calling BAPI in the program and itu2019s not validating the above as its calling through custom program.
    (i.e  SY-TCODE eq SE38)
    Now how I should put a condition on BAPI in my BADI implementation?? If it is normal user exit, we can use runtime structure T158 and check the TCODE in that. But as I am using the BADI ME_PROCESS_PO_CUST with the method CHECK doesnu2019t have any transaction code info.
    And currently I have an idea of using the GET / SET Parameters and need to set in the custom program and get that info in BADI? But I donu2019t know whether this idea good or not?? If anyone has any idea please let me know?
    Thanks,
    Raghu.

    Hi Raghu,
    If sy-tcode ne 'ME21'
    and sy-tcode ne 'ME21N'...
    IMPORT lv_data ....
    do processing...
    endif.
    Best regards,
    Prashant

  • BADI Implementation

    Hi all,
    In Transaction ME21N, there is a field 'OUR REFERENCE' in the Communication Tab. Now, we need to track the value entered and perform some ztable updation. I couldnt find a user-exit for the same but someone told me to implement a BADI ME_PROCESS_PO_CUST. I created a new BADI in SE19 and put the BADI name in the definition. i went inside one of the methods ( POST ) and tried putting the following code there.
    if MEPOCOMM-UNSEZ is initial.
      endif.
    but the code is giving syntax error saying the field MEPOCOMM-UNSEZ is unknown. so its not getting activated.  the field is the screen field name of the 'Our Reference' in ME21N.
    is there something wrong with the interface?? is there somethng to be specified in Import Parameters or something?? I am new to BADIs. So please explain in a simple manner. Also, how to search for the BADI definition for a particular purpose in the first place?? I would like to know the procedure for how we go about finding the suitable BADI and then implementing it. I have already read the previous threads regarding BADIs.
    All useful Inputs would be appropriately Acknowledged,
    Thanks & Regards,
    Bikash

    Hi
    The erros says symply the data you're using doesn't exist.
    The method POST is two parameter, one is IM_HEADER, this parameter has several method to get and set header data.
    You have to use these method to read and update the header data.
    You should use the method GET_DATA of parameter IM_HEADER of method POST.
    So you code should be like following:
    DATA HEADER TYPE MEPOHEADER.
    CALL METHOD IM_HEADER->GET_DATA
                  RETURNING RE_DATA = HEADER.
    IF HEADER-UNSEZ.
    ENDIF.
    Max
    Message was edited by: max bianchi

  • BADI implementation is not working in background for MRRL

    Hai frnds,
    BADI: MRM_WT_SPLIT_UPDATE is used for deducting withholding tax in MRRL(Invoice verification). This BADI was implemented and working fine in foreground, but not working in background.
    After implementing the BADI, the standard method of calculating TDS(from vendor master) is over written by BADI implementation.Now standard deduction is also not workijng in background.Plz help me to solve it.
    Bala.V

    HI,
    COR6N is the Enjoy Transaction and sap does not suggest to write the BDC on these transaction as most of these transaction uses the GUI elements foe better display and which cannot be recorded while processing the BDC in back ground.
    Check for the Normal transaction and write the BDC for it.
    Or
    Pass X to Rcommit flag in the CTU_PARAMS option and check.

  • User exit or badi for me52n transaction.

    Hi all,
           i have a requirement to write a user exit or badi for me52n transaction. the requirement is in header section, only one plant should be accepted. that is in the first row one plant will be inserted. in the second row if we are inserting another plant other the first row plant, it should not accept it and it should raise an error.
    that is from the second row onwards, every plant should match with the first row plant.
    if any part of this issue is unclear, plz let me know so that i can explain it clearly
    this is urgent requirement.
    please let me know the solution as soon as possible.
    points will be awarded.
    thanking u in advance.
    A.srinivas.

    In this version exit EXIT_SAPLMEREQ_005 should exists (look at OSS <a href="https://service.sap.com/sap/support/notes/843446">Note 843446 - MEREQ001: Cannot call up external service data in user exit</a> this note refers to the exit and is applicable in  4.70. Look also at OSS <a href="https://service.sap.com/sap/support/notes/310154">Note 310154 - ME21N/ME51N: Customer-specific check, generating error log</a>
    Regards

  • Using the same instance of a BADI in another transaction

    Hello Everyone,
    I have a SAP standard transaction which has an authorization BADI implemented. I developed another report which is  similar to the before mentioned SAP report with a different transaction. The same BADI is called in the custom report also, because of a common function module (which has this BADI call). So, that means, the same instance of BADI is being called in the custom report also. The authorizations to display the data for both the transactions should be same.
    Should I specifically call this BADI again in custom report or will all the authorizations be linked to the new transaction as well?
    Thank you all in advance.
    Rushi

    The BADI call is nothing but a call to specific methods in the customer BADI implementation. So it should work from wherever it is called, even from customer programs copied from standard SAP code where the original call is made.
    But I wonder why do you need to make a copy of SAP code.

  • User EXIT, BADI for T-code ME21n, ME21

    Hi Guru's,
    I have rquirement where for some company codes user dont want GR and GR based invoicing if net price for PO is less than 100 GBP as it is very small quantity.
    To achive this we have to uncheck Goods receipt check bax from tab 'Delivery'  and uncheck inv. receipt check box from tab 'Invoice' of item level view at the time of PO creation.
    Now, i am serching for User exit or BADI which will serve this purpose, as T-code ME21n is enjoy transaction for ME21 i dont think we will get any user exit, we have to do it through BADI.
    If anyone has done something like this and have idea how i can achive this please revert back.
    regards,
    Rahul

    http://www.erpgenie.com/sap/abap/code/abap26.htm
    which gives the list of exits for a tcode
    Below code will give a list of BADIs for particular transaction.
    *& Report  ZNEGI16                                                     *
    REPORT  ZNEGI16                                 .
    TABLES : TSTC,
    TADIR,
    MODSAPT,
    MODACT,
    TRDIR,
    TFDIR,
    ENLFDIR,
    SXS_ATTRT ,
    TSTCT.
    DATA : JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE.
    DATA : FIELD1(30).
    DATA : V_DEVCLASS LIKE TADIR-DEVCLASS.
    PARAMETERS : P_TCODE LIKE TSTC-TCODE,
    P_PGMNA LIKE TSTC-PGMNA .
    DATA wa_tadir type tadir.
    START-OF-SELECTION.
    IF NOT P_TCODE IS INITIAL.
    SELECT SINGLE * FROM TSTC WHERE TCODE EQ P_TCODE.
    ELSEIF NOT P_PGMNA IS INITIAL.
    TSTC-PGMNA = P_PGMNA.
    ENDIF.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'PROG'
    AND OBJ_NAME = TSTC-PGMNA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    IF SY-SUBRC NE 0.
    SELECT SINGLE * FROM TRDIR
    WHERE NAME = TSTC-PGMNA.
    IF TRDIR-SUBC EQ 'F'.
    SELECT SINGLE * FROM TFDIR
    WHERE PNAME = TSTC-PGMNA.
    SELECT SINGLE * FROM ENLFDIR
    WHERE FUNCNAME = TFDIR-FUNCNAME.
    SELECT SINGLE * FROM TADIR
    WHERE PGMID = 'R3TR'
    AND OBJECT = 'FUGR'
    AND OBJ_NAME EQ ENLFDIR-AREA.
    MOVE : TADIR-DEVCLASS TO V_DEVCLASS.
    ENDIF.
    ENDIF.
    SELECT * FROM TADIR INTO TABLE JTAB
    WHERE PGMID = 'R3TR'
    AND OBJECT in ('SMOD', 'SXSD')
    AND DEVCLASS = V_DEVCLASS.
    SELECT SINGLE * FROM TSTCT
    WHERE SPRSL EQ SY-LANGU
    AND TCODE EQ P_TCODE.
    FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
    WRITE:/(19) 'Transaction Code - ',
    20(20) P_TCODE,
    45(50) TSTCT-TTEXT.
    SKIP.
    IF NOT JTAB[] IS INITIAL.
    WRITE:/(105) SY-ULINE.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    Sorting the internal Table
    sort jtab by OBJECT.
    data : wf_txt(60) type c,
    wf_smod type i ,
    wf_badi type i ,
    wf_object2(30) type C.
    clear : wf_smod, wf_badi , wf_object2.
    Get the total SMOD.
    LOOP AT JTAB into wa_tadir.
    at first.
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 'Enhancement/ Business Add-in',
    41 SY-VLINE ,
    42 'Description',
    105 SY-VLINE.
    WRITE:/(105) SY-ULINE.
    endat.
    clear wf_txt.
    at new object.
    if wa_tadir-object = 'SMOD'.
    wf_object2 = 'Enhancement' .
    elseif wa_tadir-object = 'SXSD'.
    wf_object2 = ' Business Add-in'.
    endif.
    FORMAT COLOR COL_GROUP INTENSIFIED ON.
    WRITE:/1 SY-VLINE,
    2 wf_object2,
    105 SY-VLINE.
    endat.
    case wa_tadir-object.
    when 'SMOD'.
    wf_smod = wf_smod + 1.
    SELECT SINGLE MODTEXT into wf_txt
    FROM MODSAPT
    WHERE SPRSL = SY-LANGU
    AND NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    when 'SXSD'.
    For BADis
    wf_badi = wf_badi + 1 .
    select single TEXT into wf_txt
    from SXS_ATTRT
    where sprsl = sy-langu
    and EXIT_NAME = wa_tadir-OBJ_NAME.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    endcase.
    WRITE:/1 SY-VLINE,
    2 wa_tadir-OBJ_NAME hotspot on,
    41 SY-VLINE ,
    42 wf_txt,
    105 SY-VLINE.
    AT END OF object.
    write : /(105) sy-ULINE.
    ENDAT.
    ENDLOOP.
    WRITE:/(105) SY-ULINE.
    SKIP.
    FORMAT COLOR COL_TOTAL INTENSIFIED ON.
    WRITE:/ 'No.of Exits:' , wf_smod.
    WRITE:/ 'No.of BADis:' , wf_badi.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'No userexits or BADis exist'.
    ENDIF.
    ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(105) 'Transaction does not exist'.
    ENDIF.
    AT LINE-SELECTION.
    data : wf_object type tadir-object.
    clear wf_object.
    GET CURSOR FIELD FIELD1.
    CHECK FIELD1(8) EQ 'WA_TADIR'.
    read table jtab with key obj_name = sy-lisel+1(20).
    move jtab-object to wf_object.
    case wf_object.
    when 'SMOD'.
    SET PARAMETER ID 'MON' FIELD SY-LISEL+1(10).
    CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    when 'SXSD'.
    SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).
    CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
    endcase.
    It may help you.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • In transactions ME21n, ME22n, ME23n I need to add new field to item detail

    Hello,
    In transactions ME21n, ME22n, ME23n I need to add a new field  to the table control TC_1211, in SAPLMEGUI screen 1211 for PO line items.  The new field is UNSPSC Code, a 30 char field, which will be enterable/changeable on the ME21n, ME22n screens and display only on ME23n. 
    BADI ME_PROCESS_PO_CUST enables you to extend the business logic of the Enjoy purchase order.  Is this the correct BADI to use for the purpose of adding a new input/output field to the PO detail SAPLMEGUI screen 1211?   
    Does anyone have any examples of adding a new field to PO Item Detail screen using BADI ME_PROCESS_PO_CUST?  I have had some experience creating Badi's, and would appreciate very much some sample code if possible. 
    We are on release SAP ERP Central Component 5.0
    SAPKB64018     SAP Basis Component
    SAPKA64018     Cross-Application Component
    SAPKH50013     Logistics and Accounting
    Thank you,
    Victoria

    Hi,
    Thank you for the response.  I tried this and found  Badi ME_PROCESS_PO_CUST.  Do you have any examples of adding a new cust field to PO Item overview screen using badi ME_PROCESS_PO_CUST? I have had little experience creating badi's, and would appreciate very much some sample code if possible.
    In transactions ME21n, ME22n, ME23n I need to add a new field in PO Item overview (screen 1211 of SAPLMEGUI). The new field ZZUNSPSC, has been appended to table EKPO as a 30 char field, which will be enterable/changeable on the ME21n, ME22n screens and display only on ME23n.
    Can you tell me if method FIELDSELECTION_ITEM of badi ME_PROCESS_PO_CUST the correct one to use for the purpose of adding a new input/output field to the PO item overview on SAPLMEGUI screen 1211?
    Thank you for help - much appreciated,
    Vicki

  • To get f4 help for salesperson field ,transaction me21n & me22n

    Hi Super-Techies,
    I am a new-bie in the world of enhancement.
    The reuirement here is I need to create a custom table with 1 field (prep_name). (This is done)
    Now the reuirement is that whenever user goes to transaction ME21N/ME22N, he wants me to add a f4 help for salesperson field (navigation : ME21N/ME22N -> CLICK ON COMMUNICATION TAB -> SALESPERSON). The f4 help should display the field from my custom table.
    As far as my knowledge is cond=cerned, I can use the function module 'F4IF_INT_TABLE_VALUE_REQUEST' to achieve this requirement.
    But the issue I am facing is where to write this logic and how to proceed. Can anyone help me in this case?
    Any help in this regard would be appreciated.
    Thanks & Regards,
    Vinit
    Edited by: vinit005 on Nov 1, 2010 12:43 PM

    Hi Vinit,
    I also had that requirement. There is no customer exit/BADI by which we can achieve that(as far as my knowledge), we have to use access key to achieve that. So we have gone for customer exit "MM06E005" to add Customer data tab in header and added our own fields, like Sales Person, Buyer Details etc.
    Thanks & Regards,
    Faheem.

  • Create a user-defined selection variant in transaction ME21N

    Hi,
    In transaction ME21N with the 'Document Overview' feature turned on we can view a list of standard selection variants. I would like to add a user-defined selection variant to that list. There is an OSS Note 377180 present which describes how to do that but(as per transaction SNOTE) that note cannot be implemented in our system. Is there any other way to get that done?
    Any help would certainly be appreciated.
    Thanks,
    Alam.

    I would suggest that you replay the transaction with breaks, so that you can see exactly what is happening (in the start options, set the SAPGUI replay options to stop at each ProcessedScreen)
    It may be that the Selection Variant button is not present during replay. In this case, you would need to make the step where this button is pressed as optional.
    ME21N is a difficult transaction to automate because it always remembers what you were last doing in it and restarts the transaction from that point.  You can delete the user settings (so you always start the transaction as though for the first time) using the following code in your script:
    ABAP.
    * Delete all User-Settings in MM
      DELETE FROM ESDUS WHERE UNAME = SY-UNAME.
    * Delete all User-Settings in search help
      DELETE FROM DDSHDEFSH WHERE USERNAME = SY-UNAME.
    ENDABAP.

  • How to change the name of a BADI Implementation?

    Hello experts,
    Does anyone knows how to change the name of the BADI Implementation? I just create a new Implementation but we need to rename it.
    Thanks in advance,
    AK

    Hi,
    Please go to transaction SE19, enter your implementation name.
    Then go to menu: Implementation -> Rename -> ...
    Regards,
    Ferry Lianto

  • BADI implementation for NOTIF_EVENT_POST not getting triggered

    Hi All,
            We have created an implementaion for the NOTIF_EVENT_POST. And it was working fine previously. Now it is not working for some reason. In fact issue is that the implemetation is not getting triggerd at all. I have put a BREAK-POINT statement in the code, but does not even goes into the code.
    I have checked all the properties. It is active. The table V_EXT_IMP has a entry corresponding to the BADI definition and implementation.
    I tried to debug the standard transaction IW52 (which uses this). The program runs till the FM call for CL_EXITHANDLER=>GET_INSTANCE. It created a instance also. But it does not get inside the call for the method of the BADI LR_BADI_INST->CHECK_DATA_AT_POST.
    I am at a fix now. Can somebody answer this issue? It would be very helpful.
    Regards
    Barada.
    Edited by: Baradakanta Swain on Aug 5, 2008 4:06 PM

    I did not get the issue with the BADI implementation. But as our time line was very tight, we moved the code to BTE event for Updating Notifications.
    This required a little tweaking of the code and now it is working.
    I am marking it ANSWERED so as to remove it from the list of unanswered questions.
    Regards
    Barada

Maybe you are looking for