User Exist for MM - Purchase Order

Hi ABAP expert,
is there any user exist for Purchase order, actually i'm want to prevent the user from do the deletion on PO items, as per my understanding we can use user exit.
can anyone help and how to do the process ?

Hi,
1. Just copy and paste this code and execute it.
2. Give the Tcode "ME21" and you will see the lot of user exits.
TABLES : tstc,     "SAP Transaction Codes
         tadir,    "Directory of Repository Objects
         modsapt,  "SAP Enhancements - Short Texts
         modact,   "Modifications
         trdir,    "System table TRDIR
         tfdir,    "Function Module
         enlfdir,  "Additional Attributes for Function Modules
         tstct.    "Transaction Code Texts
*& Variables
DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30).
DATA : v_devclass LIKE tadir-devclass.
*& Selection Screen Parameters
SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK a01.
*& Start of main program
START-OF-SELECTION.
* Validate Transaction Code
  SELECT SINGLE * FROM tstc
    WHERE tcode EQ p_tcode.
* Find Repository Objects for transaction code
  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 = enlfdir-area.
        MOVE : tadir-devclass TO v_devclass.
      ENDIF.
    ENDIF.
* Find SAP Modifactions
    SELECT * FROM tadir
      INTO TABLE jtab
      WHERE pgmid    = 'R3TR'
        AND object   = 'SMOD'
        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:/(95) sy-uline.
      FORMAT COLOR COL_HEADING INTENSIFIED ON.
      WRITE:/1 sy-vline,
      2 'Exit Name',
      21 sy-vline ,
      22 'Description',
      95 sy-vline.
      WRITE:/(95) sy-uline.
      LOOP AT jtab.
        SELECT SINGLE * FROM modsapt
        WHERE sprsl = sy-langu AND
        name = jtab-obj_name.
        FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
        WRITE:/1 sy-vline,
        2 jtab-obj_name HOTSPOT ON,
        21 sy-vline ,
        22 modsapt-modtext,
        95 sy-vline.
      ENDLOOP.
      WRITE:/(95) sy-uline.
      DESCRIBE TABLE jtab.
      SKIP.
      FORMAT COLOR COL_TOTAL INTENSIFIED ON.
      WRITE:/ 'No of Exits:' , sy-tfill.
    ELSE.
      FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
      WRITE:/(95) 'No User Exit exists'.
    ENDIF.
  ELSE.
    FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
    WRITE:/(95) 'Transaction Code Does Not Exist'.
  ENDIF.
* Take the user to SMOD for the Exit that was selected.
AT LINE-SELECTION.
  GET CURSOR FIELD field1.
  CHECK field1(4) EQ 'JTAB'.
  SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
Thanks,
Reward If Helpful.

