Checking before saving PR

I would like to make a specific field in PR, let say vendor material, to be mandatory for a specific PR document type. It seems that it cannot be done by "Define screen layout at document level".
So I would like to perform a checking before save.
Which user exit should I use? Thanks.

Try this example. Its an adaptation of a code of my own but I haven't checked ABAP syntax so maybe there is a period or somethig missing there.
The idea of the code is to give an error message at item level based on a condition depending on document type and another field in the item (item category). Hope it helps. SL
method if_ex_me_process_req_cust~process_item.
data:l_mereq_item type mereq_item.
l_mereq_item = im_item->get_data( ).
data: error(150) type c.
       if l_mereq_item-bsart eq 'ZSPM' AND l_mereq_item-pstyp ne '9'.
      error = 'Document type can only be used for purchasing of external services'.
       message error type 'E'.
       endif.
endmethod.

Similar Messages

  • Check on vendor email address change before saving PO

    Hi All,
        I need to check Is there any change in Vendor Email address in PO before
    saving. I am trying to find userexits.
    I found some like EXIT_SAPMM06E_012, But here I am not getting complete
    Vendor address...
    Req: I am maintaing multiple email address for Vendor at PO header level.
    Here is the path:  PO Header --> Address tab --> Click on Address Details
    --> Here we can maintain(Insert/ Delete/Change) multiple e mail address.
    So I need to check is there any change in email address before saving.
    Could you please any body help me on this....
    Thanks
    Rays

    Hello Rays,
    One base question,
    Are you going to check the vendor email address manually before saving the PO?
    The vendor address in the puchase order is copied from the vendor master so you can maintain email address (single or multiple) in the vendor master before creating the purchase order. At the time of purchase order creation/save, you can change the default email address and use this to trigger PO to vendor.
    By the way, user exit EXIT_SAPMM06E_012  (Check Customer-Specific Data Before Saving) is used for custom field not for SAP std field.
    Hope this helps.
    Arif Mansuri
    Reward the points if answer is helpful.

  • Create Credit Memo (VA01) - Problem of checking a field before saving

    Hello!
    In tcode VA01, why a field (ex. Customer Group) is checked to be filled before saving in case of a Standard order (type OR, or for us is ZOR), but not in case of a Credit Memo (type CR, or for us is ZCR) ? Is this Config problem? If yes, do you know how to config? If not, do you know any User-Exits I should use? I've tried some but didn't work.
    Please help if you can. Thanks!!

    Hi Timmy,
    Please go to include MV45AFZZ and try the user exits
    USEREXIT_SAVR_DOCUMENT
    in here VBAK values are present in XVBAK and VBAP values in table XVBAP....
    Write the required code here and see if it solves our problem
    Every time user clicks the 'SAVE' button it has to go through this exit
    Regards
    Byju

  • Check mandatory fields before saving

    Hello,
    In my Z-program, how can I check all mandatory fields in a dynpro before saving?
    Is there any function to do that?
    Thanks!!!

    Hi alberto,
    1. If the fields are mandatory (as set in the field attributes while designing the screen),
    2. then we don't have to write any additional logic for the same.
       The system will AUTOMATICALLY check for it, and issue appropriate message.
    regards,
    amit m.

  • InCopy workflow in InDesign: Is there a way to find the document in which an ICML file has NOT been checked IN again before saving the doc?

    The situation:
    We are working with the InCopy feature (checking in and checking out ICML files).
    The problem:
    I might have saved a document with an ICML file still checked out.
    The question:
    Is there a way to find out which document was saved with the ICML file still checked out?
    or in other words:
    Is there a way to find the document in which an ICML file has NOT been checked IN again before saving the doc?
    Thanks for any help!

    Hello Sumit Singh,
    thank you for your answer and your reasonable recommendation. Unfortunately, this only works when the ICML content is used in one INDD file. In our case, we use ICML content in multiple docs (various manuals with the same safety instructions, warranties, adresses etc.).
    So, is there a way to trace back where an ICML has been used?
    Is it possible to find out in which document the ICML is still checked out?

  • Check SD billing price before saving

    Hi experts,
    I need your help.
    I'm looking for an exit to check the price on header and items of the billing document created through VF04 / VF06 / VF01.
    if the price is <= 0 (VBRK-NETWR / VBRP-NETWR) the billing should not be created.
    The exit should allow to stop the billing document posting without the need of writing a "MESSAGE Exxx" so that if the posting is done through a background job for massive posting, it will not lock the whole elaboration, but just the current document.
    Thank you in advance
    - francesco

    Look at [User Exits In Sales Document Processing|http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/content.htm]
    in "User exits in the program MV45AFZZ", form USEREXIT_SAVE_DOCUMENT_PREPARE may fill your requirement
    Use this user exit to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.
    The user exit is carried out at the beginning of the FORM routine BELEG_SICHERN.
    Regards,
    Raymond

  • User Exit for CO01/CO02 : How to check production order before saving ?

    Hi all,
    I try to check production order before saving.
    if  AFPO-LGORT or RESB-LGORT  or some other field is initial, throw an error msg and stop saving process.
    I try using badi WORKORDER_UPDATE and user exit PPCO0001  EXIT_SAPLCOBT_001, find out that i can check the data but can't stop the saving process.
    Anyone knows some other user exits can do this?
    Thanks a lot.

    Solved.
    A wired solution from
    http://abaplog.wordpress.com/2007/03/01/reading-other-programs-data-using-field-symbols-in-abap/

  • Check Batch characteristics before saving

    Hi community,
    i'm searching for a way to check whether characteristics of a batch were changed.
    I found an Badi which is called just before saving the batch.
    My target is to create (as usual) a batch Idoc if a specific characteristic is set to a specific value.
    Thanks & best regards
    Michael

    I forgot one thing.
    If I create the Idoc within the BADI Implementation,
    the batch isn't saved yet.
    how can I trigger the idoc creation <i>after</i> the batch is saved ?
    any ideas ?????

  • Tcode FV50: How to find long text in FI Document line item Before Saving.

    Hi,
    How to find long text in FI Document line item.
    During Parking of the FI document through Tcode FV50 i m giving the some text in the long text not in the text field.
    I would like to validate the Long Text Before Saving in user exit "U300" under  the  "Sunstitution" .
    Please anybody can be help me out where exactly this long text is going to be stored or in which internal table or memory id.
    Please give me the answer as soon as possible .
    Note:- Read_Text function module is not useful. Because Read_text useful after saving document.

    Hi Amit,
    In application area FINANCIAL ACCOUNTING , go for node LINE ITEM. Here create a step & maintain the prerequisite as per your requirement & in the check you can mention the code or you can direct it to a custom program like ZFI_RGGBR000.
    Here while maintaining the check you will get structures BKPF & BSEG in which you will get the desired field you are looking for.
    Just try to explore in your system how the other validations are maintained.
    After you are done with all your code, you have to run the regeneration program RGUGBR00.
    Here utmost care should be taken while running regeneration program, you should select all the checkboxes in the selection screen except  GENERATE SETS, GEN SUBSTN ROUTNS IN ALL CLNTS  & TRACE PROG. GENERATE CALLS .
    Hope this make your doubt clear.
    Regards
    Abhii

  • How to read the status changed in crmd_order txn before saving it to DB.

    hello all,
    My requirement is to perform some checks after the user changes the status
    ( Before saving it to DB i need to do some checks )
    I could find the BADI and Fm's for checking conditions.
    My question is i need to check for a particular status change how do i trace that that particular status which i need to capture has been changed??
    i could see some FM's but it is only fetching the staus save in DB.
    how do i trace the status just after user changes before saving it to DB.
    it's an urgent requirement............pls help me on this..........
    pls get back to me if u want more  details.........
    Thanks,
    Shiva.

    Hello.
    Have you figured this out yet?  We are having the same problem.

  • User Exits for transaction VF01 before saving the billing document

    Can any one say is there any user exit which exits before saving the billing document since i want to check the net value of the billing with the net value of sales order so that it should not go beyond the total amount specified in sales order.

    J_3RSINV
    SDVFX001  User exit header line in delivery to accounting
    SDVFX002  User exit for A/R line in transfer to accounting
    SDVFX003  User exit cash clearing in transfer to accounting
    SDVFX004  User exit G/L line in transfer to accounting
    SDVFX005  User exit reserves in transfer to accounting
    SDVFX006  User exit tax line in transfer to accounting
    SDVFX007  User exit: Billing plan during transfer to Accounting
    SDVFX008  User exit: Processing of transfer structures SD-FI
    SDVFX009  Billing doc. processing KIDONO (payment reference numbe
    SDVFX010  User exit item table for the customer lines
    SDVFX011  Userexit for the komkcv- and kompcv-structures
    V05I0001  User exits for billing index
    V05N0001  User Exits for Printing Billing Docs. using POR Procedu
    V60A0001  Customer functions in the billing document
    V60P0001  Data provision for additional fields for display in lis
    V61A0001  Customer enhancement: Pricing
    These are the Exits Available in the Package
    Jus try finding which will suffice ur Requirement.
    Regards,
    Mithun

  • Print Preview of PO before saving .

    Dear Experts ,
    Is it possible to view a print preview of a PO after  just checking the PO & before saving it ??
    If yes pls let me know how ?
    Regards
    Anis

    Hi Anis,
    yes, you can view a PO in print preview in ME21N before saving it but the following are pre-requisities:
    1 - There are valid messages defined for the PO - check by clicking on 'Messages' at the top of the screen. So long as there is a message defined, you can display, if not, add the output type that you would like to use (NEU for example).
    2 - The output type must be pointing correctly to a printer or valid e-mail address (for e-mail outputs)
    3 - You must have access to transaction ME9F in authorisations - although you are not navigating to ME9F, you will still need the access
    If these things are OK, click on print preview and you will get an image of what the printed document will look like.
    Rob

  • How do I add a validation prompt before saving a form?

    Hello
    I have a registration form for a family camp. The first page collects the personal information and the second page calculates a financial total. I don't have LifeCycle and designed this using Adobe X Pro. I use a third party data extractor tool for forms returned to move the typed information into Excel. The problem I'm running into is a lot of people don't scroll and complete the second page of the form before saving and submitting it. This results in incomplete information when we extract to Excel and more work for us to process the application.
    My thoughts are this could be partially remedied if the user received a prompt when they go to save the form or after a certain field was completed (perhaps clicking the "I agree" button) that asks them to double check to make sure they completed the second page. Similar to how if they try to type in letters in the phone number field they receive a message that they can only use numbers.
    The problem I'm having is I have no idea if we can create a prompt when someone goes to save the form, or if I can trigger a prompt for after someone completes a particular field and how to go about doing either? Does anyone have any suggestions on how I can accomplish this or where I can look to for some further help?
    Thanks!
    Neil
    PS Here's the form I'm working on - http://accwesterncamp.com/wp-content/uploads/2015/03/Western-Camp-Application-2015-Fillabl e.pdf

    Sorry for the link that turned bad above. Here's a functional one: http://accwesterncamp.com/wp-content/uploads/2014/10/Western-Camp-Application-2015-Fillabl e.pdf
    Ultimately I have decided against continuing to work with a PDF fillable. The functionality I ultimately wanted was too cumbersome. In doing additional research I came across Adobe Forms Central which is being decommissioned. In the FAQ section I found a recommendation for an online form design service called Cognito which I ultimately decided to go with. This service allows registrants to register multiple people, pretty robust form logic, and process payment all at one go. The cost is very small too. If you would like to see how the digitization and online processing of the form turned out you can see it here: http://accwesterncamp.com/registration/
    Thanks for all the help and recommendations in the forum though!

  • How to read header text in MM contract (ME31K/ME32K) before saving record?

    Hi All,
    In ME31K / ME32K (Contracts), before saving the contract I would like to check if the user has entered header text in the contract or not.
    I am using customer exit MM06E005.
    Can anybody help me with this?
    Thanks in advance.

    Try creating dummy text id which will be part of text determination procedure @ Customers sales text & document header text.
    else, maintain the SO10-text against this text ID. whenver user createds quotation this text will be defaulted irrespective of the cusotmer.
          then based on if user want to modify the text they have to enter manually in this text id. print this text in header.
    Regards,
    Reazuddin MD

  • How to validate the values inputted in Salestext view at MM02 before saving

    Hello All,
    Does anyone know what FM or user exit to use in order to validate the values inputted in Salestext view at MM02 transaction before saving it.
    Regards,
    Alfred

    Hello,
    Find the user exits if any after finding keep the break point in the exits and check that cursor is trigrring that exit or not. If it triggers check the value of the salestext exits in the exporting parameters or not.
    if exits then keep do the validations.
    UserExits MM02
    MGA00001            Material Master (Industry): Checks and Enhancements
    MGA00002            Material Master (Industry): Number Assignment
    MGA00003            Material Master (Industry and Retail): Number Display

Maybe you are looking for

  • Close window in web dynpro abap

    Hi, I have a web dynpro application for a workflow. When a user clicks on the workitem in UWL, a window opens with task description and two button on it. When the user clicks on one of the button, my requirement is: I want to close that window. How c

  • Java.lang.NullPointerException in DataCacheManager

    java.lang.NullPointerException at kodo.datacache.DataCacheManager.<init>(DataCacheManager.java:43) at kodo.conf.JDOConfigurationImpl.getDataCacheManager(JDOConfigurationImpl.java :1356) at kodo.runtime.PersistenceManagerFactoryImpl.getPersistenceMana

  • Regarding tables coss and cosp

    Hi Experts, In table AUFK there is object number field against order and against that object number there are lot of entries in tables coss and cosp. I need to know from which transaction these entries get updated and also can we come to know from th

  • Print JTable with column heading

    Hi, I'm very new to this JTable. I'm try to print a Jtable using the print() function (from JDK 1.5) JTable.print(JTable.PrintMode.FIT_WIDTH, new MessageFormat( _tabledata.getTitle() ), new MessageFormat("Page {0,number}")); The problem I have is tha

  • IPad Calendar editing defaults to Cupertino time zone

    When I go to edit a calendar entry on my iPad of an event that I created previously in Outlook on my work PC, the time zone becomes Cupertino, CA during the calendar event editing process.  I live in the Chicago (Central) time zone so the calendar ev