ME51N badi's

Dear Experts,
My requirement is to validate me51n purhcase requsition, if the account assignment category is 'F' and i have to validate it with G/L account with particular acount number, kindly suggest how to proceed.
Regards,
Thiru

METHOD if_ex_me_process_po_cust~process_item.
*Data declarations
  DATA: item TYPE mepoitem,
      : lv_sakto TYPE sakto.
  item = im_item->get_data( ).
  IF item-knttp = 'F'.
    lv_sakto = item-sakto.
    IF lv_sakto NE '0045310100'.
      CLEAR : sy-ucomm.
      MESSAGE 'Please enter G/L account number as 45310100' TYPE 'E'.
    ENDIF.
  ELSEIF   item-knttp = 'K'.
    lv_sakto = item-sakto.
    IF lv_sakto EQ '0045310100'.
      CLEAR : sy-ucomm.
      MESSAGE 'Please enter G/L Account number other than 45310100' TYPE 'E'.
    ENDIF.
  ENDIF.
*Clear Variables
  CLEAR : lv_sakto.
ENDMETHOD.

Similar Messages

  • Purchse Requisation ME51N - BADI

    Hello,
    Am looking to change the value of Requisationer of Purchase Requisation (EBAN-AFNAM), in the process of Purchase requisation creation/change process (ME51N, ME52N)..so, i did not see any user-exit/enhancement spot in the main prog., i mean, SAP has not provided these exits!! so, whren I searched SDN, i found these links (Re: Purchase Requisition BADI/User Exit, Re: how to do a screen enhancement using BADI?), so, am looking BADI ME_PROCESS_REQ_CUST...and kept the break points...now, am creating/changing purchse req. by ME51N, ME52N...but any one of the break-point is NOT getting triggering!! so, pls. let me know, What is the correct way of finding out the invoking behaviour of a BADI against a given functionality/requirement.
    thank you

    1) Goto se24 (Display class cl_exithandler)
    2) Double click on the method GET_INSTANCE.
    3) Put a break point at Line no.25 (CASE sy-subrc).
    4) Execute SAP standard transaction
    5) Press the required button for which you need to write an exit logic, the execution will stop at the break point.
    6) Check the values of variable 'exit_name', it will give you the BADI name called at that time.
    7) This way you will find all the BADIs called on click of any button in any transaction
    can also use function SXV_GET_CLIF_BY_NAME

  • Purchase Requistion (ME51N) : BADI ME_REQ_POSTED

    Hi,
            I have used ME_REQ_POSTED-post(Method) Badi to check custom consistency in ME51N. If there is any error the badi throws the Message and returns to t-code : using leave to transaction  sy-tcode which is working fine, but the problem is that even the creation of the PR is manually stopped the PR number is generated and not saved(say: 8000012). Next time when I am creating a new PR with the same consisentcy check and if it gets through a new  number is generated with (say 8000013) but not with (8000012).If this case araises there will be problem with number range allocation each and every time they get exhausted?
    Kindly post the solution if any one has ever faced.....
    Thanks in advance for the help.
    with regards,
    krishna Mukthineni.

    Hello Krishna
    Most likely you are not using the correct BAdI. As the name implies (ME_REQ_POSTED) we have passed the last checkpoints already. The method IF_EX_ME_REQ_POSTED~POSTED is not intended to block the posting since it does not contain any exceptions.
    I assume that BAdI ME_PROCESS_REQ_CUST is the one you should implement. Its interface method CHECK ( Closing Check ) allows you to block saving the purchase requisition. If you set its CHANGING parameter CH_FAILED = 'X' then saving should not be possible.
    Regards
      Uwe

  • Problem to find Exit Name for me52n

    Dear all,
                 Recently i've facing a problem for finding the exact Exit Point for transaction ME52N.Can anyone please help me for finding this?
    regards,
    sameek.

    Hi, read http://www.surfingincognito.com/index.php?q=aHR0cDovL2ZvcnVtcy5zZG4uc2FwLmNvbS9tZXNzYWdlLmpzcGE%2FbWVzc2FnZUlEPTQ0OTU5MDE%3D   You can use inside of methods additional metods-GET_ items, GET_DATA. Please ask from your abaper, he'd know how to use it
    Also check this ME51N / BADI ME_PROCESS_REQ_CUST
    Edited by: alex ice on May 7, 2011 12:47 PM

  • Badi  for ME51N Item changes

    Hi ,
      Is there any Badi or user exit to make changes to the line item data in the purchase requisition create/change ME51N or ME52N transactions. We would want to populate few fields automatically on the item data, so would request if any of you have worked on any Badi for this transaction, please do post in immediately.
    Thanks,
    Sowmya

    Hi,
    1)BADI to be implemented: ME_PROCESS_REQ_CUST.
    Method to be used: PROCESS_ITEM.
    Place the below code in your implementation.
    data : l_item type MEREQ_ITEM.
    CALL METHOD im_item->get_data
    receiving
    re_data = l_item.
    *C-- L_ITEM-BEDNR is requirement tracking number
    2)Exit in ME51N
    MEREQ001 Customers' Own Data in Purchase Requisition
    You can implemet by this way
    You add your customer fields, which should be saved in the database, to
    the include CI_EBANDB (in table EBAN). You can also add customer fields
    that you want to use during the program run to the include CI_EBANMEM
    (in structure MEREQ_ITEM) These fields are not stored in database table
    EBAN.
    <b>Reward points</b>
    Regards

  • Exit / BADI for ME51N / ME52N

    Hi experts,
    I have the following requirement:
    1. In transactions ME51N / ME52N, the long text field for the item (Item Text) must be made read-only if the PR is already approved / released (release strategy indicator = '2').
    2. The PR workflow approvers must recieve an e-mail if this text has been changed while the PR is still blocked / not fully approved (release strategy indicator = 'X').
    I'm guessing both can be achieved through BADI implementations (in this case, IF_EX_ME_REQ_POSTED~POSTED), but I've read a lot about various Exits in these transactions, and now I'm not sure if this is the right one. Can you help me?
    PS.: I'm not completely familiar with BADIs and Exits, so please bear with me on this.

    Thanks for the replies.
    The MM consultant is still looking for a way to grey out the text field within SPRO. It's not an easy requirement
    Regarding the text changes, I followed your advices and I'm now trying to implement my code within the exit EXIT_SAPLMEREQ_005 (it's triggered right after the user saves the document, so it makes sense). The problem now is that when this exit is called, the changes made to the item text are already committed, and I can't compare the new text with the old one.
    I also tried implementing ME_REQ_PROCESS_ITEM, but it doesn't seem to be called from ME52N.
    Isn't there a log for long text changes? It would be really easy to just read CDHDR / CDPOS and know if the text has been changed. Also, is this text the same text from material master? If it is, I guess it would be easier to log its changes, right?
    Will appreciate your input on this.
    Regards,
    Leo

  • How to Assign Customized BADI to Standard T.Code  Example ME51N

    Dear all,
    It would be really appriciate if you provide me a solutions.
    I have Created Customized BADI using SE18,SE19. But I am not aware How to Use those BADI in Standard Transaction.
    Example : I have Created PR Related BADI (ZPURREQ_ACC_CHK). How to utilize this BADI In ME51N,ME52N.
    Please advice me.
    Thanks
    Best Regards,
    KSK

    I think what you need to do is find what exits or existing BAdIs are available for the transaction.  Then in the user exit you can call your customized code.  That way you avoid changing SAP's code for the transaction.  You can find BAdIs related to purchasing by going to transaction SPRO and then following this path:
    Materials Management -> Purchasing -> Business Add-Ins for Purchasing
    I hope this helps.
    - April King

  • UserExit/ Badi for me51n ( Version Details )

    Hi Experts,
    In transaction ME51n for Purchase Requistion for line item in Version TAB , I want to capture the Status "version completed" checkbox in a User exit or BADI and want to put a validation on the checkbox. I have  list of all UserExits and Badi's
    which are available for me51n. But none of them capture the Version TAB details in me51n. Version Details are available in EREV table.  EREV table details are not available in any of the UserExits and BADI's. No structure is available for that in User exits / Badi's.
    Also I want to know about BTE's. What are BTE's? Can BTE be used for ME51n transaction? If yes . what is the procedure  for the same?
    Please suggest a solution for the same as soon as possible.
    Thanks in Advance.

    Hello Priti,
    For BTE ref following doc-
    http://help.sap.com/saphelp_erp2004/helpdata/en/ee/e87988027a11d5a7d60000e83dda02/content.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/207835fb-0a01-0010-34b4-fef1240ba9b7
    Thank You,
    Nishikant.

  • ME51N Userexits/BADI --- Pop values(only display 3) based on PR Doc type

    Hi,
    This functionality nees to incorporate in ME51N.
    We have Purchase requisition document type "PRD X".[There are other 3 document types also].
    If we select document type "PRD X" while creating PR, In Item table [in ME51N] control we have a column called "Asset Assignment Category". Here I need olny 3 popup values if I go for F4 [to select any one from list of values].
    That mesans :-
    1> I should able to see only 3 popup values for "Asset Assignment Category" column when I press F4, if I select purchase requisition document type "PRD X".
    2> I should able to see all 18 popup values for "Asset Assignment Category" column when I press F4, If select purchase rezuisition document type other than "PRD X".
    So For the above requirement what is suitable user exit / BADI Or how can we achive? Does it possible with configuration?
    Please reply ASAP.
    Thanks in advance.
    Gupta.

    hi Alan,
    1)Drag your Pricing Cond and Billing Doc in Rows.
    2) In columns
    2.1 Right click-> New Structure->Right Click-> New Selection. Names as "KF1".
    now Drag your Kiy figure Amount, Pricing Cond and Bill doc.
    Now Double click on Pricing Cond -> Drag 'ABC' in rite panel. press ok.
    Now Double click on Billing Doc and Drag '1','2','3' in right panel. Now right click on '1'->choose exculde from selection.similarly for '2' and '3'.
    2.2) Again Right click the New structure and create a New selection "KF2"
    Now Drag your Kiy figure Amount, Pricing Cond and Bill doc.
    Now double click on Prciing Cond and drag value 'ABC' in right panel and exculde from selection.press ok.
    3) Again Right click the New structure and create a New Formula "AMount". Double that "KF1" (see bottom in panel)
    then press "+" sign and again double click on "KF2".
    Basically adding "KF1" and "KF2".
    4) Right click on "Kf1"-> hide it.Same for "KF2".
    5)save ->execute.
    Hope i m clear.
    Regards,
    San!

  • BADI for the transaction s ME51n and ME52n

    Hi friends,
    Can i get the code and particular  BADI ME51n where the conditions are
    In the purchase requisition the field (EBAN- PREIS) valuation price is configured as “required”, and the value is adopted from the material master record field (MBEW-VERPR) moving price. This moving price may differ on the same material based on the assigned plant. For example:
    Material Plant Moving Price
    1234 1000 9.10
    TA10 5.00
    TA12 7.00
    The plant field in the Purchase Requisition is mandatory except for document type RV. When this document type is assigned SAP doesn’t know which moving price to apply and so the user is prompted to manually enter a value.
    To ensure an appropriate value is entered SAP should apply the value from the material master record plant 1000 where the plant field in the RV Purchase Requisition field is blank.
    Essentially the same scenario applies to the Purchasing Group. As with the plant, the Purcahsing Group should be copied from the plant 1000 material master record.
    SAP should apply the value from the material master record plant 1000 where the plant in the RV Purchase Requisition (EBAN-WERKS) is blank:
    EBAN- PREIS = MBEW-VERPR
    EBAN-EKGRP = MARC-EKGRP
    Charita

    hi charitha
    i can help u out in getting the values to the fields mentioned irrespective of document type which u can do i think and i'm here with the piece of code as follows :
    Go to se19 to implement badi and give the name say zxyz and give the definition name as me_process_req_cust and implement the method called process_item
    and write the following code.
    data : wa_item type mereq-item,
             v_ekgrp type marc-ekgrp,
           v_preis type mbew-verpr.
    select single ekgrp
                         from marc
                        into (v_ekgrp)
                      where werks = '1000' and matnr = '100-100'.
    select single verpr
                       from mbew
                     into (v_preis)
                     where matnr = '100-100'
                       and bwkey = '000'.
    call method im_item->get_data
    receiving
    re_data = wa_item.
    wa_item-ekgrp = v_ekgrp.
    wa_item-preis = v_preis.
    wa_item-waers = 'INR'.
    if im_count = 1.
    call method im_item->set_data
    exporting
    im_data = wa_item.
    endif.
    hope this code will help in passing the data to the tcode me51n and if any issues let me know.
    reward point if helpful
    sandhya

  • Badi / Screen Exit for ME51N

    Hi Folks,
    My requirement is to add a standard field in the existing tab . Is there any BAdi / Screen Exit provided for tcode ME51n. I have checked the provided Exits and BAdi's but all of them are to add a new tab. But in my case I want to add a field in the existing tab.
    Kindly let me know the possibilities.
    Thanks in Advance.
    Somu

    Hi Soma,
    As i know it is not possible  . Better to add a new tab and add fields there.
    Regards,
    Madhu.

  • Enhancement help in ME51n : Extereme urgent  ! Exit + BADI-EX

    Hi Experts !
    I have added one tab and a field into it in ME51n through screen exit mentioned below :
    Calling screen  No.     Area      Called screen     No.   Short Text
    SAPLMEGUI   0014   SUB0     SAPLXM02        0111
    I need to save the user input value of this field + the PR number generated into my ztable which has only these two fields.
    <b>The issue here is that PR no gets generated only when we save and i cud not fetch it in these exits  ( If some has a point that we can fetch it in one of the exits-plz let me know)</b>
    Now I've used the exit : EXIT_SAPLMEREQ_003 of enhancement : MEREQ001
    to put data from screen field( added ) into a structure 'IM_ITEM' of nature mereq_item  by using methods of interface IF_PURCHASE_REQUISITION_ITEM.
    Below is the code i used in the include of above exit:
    *&  Include           ZXM02U03
    tables  ZTMMP0_PMASTER.
    data im_item type mereq_item.
        CALL METHOD im_req_item->get_data
          receiving
            re_data = im_item.
    im_item-zpurpose = ZTMMP0_PMASTER-PURPOSE.
    CALL METHOD im_req_item->set_data
      EXPORTING
        im_data =  im_item .
    Now i found a BADI ->ME_REQ_POSTED which gets triggered at the time of posting the PR.if u r clear about my above code thru methods<i><b> i am tryin to throw data of screen input from my function exit and catch the same in BADI - where PR no is visible and i wud push both from BADI-method into my ztable.</b></i>
    Issue is that the data of my new field which i passed thru my exit as shown above is not visible in BADI method and i cant use the get_data method
    eagerly waiting for help,
    Sachin Soni
    Message was edited by:
            Sachin Soni

    Hello Sachin,
    You are trying to bring data from an Exit to a BADI , but the BADI cannot recieve the DATA as far as i understood since the parameters are restricted,
    An option coming to me right now is to :
    <b> Use import <--> EXPOT memory</b>
    Export from the Exit and Import from the BADI using ABAP export/import statements
    EXPORT (OBJ_TAB) to memory ID 'ABCD''.
    IMPORT (OBJ_TAB) FROM MEMORY ID 'ABCD'.
    OR
    IMPORT A = A  B = B_PROG  C = C_PROG FROM MEMORY ID 'ABCD'.
    and
    FREE MEMORY ID 'ABCD'
    Please check for correct syntaxes
    Reward if helpful and pls update if problem is solved
    Regards
    Byju

  • BADI for ME51N  purchase requisition

    Dear All,
    i want to use user badi for transaction ME51N as i want to put a check for cost centre with plant such that if it does not belong to a particular plant it should throw an error message
    i hav found one BADI
    ME_PROCESS_REQ_CUST
    wherein in one of the methods(PROCESS_ITEM) i m getting
    Plant directly but i have searched all method and i m able to get costcentre(*KOSTL) in methods like 
    IF_ACCT_CONTAINER_MM~LOOKUP
    now if i m trying to use this method its saying either method unknown or private or protected
    can anyone plz help me with the syntax of using methods having such format as above i know the syntax to access normal methods like getdata or getitem and so on.
    Ronak

    Hi Ronak,
    Your input parameter in PROCESS_ITEM (IM_ITEM) is an object of class IF_PURCHASE_REQUISITION_ITEM. You can get all item data by using:
    DATA:
      zls_item TYPE MEREQ_ITEM.
    zls_item = IM_ITEM->GET_DATA( ).
    Regards,
    John.

  • ME51n/ME52n ME_PROCESS_REQ_CUST BADI, Services

    Tcode : ME51n/ME52n
    For each item i need adicional validations in PROCESS_ITEM to do so i need to get a list of the services to that item. Does anyone know a way to get from that BADI?
    Kind Regards

    Hi,
    Can you further explain about what exact data you want ?
    You want item data of the requisition or item specific other data like account assignment data ?
    Regards,
    Sunny

  • BADI for ME51n screen exit

    hi guys,
                 i have to add a new tab with three fields  under header level in me51n, i have used enhancement MEREQ001 but it is adding under item level only..so, guys can you please tell is there any BADI for this..,thanks in advance.
    regards,
    anand.

    Hi,
    As i know there is no possibility to add custom tab at header level better to go with item level.If need help here check and post.
    Regards,
    Madhu.