Similar Messages

  • Search user-exit for create purchase order

    Hi all,
    i'm searching the user-exit (or BADI) for create purchase order.
    Thanks for help.

    Hi CECG,
    GOTO SMOD and press F4
    then Click on  Information system
    and in the Package name give as     ME
    and press enter.
    you will get all user exits for Purchase Orders
    Hope this solves your problem.
    Please reward points if found helpful.
    Thanks and regards,
    Rajeshwar.

  • User Exit for PO (Purchase Order) Change

    Hi,
    I want to know the SAP Standard User Exit that is triggered ONLY during changing / modification of PO(Purchase Order).
    Thanks in Advance.
    RK

    ME_PROCESS_PO_CUST
    use above BADI for ME22N/ME21N,often we use method PROCESS_HEADER
    PROCESS_ITEM our most of the requirement meet by these methods only,check once if your requirement does meets with these two methods?
    if not than you may implement some more method which are in ME_PROCESS_PO_CUST, for more help you may read documentation,there is well enough documentation already there for each method.
    and for ME22/ME21 you may use
    ME_PURCHDOC_POSTED
    and method POSTED.

  • How can we find a user list for particular Purchase order?

    We are having a Release group, release strategy and release code for purchase order.
    i want the list of users for the particular purchase order..
    can any one hel me.

    Hi,
    This is SAP business one system admin forum. Please find correct forum and repost above discussion to get quick assistance.
    Please close this thread here with helpful answer.
    Thanks & Regards,
    Nagarajan

  • BADI-User exit required for updating Purchase order header field -IHREZ

    Hello All,
    We have requirement in our business to update the purchase order header field "our reference" EKKO-IHREZ with some text field. We need a BADI/user exit that can be used for updating this field . We have checked the BADI ME_PROCESS_PO_CUST and unfortunately we are not able to use this BADI as it getting triggered in enjoy SAP transactions ME21N , ME22N etc. We are not creating the purchase order manually and we are using ME59N for creating Purchase order . Hence we are looking for some user exit/BADI that can be used in ME59N for updating the purchase order header field IHREZ.
    Thanks in advance for your immediate response .
    With regards,
    Joseph Anand B

    TRY using the exist u2022     EXIT_SAPLME59_001
    You can also later on add this field by BAPI_PO_CHANGE

  • Split Valuation of Materials for which Purchase Order exists.

    Hi,
    I want to do the split valuation of materials for which Purchase Order already exists and GR has taken Place.
    Is there any way to do it?
    Regards,
    B P Singh

    Hi,
    Yes, you can.
    Please start transaction MM02 and set the valuation category > you will get an error message > click on 'Display Errors' button and SAP will say what hinders you from the change.
    - you should set the stock level of your material in previous and current period to 0 (it is possible with posting date in the past; MB1A201 > after material master settings you can set back the stock level via MB1A202)
    - delete transactional data (including your PO)
    - mark batch records with DF and archive them
    - etc
    BR
    Csaba

  • Reg. User exist for G/L account change

    Dear Experts
    I want to create new contion or user exist for  change the G/L account from consumption account to
    stock account. 
    That is when I create purchase order with account assignment the stock account should be assigned instead of consuption account.
    Without any account assignment mean no problem,that accounts are posted  correctly.Stock account and GR/IR account.
    Thanks
    Rajakumar.k

    While create Purchase order.
    If    Acct assignment  E      -   Stock account - depending on the material type
         Acct assignment and item cat.  E  & L   WIP of material
    Like the above.
    while I create purchase order the consumption account is posted and after enter the sale order
    the G/L for consumption is changed to stock account. I can see the changes directly.
    Thanks
    Rajakumar.k

  • User exists for ME22N

    Hi all,
    Is there any user exists for the ME22N tcode While Saving PO,  excluding  MM06E005 and M06E0004. These exists are M06E0004 inpacting on Release strategy and other MM06E005 is SAP stored the screens in $tmp because of this  impacting on other tcode me41 going to dump.so anybody can suggest any other  user exists.
    Thank u,
    sksk.

    MEVME001                                WE default quantity calc. and over/ underdelivery tolerance
    MM06E001                                User exits for EDI inbound and outbound purchasing documents
    MM06E003                                Number range and document number
    MM06E004                                Control import data screens in purchase order
    MM06E005                                Customer fields in purchasing document
    MM06E007                                Change document for requisitions upon conversion into PO
    MM06E008                                Monitoring of contr. target value in case of release orders
    MM06E009                                Relevant texts for "Texts exist" indicator
    MM06E010                                Field selection for vendor address
    MMAL0001                                ALE source list distribution: Outbound processing
    MMAL0002                                ALE source list distribution: Inbound processing
    MMAL0003                                ALE purcasing info record distribution: Outbound processing
    MMAL0004                                ALE purchasing info record distribution: Inbound processing
    MMDA0001                                Default delivery addresses
    MMFAB001                                User exit for generation of release order
    MRFLB001                                Control Items for Contract Release Order
    AMPL0001                                User subscreen for additional data on AMPL
    MEQUERY1                                Enhancement to Document Overview ME21N/ME51N
    LMEDR001                                Enhancements to print program
    LMELA002                                Adopt batch no. from shipping notification when posting a GR
    LMELA010                                Inbound shipping notification: Transfer item data from IDOC
    LMEQR001                                User exit for source determination
    LMEXF001                                Conditions in Purchasing Documents Without Invoice Receipt
    LWSUS001                                Customer-Specific Source Determination in Retail
    M06B0001                                Role determination for purchase requisition release
    M06B0002                                Changes to comm. structure for purchase requisition release
    M06B0003                                Number range and document number
    MELAB001                                Gen. forecast delivery schedules: Transfer schedule implem.
    MEFLD004                                Determine earliest delivery date f. check w. GR (only PO)
    MEETA001                                Define schedule line type (backlog, immed. req., preview)
    ME590001                                Grouping of requsitions for PO split in ME59
    M06E0005                                Role determination for release of purchasing documents
    M06E0004                                Changes to communication structure for release purch. doc.
    M06B0005                                Changes to comm. structure for overall release of requisn.
    M06B0004                                Number range and document number
    Regards,
    Madan

  • Data Migration for Open Purchase Order

    Hi, All,
    Is there anyone know how to Count the volume for Open Purchase Order. What's the normal strategy for the Data Migration and Cut-over stage?
    My client want to know how many Open Purchase Order in the legacy system and then determine manual or automatic data migration. If manual, how to do? If automatic, how to do? Because all materials and vendors, plants are different number. How to track? How to find out to match between new and old?
    Thank you very much

    JC,
    Sounds a bit early to be making decisions about the realization phase.  It doesn't sound like you have finished the Blueprinting phase yet, much less the testing phase.
    Anyhow, in my experience I typically use LSMW (Legacy system migration workbench) to load MM master data (material masters), Inventory (WIP, RM, FG, etc) Purchasing Master data (Vendors, Purchase Info Records, Source Lists, Quota Arrangements), and Purchasing transactional documents (POs, PurReqs, Scheduling Agreements, etc).  Depending on the complexity and volume of data, it  may be necessary to write custom programs to load the data.  You will find this out during your requirements gathering.
    It is uncommon but possible to load all of these data manually.  I have never run across a client that wants to pay a consultant's hourly rate to sit at a terminal to peck away loading master data, so if the client intends to have his own users enter the data manually, the project manager should make provision that there will be qualified TRAINED client employees available for this data entry.  I did help with a portion of a conversion once manually; of Sales Credits, but there were only about 30 SD docs to load.   I did this the evening before go-live day, while I was waiting for some of my LSMW projects to complete in the background.
    A good opportunity to 'practice' your data loads is right after you have completed your development and customization, and you have gotten the approval from the client to proceed from the pilot build to the full test environment.  Once you have moved your workbench and customization into the client's test environment, but before integration testing, you can mass load all, or a substantial portion of your conversion data into the qual system.  You can treat it like a dry run for go-live, and fine tune your processes, as well as your LSMW projects.
    Yes, it is good practice to generate comparisons between legacy and SAP even if the client doesn't ask for it. For Purchase orders on the SAP side, you could use any of the standard SAP Purchasing reports, such as ME2W, ME2M, ME2C, ME2L, ME2N.  If these reports do not meet the requirements of the client, you could write a query to display the loaded data, or have an ABAPer write a custom report.
    You didn't ask, but you should also do comparisons of ALL loaded data - including master data.
    It sounds like you are implying that the client wants YOU to extract the legacy data.  For an SAP consultant, this is not very realistic (unless the legacy system is another SAP system).  Most of us do not understand the workings of the myriad legacy systems.  The client is usually expected to produce one or more legacy system technical experts for you to liase with.  You normally negotiate with the technical expert about every facet of of the data migration.  In addition, you will liase with business users, who will help you and the implementation team to logically validate that the final solution (turnkey SAP production system, fully loaded with data) will meet the client's business needs.
    Finally, you mentioned how do you track the mapping of master data between legacy and SAP.  There are many ways to do this.  I normally try to get the legacy person do the conversion on his end, eg, when he gives you the load file, you would like to have already translated the master data and inserted the SAP relevant values into the file.  If this is not possible, I usually use MS Access databases to maintain a master map, and I perform the mapping on a PC.  If your data package is small, you can probably get by using MS Excel or similar.
    Good Luck,
    DB49

  • Urgent - How to change Item category for Open Purchase Order

    Hi Team,
    Lil bit tricky issue.
    My client has asked us to change the existing Item Category values, Combinations, Category Set etc. Its been changed and uploaded successfully.
    The question here is how we need to handle the category for Open Purchase Order. How to update the same.
    Do we need to do manually or any other way ?
    Please advice
    Regarads,
    John

    Hi John,
    This is reallly a tricky issue!
    I guess you cannot change the category of an existing PO's.
    This field will be greyed out once we save the form...there were no profiles/other setups to enable this field.
    For all new PO's since you have changed the new category value that should not be a issue.
    Lets wait for some of our colleuges opinion.
    I guess PO cancel should be the final option if we dont hear any new work arounds.
    Thanks
    -Arif.

  • Problem for Goods Receipt for Subcontracting Purchase Order

    Dear all,
    Presently, we are using SAP version 4.6C and we need to introduce GR for
    Subcontracting Purchase Order. We have developed a ABAP program to handle
    subcon Goods Receipt by uploading flat-files from our subcontractor. The
    scenario is as follows :
    Goods Receipt for Subcontracting Purchase Order
    1. In the ABAP program, function BAPI_GOODSMVT_CREATE will be used for goods
    movement.
    2. Data provided to the function are as follows :
    - Posting date
    - Document date
    - Material number
    - Plant
    - Storage location
    - Batch
    - Movement type (101)
    - Quantity
    - Purchase order number
    - Purchase order item
    - Movement indicator (B - Goods receipt for purchase order)
    3. The function will do data verification and automatically determine GI
    item for subcon stock:
    - Movement type (543)
    - Special stock (O - parts prov. vendor)
    - Material
    - Quantity
    - Plant
    Our problem is that :
    Only the GR item in the interface is to be transferred and the GI item is
    determined by the system. So, the quantity for subcon stock cannot be
    changed using this BAPI. Then the system will continue processing the goods
    receipt and create material document.
    Manually, by using transaction code MIGO, the user can display the subcon
    stock data and then change the quantity.
    By using transaction code MB01, after the user fills in all the GR fields,
    the system comes to line item 002 (subcon stock data) and then quantity can
    be changed.
    As per user requirement, quantity for GI item must be same with the quantity
    that has been transferred to subcon vendor in Delivery for Subcon
    (transaction code VL02N).
    We cannot achieve this requirement by using the BAPI mentioned above. Would
    appreciate any valuable help from anyone who is able to help us on this
    matter. Are there any other BAPI's that can help us to achieve the same
    result ?
    Thank you in advance and best regards.

    As far as i understood the problem I suggest u to create the
    BDC according to user actions that are performed in he manual
    operation.
    I can't say that the BAPI performs the exac solution what you want.
    I have done some BDC work using MB01 and suggest you to be careful
    and try to keep the complete in the logic as some chages in rows in BDC will
    change the complete scenario.And throw correct quantity val in correct
    material
    row.
    This methodology will help u even in mass uploads.
    Or in case of automation u can perform the call transaction BDC in
    background mode.
    so As per my understanding bdc program is the solution. pls try and let me
    know.

  • FM / BAPI Inbound delivery creation for a Purchase Order without material

    Dear All,
    I have a requirement to create a Inbound Delivery for a Purchase order without material number. The Purchase Order has only Material text and no material number. Please let me know a BAPI or FM to create inbound delivery in this case where there is no material defined on PO. I require BAPI / FM  since I have to make a web-service for the same.
    Thanks in advance!
    Abhishek

    Hi I did a coding in one of the userexit. If ekpo-matnr is empty then fill
    KOMDLGN-UMVKZ = 1
    KOMDLGN-UMVKN = 1
    KOMDLGN-MEINS = EKPO-MEINS
    This parameters i.e. Qty conversion are necessary and since MATNR does not exists it has to be filled.

  • Disabling spool request generation for a purchase order

    Hi,
    I have a requirement as follows :
    In ME22n, according to standard configuration for a purchase order whenever the indicators 'Deliv. compl' or 'invoice flag' is checked or unchecked and saved, a spool request is generated. This spool request can be viewed in messages tab of PO.
    My requirement is to disable the spool request generation on change of the above mentioned indicators.
    I have found a user exit 'EXIT_SAPMM06E_016' which is triggerred on clicking on 'SAVE' of PO.
    I am unable to find the field or structure with which i can disable the generation of spool request.
    Your help is much appreciated!
    Thanks & Regards,
    Richa Aggarwal

    Richa,
    you can replace 101 with your routine number. who said you cannot? in NACE, output procedure
    the code in 101.
    FORM KOBED_101.
      LOOP AT XNAST WHERE KSCHL EQ KOMT1-KSCHL AND
                          OBJKY EQ MSG_OBJKY   AND
                          AKTIV EQ SPACE       AND
                          VSTAT EQ '0'.
        EXIT.
      ENDLOOP.
      CHECK SY-SUBRC NE 0.
      SY-SUBRC = 4.
      CHECK ( KOMKBEA-DRUVO EQ NEU OR KOMKBEA-DRUVO EQ AEND ).
      CLEAR SY-SUBRC.
    ENDFORM.
    *       FORM KOBEV_101                                                *
    FORM KOBEV_101.
      LOOP AT XNAST WHERE KSCHL EQ T683S-KSCHL AND
                          OBJKY EQ MSG_OBJKY   AND
                          AKTIV EQ SPACE       AND
                          VSTAT EQ '0'.
        EXIT.
      ENDLOOP.
      CHECK SY-SUBRC NE 0.
      SY-SUBRC = 4.
      CHECK ( KOMKBEA-DRUVO EQ NEU OR KOMKBEA-DRUVO EQ AEND ).
      CLEAR SY-SUBRC.
    ENDFORM.
    so you can copy the code from these forms, and keep them before your code in your custom routine,.. like:
    FORM KOBED_901. "==> i am creating a new VOFM routine 901 here
      LOOP AT XNAST WHERE KSCHL EQ KOMT1-KSCHL AND
                          OBJKY EQ MSG_OBJKY   AND
                          AKTIV EQ SPACE       AND
                          VSTAT EQ '0'.
        EXIT.
      ENDLOOP.
      CHECK SY-SUBRC NE 0.
      SY-SUBRC = 4.
      CHECK ( KOMKBEA-DRUVO EQ NEU OR KOMKBEA-DRUVO EQ AEND ).
      CLEAR SY-SUBRC.
    "==> from here add your code.
    data:lv_subrc type sy-sibrc.
    if xyz NE asdasd "==> your validations..
    lv_subrc = 4.
    endif.
    sy-subrc = lv_subrc.
    ENDFORM.
    *       FORM KOBEV_901                                                *
    FORM KOBEV_901.
      LOOP AT XNAST WHERE KSCHL EQ T683S-KSCHL AND
                          OBJKY EQ MSG_OBJKY   AND
                          AKTIV EQ SPACE       AND
                          VSTAT EQ '0'.
        EXIT.
      ENDLOOP.
      CHECK SY-SUBRC NE 0.
      SY-SUBRC = 4.
      CHECK ( KOMKBEA-DRUVO EQ NEU OR KOMKBEA-DRUVO EQ AEND ).
      CLEAR SY-SUBRC.
    "==> from here add your code.
    data:lv_subrc type sy-sibrc.
    if xyz NE asdasd "==> your validations..
    lv_subrc = 4.
    endif.
    sy-subrc = lv_subrc.
    ENDFORM.

  • IMG settings after creating new output type for a purchase order smartform

    Hi all,
    Do I need to make changes in IMG after creating a new output type in NACE for a purchase order smartform?
    I have customized a purchase order smartform according to the requirements and copied an existing output type and assigned the custom form name.
    When I am trying to create a purchase order to test it, I am going to the message tab for assigning the output type and if I press F4 on the output type field or if I give the copied output type there, it says output type is not defined.
    Do I need to make any changes in SPRO?
    Regards,
    Anik

    Yes. You have to add the new output type to the proper message determination schema.
    Go to the IMG and select Materials Management -> Purchasing -> Messages -> Output control -> Message determination schemas -> Define message schema for purchase order -> Maintain Message Determination Schema: Purchase Order.
    Select the proper schema, then Control Data and insert your new output type into the schema (eventually with any requirement that may be necessary... you probably want to use 101 like in case of the regular NEU message).
    This should do it.

  • New order type for a purchase order similar tu UB.

    Hi,
    I would like to know if it is possible to create a new order type for a purchase order. This new order type should work as a UB order type but "plant" and "storage location" should be indicated by default and shouldn't be changed.
    How should I proceed?
    Thanks in advance.
    Luis.

    The problem is that If I specify default values for each user (plant and storage location) It will always propose these values when using different order types. This can't be.
    Isn't there any other solution in standard sap?
    Edited by: LUIS ÁLVAREZ on Apr 26, 2010 11:25 AM

