Transactions ME51N & ME52N user exits - saving requisitions

Hi all. 
I have a new requirement for disallowing transactions ME51N & ME52N from saving purchase requisition records that have more than one line items associated with each of them.
Basically upon the user clicking on the 'Save' icon I have to first check the purchasing group screen field (MEREQ3211GRID-EKGRP) of the captured purchase requisition at each event instance.  If the purchasing group matches the one I check for (i.e. the configured one) and the purchase requisition also has more than one line item associated to it then I should skip the posting functionality for this specific purchase requisition and then issue an error dialog message to the user telling him/her that such a transaction is not alllowed.
Please help me to find the following:
1) The user exit/BADI to use in order to implement such a change.
2) The data objects or internal table/(s) that I may use in order to count the number of captured line items for each purchase requisition (e.g. via the 'DESCRIBE' command).
Thanks in advance!

Hi Venkatesan,
I have looked at the definition of this BADI via se18.  The interface has a few parameters which also reference other types higher up in the hierachy.
Which method do you think would be ideal in order to do the following:
1) Get the item data count as captured by the user via the transaction ME51N?
2) Get the item data count as collected from the database (i.e. as previously captured) and changed by the user via transaction ME52N?
I have to then make changes exactly at these points.
Thanks again!
Edited by: L J Langa on Apr 16, 2009 3:00 PM