Maybe you are looking for

  • How to fix error 1327 on install?

    On installation of Adobe Acrobat XI Pro, after I have extracted the install files and start the install, I get the error: Error 1327 Invalid drive: X:\ mapped to a user folder. I have that drive and it IS mapped to a "user folder" on the network. How

  • The content type of the response message does not match the content type of the binding

    I have written an ASP.Net web service which returns english,chinese and portuguese data. Everything seemed working fine until the method retunred only english data. The moment it returns english, chinese and portuguese data I get the error: The conte

  • What is Mac's equivalent to Windows Explorer (file manager not internet explorer)?

    Have just migrated to macBook Pro from being a windows user for years. I don't trust backing up my important files to Cloud and would much prefer to back them up to an external hard drive as I used to on my Windows laptop. How can I do the same in my

  • Arabic letters are typed reversed

    Dear All I have been several month having this problem, when I lost hope to find the answer using search engine, I decided to ask it here in forum hopping that someone solve my problem. I have Photoshop Middle Eastern Version CS5. When I type Arabic

  • Excise entry during customer returns

    Hi, How to take excise credit while performing customer returns in SD.Is it through J1IEX or J1IH?If we take a excise credit through J1IEX then whether we need to maintain the customer's as vendors also?? Kindly Guide.. Warm Regards Somnath