Maybe you are looking for

  • ITunes album view not working and no album art?

    Hi all - Bought a 64GB iPhone 5 and uploaded my music via my desktop - all seems to have run fine, except that album artwork isn't showing for many of them, even when I select the option "View artwork". I've read on another thread that ID3 tags of 2.

  • Insertion a record in a table having columns of different charsets using OLEDB

    My development environment - Database -> Microsoft SQL Server 2008 R2 OS -> Windows Server 2008 R2 Database Charset -> Chinese_PRC_CI_AS (Windows 936) Operating System Charset -> Chinese Below table is having varchar fields with different charsets. c

  • Problems syncing ipad to iTunes on PC?

    I have recently purchased an iPad mini, but don't seem to be able to connect it to iTunes on my PC?  My PC is running windows XP and the iPad iOS 7.0.4.  When I connect the iPad to the PC the iPad asks if I trust the computer, which I click on the ,T

  • Wfsdupld fails when run against 8.1.7 database on 64 bit Sun SPARC Solaris 8

    Attempting to run in the seed data. Platform is 64 bit Solaris v8 Database is 8.1.7.0 Workflow 2.6 Everything is fine until we run the wfsdupld script. The script fails with ORA-29516 Aurora Assertion Failed: Assertion failure at joncomp.c:127 jtc_ac

  • Dashboard will not launch/load

    I have the dashboard icon in the applicaiton folder and on my dock. When I click on it to launch, nothing happens. When I go into former expose (F3, or 4 finger swipe up), I can see my 2 desktops, but there is NO window for the dashboard as there has