Similar Messages

  • Coming back to the Transaction from a User Exit

    Hi,
    I perform some checks in a User-Exit before saving a transaction & throw an error message if something is not proper. But, the transaction terminates after that. I need to give the user an option to make changes in the transaction. eg, if user exit checks if a certain field should not be empty, the user should have an option to enter the field after the user exit throws the message. How can i go back to the same screen from the exit to achieve the same.
    Thanks in advance.
    Bikash
    This was for a general scenario wherein after an error message triggered by an Exit is displayed, the transaction just terminates.
    Message was edited by: Bikash  Agarwal

    Hi,
    If you give error message, it will leave the current transaction.
    Instead try using some POPUP function module, which will have options 'OK' and 'CANCEL'.
    If user presses 'OK', then allow user to do modifications and if he presses 'CANCEL', then write LEAVE PROGRAM to come out of transaction.
    Hope it helps.
    Regards,
    Shashank

  • Looking for a sort of "activity code" in transactions ME51N/ME52N/ME53N

    Hi all experts, got an - I hope - interesting question to ask you.
    I have an user exit that is executed on every step done in creation/modify of a Purchase requisition. In this code (custom), executed from the transactions ME51(n)/ME52(n) and ME53(n) there's something like:
    GET PARAMETER ID 'BAN' FIELD r_banfn. "Purchase Requisition number
    GET PARAMETER ID 'BFC' FIELD r_frgab. "Release strategy
    r_banfn should contain the number of the purchase requisition I'm working on. So far, so good.
    The problem is that if in ANY transaction I press the New Document button, I can notice in debug that r_banfn contains the number of the purchase requisition that WAS active before pressing the "create new" button.
    That's not good because that r_banfn value is then used to some checks, and should then be blank in case of creation of a new purchase requisitions.
    I'm then asking you if there's a way in my user exit to distinguish between the two cases, which are:
    -1- I'm modifying an existing purchase requisition (so, the field in r_banfn IS correct);
    -2- I'm CREATING a new document (so, r_banfn value is NOT correct and should be set to blank).
    This distinction must be coded into the previously cited user exit and should affect ME51(n), ME52(n) and ME53(n), from which the user can either create a new RdA or modify an existing one.
    We tried to manage the situation as follow, but without success:
    IF NOT r_banfn IS INITIAL.
      CALL FUNCTION 'ENQUEUE_EMEBANE'
           EXPORTING
                banfn          = r_banfn
           EXCEPTIONS
                foreign_lock   = 1
                system_failure = 2
                OTHERS         = 3.
      IF sy-subrc NE 0.
    * Can't lock --> means I'm actually working in modify mode on it
    * leave it as is
      ELSE.
    * locked --> that means I'm not working on this purchase requisition
    * first dequeue the locked purchase req, then set r_banfn to blank.
        CALL FUNCTION 'DEQUEUE_EMEBANE'
             EXPORTING
                  banfn = r_banfn.
    *   clear the variable -> I'm in CREATE mode.
        CLEAR r_banfn.
      ENDIF.
    ENDIF.
    The code is quite self-explaining but doesn't work because it seems that the "enqueue" phase goes ok even tho we're working on modification on the purchase requisition.
    I'm guessing if there's a sort of "activity code" (create? modify? view?) I can catch @ runtime to solve this task.
    Thanks in advance, as usual
    Matteo
    Edited by: Matteo Montalto on Mar 19, 2009 5:15 PM
    Sorry, I edited the title in order to make it more explicative. :-P

    >
    Hi Sandipan, sorry for the late, I tried to manage this task but without success.
    The user exit I'm working on in EXIT_SAPLBBPK_001.
    FUNCTION EXIT_SAPLBBPK_001.
    *"*"Lokale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(IM_BBPDECDATA) LIKE  BBPDECDATA STRUCTURE  BBPDECDATA
    *"     VALUE(IV_MANU_PROF) TYPE  MANPRC OPTIONAL
    *"  CHANGING
    *"     VALUE(CH_PROFILE) LIKE  T160EX-EPROFILE
      INCLUDE ZXBBPU04.
    ENDFUNCTION.
    It includes ZXBBPU04, in which I have to understand if I'm working on a Purch. requisition in MODIFY mode or in CREATE mode.

  • ME52N user exit.

    Hi
    I use user exit SAPLXM02      0111 in transaction ME52N to add new Tab.
    How can I get the fields value of the others SAP standard Tabs like Account Assignment Valuation Material Data u2026.in my exit.
    thanks
    Zvika

    Hi,
    1) CMOD--> Enter you enhancemet name --> Display --> Click components
    2) In componets you can able to see include tables like CI_EBANDB, CI_EBANDBX and CI_EBANMEM.
    3) Double click and include table CI_EBANDB and maintain new fiels.
    4) Implement PR additional tab enhancement  wtih reference to  SAP Note 407975 (i.e. PO enhancement)
    5) for referring SAP note use (http://service.sap.com/)
    Thanks & Regards
    Sudheer Madisetty

  • Pop up screen for stock overview in ME51n through user-exit/BADI

    Hi,
    User wants that at time of  Purchase Requisition creation for any material system should give a pop up window of stock details to provide the status on inventory. 
    For stock summary the t code u201CMMBEu201D for combination of plant and material should run in background and produce output in pop up window. Basically MMBE report output is required for each item line in a pop up window.
    Can this be done through user-exit. I have implemented many user-exits but not sure about the report output in a pop up screen through a user-exit.
    The material stock ia already available under menu enviornment - Material stock(MMBE) but user wants the stock as soon as the material is enetered.
    any inputs.

    Have a look at below link which gives the details abt the user exits related to VA01/VA02.
    http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/content.htm
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • User Exit: Saving data in Production Order Header Long Text

    Hi PP Gurus,
    Can any one let me know which user exit can be used to save some data in the Long Text of Production Order Header.
    We try PPCO0007, it works well on ECC, but my client's system version is 4.7, it does not work.
    In 4.7 version, is there any other User Exit or BADI can be used to comply with this requirement?
    It's quite common requirement, hope someone can help me. Thanks.
    Best regards,
    Sun Qiang

    Hi All,
    Thank for your reply.
    After saving the text using 'SAVE_TEXT' function module and commiting it you need to update the 'ltext' field in AUFK table.
    SELECT SINGLE * INTO wa_aufk FROM aufk WHERE aufnr EQ '000012345678'.
    wa_aufk-ltext = 'D'.
    MODIFY aufk FROM wa_aufk.
    It works in Enhancement PPCO0007.
    This call can be closed. Thanks.
    BR
    Qiang

  • User exit purchase requisition

    Hello,
    I want block automatically items of purchase requisition if the quantity is less a value (stored in a table per material), using the field EBAN-BLCKD, but i don't know where I would introduce this code.
    ¿There are any user exit in the purchase requisition?
    Thanks in advance
    Javier

    Hi Francisco,
    Please refer the folowing link... This program helps you in finding user exits for a perticulat t-code...
    http://www.erpgenie.com/abap/code/abap26.htm
    If required, take help of your developer to copy & run the program
    Thanks & regards
    Mahesh
    Reward points if useful

  • User Exit for Requisition Release Strategy

    Hi All,
    Is anyone able to provide any guidance on determining the release strategy of a purchase requisition via a user exit? It has become neccessary to do this due to certain shortcomings of the classes and characteristic functionality.
    I believe it's possible, I just don't know how.
    Thanks.
    Richard

    go SMOD and enter enhancement M06E0004      it is exit LXM06U13

  • Event triggering before needed in  transaction VA02 as user exit is involve

    Hi All,
    My requirement was to put authorisation check using ABAP coding in VA02 transaction so that a particular user can delete change or modify a particular order . For this i had maintained a ztable in which authorisation was given to each user. For this i used User exit to write my code. Initially tha code was running fine.
    But now whenever i run the Transaction VA02 and enter the order number and hit the enter button , a message is displayed . which shuold have been displayed while the user made changes in line item. This message was written by me , whenever the user who is not authorised to change the Line Item . But it is comming when when order is entered i.e on initial screen.
    So pls Help.
    Thanks & regards
    Vijju.

    Vijju,
    You have done your code in MV45AFZB which also gets triggered on ENTER if data is changed on screen, so behavior is OK.
    i run the Transaction VA02 and enter the order number and hit the enter button , a message is displayed
    This should be NOT the case, it is NOT the same for me, When I open an order in VA02, CHANGE any field and then press ENTER, then only Exit gets triggered and msg should appear.
    If it is appearing for you without changing any field itself, then just DEBUG and check what is the data in XVBAP/YVBAP. Check with some other data as well, I think shouldn't be the case.
    Also, I feel, if you change anything and error comes on ENTER itself before SAVE , it should be actually Fine with the user and is normal with many other std transactions as well.
    1 more point, your condition " IF YVBAP NE XVBAP." should be the first condition and not later, because why you want to do a SELECT if nothing gets changed.
    Regards,
    Diwakar

  • As01 transaction using substitution user exit populate classificaion

    Hi all,
    I have a requirement, where in using the substitution user exit rule U210, I need to populate fields ANLB-NDPER, ANLB-NDJAR and ALNA-VMGLI from the values maintained in Ztable.
    I am able to overwrite the SAP standard values for the fields ANLB-NDPER and ANLB-NDJAR. But not able to populate the filed VMGLI(Classification key).
    For some asset classes, the classification key is not mandatory and the user without giving the value in that field if save the transaction, then I need to populate the value of VMGLI with the ztable value.
    The present rule U210 is not working for classification key.
    Please suggest, is there any other user exit for the scenario where we can populate VBGLI field.
    regards
    Rajani Yeluri

    In the user exit documentation,  it doesn't say anything about this exit being used for validation, therefore,  it probably shouldn't be used as a validation routine, especially if its not being trigger at every PAI. 
    <i>FU EXIT_SAPLAISA_001
    Short text
    Assign Inventory Number
    Functionality
    Using this user exit, it is possible to assign an inventory number when you create a new asset master record.
    Notes
    In the user exit, it is absolutely forbidden to use a statement that leads to an update or removal of database changes. Examples of such statements are:
    'Commit Work' , 'Rollback Work' or call of function module 'DB_COMMIT'.
    Parameter
    I_ANLA
    E_INVNR
    Exceptions
    Function group
    XAIS</i>
    Regards,
    Rich Heilman

  • As01 transaction using substitution user exit populate classificaion key

    Hi all,
    I have a requirement, where in using the substitution user exit rule U210, I need to populate fields ANLB-NDPER, ANLB-NDJAR and ALNA-VMGLI  from the values maintained in Ztable.
    I am able to overwrite the SAP standard values for the fields ANLB-NDPER and ANLB-NDJAR. But not able to populate the filed VMGLI(Classification key).   
    For some asset classes, the classification key is not mandatory and the user without giving the value in that field if save the transaction, then I need to populate the value of VMGLI with the ztable value.
    The present rule U210 is not working for classification key.  
    Please suggest, is there any other user exit for the scenario where we can populate VBGLI field.
    regards
    Rajani Yeluri

    Hi,
    Did you find a solution. I'm just looking for the same thing.
    best regards..

  • Transaction for this user exit

    Hi
    how can i find out to which transaction user exit SDVAX001 belongs?

    Hi Tushar,
    SDVAX001 is a Enhancement not a program , you can see this in SMOD , it will be having comoponents which is again having the supported Exits like Function Module Exits, Screen Exits, Menu Exits.. But this SDVAX001 Enhancement is having a Function Module Exit EXIT_SAPMV45A_001 which will be used to determine the billing plan type . In side this Function Module you can see a include named ZXVVAU01 , this one will be created by us by double clicking on it. In this We will using data of VBAK,VBAP,VBKD,TVAK,TVAP to manipulate  the FPART .
    Hope This Info Helps YOU.
    Regards,
    Raghav

  • Field Status by Transaction code or User Exit

    Hi all,
      Is it possiblee to change field status group according to transaction code and GL account? Any configuration or user exit?
      For example, transaction FB01 account 100000 using Field status group A and transaction FB60 account 100000 using field status group B.
      Or is there any user exit to change the screen of FI transaction?
    Thanks,
    Phon

    Maybe you could try with FI Validations...Tx. <b>OB28</b>
    Greetings,
    Blag.

  • Screen exit MEREQ001- for Transactions ME51N/Me52N/ME53N

    Hi,
      I have implemented the Enhancement MEREQ001 to add a new tab for Purchase Requistion screen.
    Requirement for me is to show the same data in the newly added tab for all line items and also to save the same data in EBAN table.
    I am facing a problem while saving the data. In EBAN table, the data was saved for all line items. But the custom added field values are saved for only the line item displayed.
    I ll explain with an example for better understanding.
    I have created a PR with 2 line items ITEM1 and ITEM2
    When i saved the data when ITEM1 is displayed, EBAN have custom added field values for ITEM1 but not for ITEM2.
    The same way, if I save data when ITEM2 is displayed, EBAN has custom added field values for ITEM2 but not for ITEM1.
      Now, my requirement is to get the both line items ITEM1 & ITEM2 updated with custom added field values in EBAN.
    Has anyone faced this kind of issue.
    Please reply back.
    Regards,
    Sreekanth.G

    Hi,
    Use BADI 'ME_PROCESS_REQ_CUST' to copy item 1 custom fields data to item 2 custom fields data.
    Regards,
    Hemanth

  • 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

Maybe you are looking for

  • Why is Mac Pro 2.66 only 1.3x faster than 2.7 G5 on CPU intensive stuff?

    I produce DVDs so my Compressor DVCam -> MPEG2 encoding is the most time consuming task. Take the MacWorld benchmarks, I was dissappointed the QC 2.66 was a third faster than a DC 2.7 G5 running Compressor. I would have expected almost 2x as fast, ba

  • More Than One App Window Open At A Time

    Hi, Having just done a complete fresh Erase & Install of OS X 10.6, after having had 10..4.11, I find that if I have more than one applications window open with another applications window on the screen ~ say a Finder window, and a Photoshop window,

  • Quantity field in at user-command

    Hi, I have declared the quantity field  V_QTY TYPE AFKO-GAMNG. I am passing the quantity field values from the internal table which is having data for the quantity field to V_QTY. but the field V_QTY is not filling with the quantity. Instead of the q

  • Acrobat XI Outlook 2013 plug-in problems

    I have Outlook 2013 installed on my computer and just downloaded Acrobat XI.  According to some web searches, I should get an Adobe PDF pull-down tab inside Outlook, but there is nothing there.  When I go to Outlook Options/Add-Ins the PDFMaker plug-

  • BT Hub 4 Infinity package 2 and CCTV 37777 & 80,...

    hi i have set up the port forwarding on the Hub and tried using PF config  i get the message port open but timed out  for ports 37777 and 80    but 8081 ran okay port open on three different programmes. have suspended firewall on norton 360 and tried