Display error message in user-exits for ME21n

Hi,
I want to give error message in exit EXIT_SAPMM06E_013
but it is getting displayed as information and gets roll back .
Can anyone help to display error message and stop there itself so that to give corret data and save.
the code in this exit is as below.
IF I_EKKO-BUKRS = '0800'.
    CLEAR:V_FLAG.
    READ TABLE TEKPA WITH KEY PARVW = 'ZN'.
    IF SY-SUBRC NE 0.
      MESSAGE E000(ZD)."'XXX' TYPE 'E'.
    ENDIF.
ENDIF.
Thanks,
Suresh

check this
EXIT_SAPMM06E_012 to display error message
especially look at the last post , adding the log.

Similar Messages

  • Display error message in user-exit EXIT_SAPMP56T_002

    Hi,
    I'm doing a validation in user-exit EXIT_SAPMP56T_002 (include ZXTRVU03), and I want to display a error message. So, I'm using the instructions:
    continue_with_update = 'N'.
    MESSAGE ID xxx TYPE 'E' NUMBER yyy.
    What happens is that in SAP GUI it works fine, but in SAP Portal it gives a lot of java exceptions.
    Is there other way to display the error message that it works fine in the portal?
    Thanks.
    Sónia

    Hi,
    I tried with that but it doesn't work.
    With the instruction "Message ID..." the portal shows an RFC ERROR SYSTEM FAILURE with all that java exceptions.
    With your suggestion it does not retrieve my message, and instead it retrieves a customized message "Trip cannot be saved in this status, check mileage start and end location", that refers to the expense report and does not make any sense when I'm only creating the trip.
    Any idea for this?
    Thanks.
    Sónia

  • User exit - for ME21N, 22N, 23N - at line item level

    Hi,
    I want to add new text field to display the description of the MPM(material) in it.
    That filed I want to add to the Account Assignment tab at item level.
    How to add that field on the screen, I mean any screen exit for this?
    and function module to pass the data to that field.
    If anybody worked on such problem then pls. let me know.
    Thanks in advance.
    -- Umesh

    Hi,
    These are the user exits for me21n.                
    AMPL0001          
    LMEDR001          
    LMELA002          
    LMELA010          
    LMEQR001          
    M06B0001          
    M06B0002          
    M06B0003          
    M06B0004          
    M06B0005          
    M06E0004          
    M06E0005          
    ME590001          
    MEETA001          
    MEFLD004          
    MELAB001          
    MEVME001          
    MM06E001          
    MM06E003          
    MM06E004          
    MM06E005          
    MM06E007          
    MM06E008          
    MM06E009          
    MM06E010          
    MMAL0001          
    MMAL0002          
    MMAL0003          
    MMAL0004          
    MMDA0001          
    MMFAB001     
    Regards
    praveen

  • User Exit for ME21n - Urgent

    HI all,
    I want to add a function module when a Purchase order is saved(ME21n), i want to know how to find user exit for ME21n & which user exit to be changed.
    I want to call a function module when the user saves the purchase order, please help.
    Please also let me know the step to find the user exits.
    Thanxs in advance.

    Hi,
    Please check enhancement MM06E005 (SMOD).
    Here list of User exit and BADI for ME21N .
    Transaction Code - ME21N                    Create Purchase Order
    Enhancement/ Business Add-in            Description                                                    
    USER EXIT                                                                               
    MELAB001                                Gen. forecast delivery schedules: Transfer schedule implem.    
    MEQUERY1                                Enhancement to Document Overview ME21N/ME51N                   
    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                             
    MM06E011                                Activate PReq Block                                            
    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                     
    LMEDR001                                Enhancements to print program                                  
    LMEKO001                                Extend communications structure KOMK for pricing               
    LMEKO002                                Extend communications structure KOMP for pricing               
    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            
    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                               
    M06B0003                                Number range and document number                               
    M06B0002                                Changes to comm. structure for purchase requisition release    
      Business Add-in  - BADI                 
    ME_PROCESS_REQ                          Enhancements for Processing Enjoy PReqs: Internal              
    ME_PROCESS_PO_CUST                      Enhancements for Processing Enjoy Purchase Order: Customer     
    ME_PROCESS_PO                           Enhancements for Processing Enjoy Purchase Order: Intern.      
    ME_PROCESS_COMP                         Processing of Component Default Data at Time of GR: Customer   
    ME_PO_SC_SRV                            BAdI: Service Tab Page for Subcontracting                      
    ME_HOLD_PO                              Hold Enjoy Purchase Orders: Activation/Deactivation            
    ME_GUI_PO_CUST                          Customer's Own Screens in Enjoy Purchase Order                 
    ME_DEFINE_CALCTYPE                      Control of Pricing Type: Additional Fields                     
    ME_COMMTMNT_REQ_RE_C                    Check of Commitment Relevance of Purchase Requisitions         
    ME_COMMTMNT_REQ_RELE                    Check of Commitment Relevance of Purchase Requisitions         
    ME_PROCESS_REQ_CUST                     Enhancements for Processing Enjoy PReqs: Customer              
    ME_PURCHDOC_POSTED                      Purchasing Document Posted                                     
    ME_RELEASE_CREATE                       BAdI: Release Creation for Sched. Agreemnts with Rel. Docs     
    ME_REQ_OI_EXT                           Commitment Update in the Case of External Requisitions         
    ME_REQ_POSTED                           Purchase Requisition Posted                                    
    ME_TAX_FROM_ADDRESS                     Tax jurisdiction code taken from address                       
    ME_TRIGGER_ATP                          Triggers New ATP for Changes in EKKO, EKPO, EKPV               
    MM_EDI_DELFOR_OUT                       Enhancements for IDoc Output of SA Releases: Internal          
    MM_EDI_DESADV_IN                        Supplementation of Delivery Interface from Purchase Order      
    MM_EDI_ORDERS_OUT                       Enhancements for IDoc Output of Purchase Order: Internal       
    SMOD_MRFLB001                           Control Items for Contract Release Order                       
    ME_COMMTMNT_PO_REL_C                    Check for Commitment-Relevance of Purchase Orders              
    EXTENSION_US_TAXES                      Extended Tax Calculation with Additional Data                  
    MEGUI_LAYOUT                            BAdI for Enjoy Purchasing GUI                                  
    ME_ACTV_CANCEL_PO                       BAdI for Activating the Cancel Function at Header Level        
    ME_BAPI_PR_CHANGE_01                    BAdI: Enjoy BAPIs for Purchase Requisitions (Method Change)    
    ME_BAPI_PR_CHANGE_02                    BAdI: Enjoy BAPIs for Purchase Requisitions (Method Change)    
    ME_BAPI_PR_CREATE_01                    BAdI: Enjoy BAPIs for Purchase Requisitions                    
    ME_BAPI_PR_CREATE_02                    BAdI: Enjoy BAPIs for Purchase Requisitions (Method Create)    
    ME_BSART_DET                            Change document type for automatically generated POs           
    ME_CCP_ACTIVE_CHECK                     BAdI to check whether CCP process is active                    
    ME_CCP_BESWK_AUTH_CH                    BAdI for authorization checks for procuring plant              
    ME_CCP_DEL_DURATION                     Calc. of Delivery Duration in CCP Process (Not in Standard)    
    ME_CHANGE_CHARACTER                     Customer-Specific Characteristics for Product Allocation       
    ME_CHECK_ALL_ITEMS                      Run Through Items Again in the Event of Changes in EKKO        
    ME_CHECK_SOURCES                        Additional Checks in Source Determination/Checking             
    ME_CIN_LEINRF2R                         BADI for CIN India - Delivery charges                          
    ME_CIN_LEINRF2V                         BADI for LEINRF03 excise_invoice_details                       
    ME_CIN_MM06EFKO                         Copy PO data for use by Country version India                  
    ME_CIP_ALLOW_CHANGE                     Configuration in Purchasing: Changeability Control             
    ME_CIP_REF_CHAR                         Facilitates Reference Characteristics in Purchasing            
    ME_COMMITMENT_STO_CH                    BadI for checking if commitments for STOs are active           
    ME_COMMTMNT_PO_RELEV                    Check for Commitment-Relevance of Purchase Orders              
    <b>Reward points</b>
    Regards

  • How can i display warning messages in user exit EXIT_SAPLMGMU_001 (MM02)

    Hi all,
    while modifying the material master using MM02, i have added new conditions to display messages in user exit EXIT_SPALMGMU_001.
    But using this user exit i am not able to display warning messages.
    Can you please help me with this?
    Sample code which i have included in exit :
    SELECT SINGLE mstav FROM mara
    INTO w_mstav
    WHERE matnr = wmara-matnr.
    IF wmara-mstav NE w_mstav.
    IF wmara-mstdv NE sy-datum.
    wmara-mstdv = sy-datum.
    MESSAGE w177(z03_mm) WITH text-s04 text-s21.
    ENDIF.
    ENDIF.
    Thank you all in advance.

    As written in the SAP documentation of the Enhancement , you can only raise error message using a
    MESSAGE .. RAISING APPLICATION_ERROR.
    You could manage the "warning" yourself, sending an error first time and keeping a trace of the check in some STATICS variable, and not raising the error again if data input remains unchanged between two call of the include.
    <i>----
    EXIT_SAPLMGMU_001
    Where Is the Customer Exit - EXIT_SAPLMGMU_001 called?
    The customer exit is in function module MATERIAL_UPDATE_ALL. The
    function module checks the data for errors (logical relationships,
    foreign keys, fixed domain values, and so on) when the material master
    is updated.
    Use
    o New fields
    You can make checks possible for new fields of your own. These
    checks must be identical to the checks that you carry out for your
    new fields in online maintenance.
    o Existing fields
    For existing fields, you can extend and intensify the checks.
    You can also change data for descriptions and general material data
    (MARA). For example, the descriptions can be generated from attributes
    of the material.
    Limitations
    You cannot bypass existing checks.
    Interface to Application
    The respective data of the current logical transaction is contained in
    the structures, for example, in structure WMARA for MARA. Nonrelevant
    structures are transferred with their initial values.
    General material data that can be changed (CMARA) has the structure
    MARU. This MARA view contains fewer internal fields than MARA itself. If
    WMARA is filled, CMARA is also filled when accessed.
    The customer exit contains the exception APPLICATION_ERROR for your
    self-defined error situations.
    Using the language element MESSAGE .. RAISING APPLICATION_ERROR, you can
    terminate the current (logical) transaction and display your message in
    the log. </i>
    Regards

  • Badi & User Exit for ME21N & ME22N

    Hi,
            My requirement is when a Purchase order is created using ME21n or when a line is added or changed using ME22n, the system should copy the vendors tax jurisdiction to the purchase order line items jurisdiction code. I tried badi (ME_PROCESS_PO_CUST) but could not suceed. Can any one tell me if any badi or user exit available for the same???
    Thanks in Advance.

    hi,
    Enhancement/ Business Add-in            Description
    Enhancement
    MEQUERY1                                Enhancement to Document Overview ME21N/ME51N
    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
    MELAB001                                Gen. forecast delivery schedules: Transfer schedule implem.
    AMPL0001                                User subscreen for additional data on AMPL
    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
    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
    M06B0003                                Number range and document number
    Business Add-in
    ME_PROCESS_PO                           Enhancements for Processing Enjoy Purchase Order: Intern.
    ME_PROCESS_COMP                         Processing of Component Default Data at Time of GR: Customer
    ME_PO_SC_SRV                            BAdI: Service Tab Page for Subcontracting
    ME_PO_PRICING_CUST                      Enhancements to Price Determination: Customer
    ME_PO_PRICING                           Enhancements to Price Determination: Internal
    ME_INFOREC_SEND                         Capture/Send Purchase Info Record Changes - Internal Use
    ME_HOLD_PO                              Hold Enjoy Purchase Orders: Activation/Deactivation
    ME_GUI_PO_CUST                          Customer's Own Screens in Enjoy Purchase Order
    ME_FIELDSTATUS_STOCK                    FM Account Assignment Behavior for Stock PR/PO
    ME_DP_CLEARING                          Clearing (Offsetting) of Down Payments and Payment Requests
    ME_DEFINE_CALCTYPE                      Control of Pricing Type: Additional Fields
    ME_COMMTMNT_REQ_RE_C                    Check of Commitment Relevance of Purchase Requisitions
    ME_COMMTMNT_REQ_RELE                    Check of Commitment Relevance of Purchase Requisitions
    ME_PROCESS_PO_CUST                      Enhancements for Processing Enjoy Purchase Order: Customer
    SMOD_MRFLB001                           Control Items for Contract Release Order
    MM_EDI_DESADV_IN                        Supplementation of Delivery Interface from Purchase Order
    MM_DELIVERY_ADDR_SAP                    Determination of Delivery Address
    ME_WRF_STD_DNG                          PO Controlling Reminder: Extension to Standard Reminder
    ME_TRIGGER_ATP                          Triggers New ATP for Changes in EKKO, EKPO, EKPV
    ME_TRF_RULE_CUST_OFF                    BADI for Deactivation of Field T161V-REVFE
    ME_TAX_FROM_ADDRESS                     Tax jurisdiction code taken from address
    ME_REQ_POSTED                           Purchase Requisition Posted
    ME_REQ_OI_EXT                           Commitment Update in the Case of External Requisitions
    ME_RELEASE_CREATE                       BAdI: Release Creation for Sched.Agrmts with Release Docu.
    ME_PURCHDOC_POSTED                      Purchasing Document Posted
    ME_PROCESS_REQ_CUST                     Enhancements for Processing Enjoy PReqs: Customer
    ME_PROCESS_REQ                          Enhancements for Processing Enjoy PReqs: Internal
    ME_COMMTMNT_PO_REL_C                    Check for Commitment-Relevance of Purchase Orders
    ME_CCP_BESWK_AUTH_CH                    BAdI for authorization checks for procuring plant
    ME_CCP_ACTIVE_CHECK                     BAdI to check whether CCP process is active
    ME_BSART_DET                            Change document type for automatically generated POs
    ME_BAPI_PR_CREATE_02
    ME_BAPI_PR_CREATE_01
    ME_BAPI_PO_CREATE_02
    ME_BAPI_PO_CREATE_01
    ME_BADI_DISPLAY_DOC                     BAdI for Internal Control of Transaction to be Invoked
    ME_ACTV_CANCEL_PO                       BAdI for Activating the Cancel Function at Header Level
    MEGUI_LAYOUT                            BAdI for Enjoy Purchasing GUI
    EXTENSION_US_TAXES                      Extended Tax Calculation with Additional Data
    ARC_MM_EKKO_WRITE                       BAdI: Enhancement of Scope of Archiving (MM_EKKO)
    ARC_MM_EKKO_CHECK                       BAdI: Enhancement of Archivability Check (MM_EKKO)
    ME_CCP_DEL_DURATION                     Calc. of Delivery Duration in CCP Process (Not in Standard)
    ME_COMMTMNT_PO_RELEV                    Check for Commitment-Relevance of Purchase Orders
    ME_COMMITMENT_STO_CH                    BadI for checking if commitments for STOs are active
    ME_COMMITMENT_RETURN                    Commitment for return item
    ME_CIP_REF_CHAR                         Enables Reference Characteristics in Purchasing
    ME_CIP_ALLOW_CHANGE                     Configuration in Purchasing: Changeability Control
    ME_CIN_MM06EFKO                         Copy PO data for use by Country version India
    ME_CIN_LEINRF2V                         BADI for LEINRF03 excise_invoice_details
    ME_CIN_LEINRF2R                         BADI for CIN India - Delivery charges
    ME_CHECK_SOURCES                        Additional Checks in Source Determination/Checking
    ME_CHECK_OA                             Check BAdI for Contracts
    ME_CHECK_ALL_ITEMS                      Run Through Items Again in the Event of Changes in EKKO
    ME_CHANGE_OUTTAB                        Enrich ALV Output Table in Purchasing
    ME_CHANGE_CHARACTER                     Customer-Specific Characteristics for Product Allocation
    No.of Exits:         35
    No.of BADis:         55
    Arunima

  • User exit for ME21N (Not functional or customer exit)

    Hi Guys,
    I want to get a user exit for PO as my requirement is to call  custom screen before the PO is getting saved.
    I have the functional exits and badi's list which will not fulfill my requirement as because on my custom screen i have cancel button.
    On clicking the control needs to come back to the me21n second screen with the data entered with out order getting created.
    The screen number for the second screen in ME21N  is 14.
    if i call screen 14 it will work in a user exit where as in customer exit(functional exit) we have limitations with the exporting and importing as so the screen number will not be recognised.
    I am able to do the same calling of cust screen in Sales order creation and is sucessfull, the same should happen with PO also.
    Probably if the user exit triggers at the time of syntax check i can achive my requirement rather than at save as the call back to the screen will not harm and database commits will not take place.
    I also tried with all most of the enahancement points but the call screen statement is not working at any point of time which worked with Sales order exits. So i tried with making the validation fail but still by that time the PO number is getting generated and so if i try to cancel the PO before save and trying to get PO in edit mode but the sequence number is getting missed by by 1.
    Please help.
    Regards,
    Amar.
    Edited by: amar srinivas on Feb 11, 2011 10:16 AM
    Edited by: amar srinivas on Feb 14, 2011 4:56 PM

    Hi,
    You can try it this way.
    Check badi ME_PROCESS_PO_CUST , method - CHECK.
    This badi/method gets triggered when the "CHeck" button and "SAVE" button is pressed.
    It consists of a changing parameter CH_FAILED . Pass X to it when cancel button is hit in your custom screen.
    Donot use any commit in this method. Read the documentation before doing it.

  • BADI/user exit for ME21N - Warning message for "our reference" field

    Dear all,
    I have a problem.
    In ME21N, I need to show a warning message (message w... ) when user enter an already-used-before input in "Our reference' field (EKKO-UNSEZ).
    I've tried in two methods.
    1. Using fm EXIT_SAPMM06E_004. But it can only works for Error message. My warning message never shows up.
    2. Tried to implement classic BADI ME_PROCESS_PO_CUST, using the PROCESS_HEADER method. Got the break-point spot on, but still didn't show the warning message.
    Why is my warning message always got override?
    Please advise.
    Thanks in advance
    Ahmad

    Hi Ahmad,
    Check the below links:
    Unable to put Warning messages in ME21N and ME22N in Exit / BAdI in ECC 6.0
    Warning message in me22n check user-exit can't process?
    Custome warning message in T. code me51n me52n & me21n , me22n
    Regards,
    Nisha Vengal.

  • User exit for ME21N for displaying the tax code from custom table

    Hi,
      I have a requirement, in our system, the inforecord is not maintain for all the material and vendor combination,  we have a custom table in which we have maintain the
    Compnay code, Pur. Org., Vendor code  Tax code,  juridiction code
    now we want that when a Po is created with ME21 or ME21N  the tax code and jurisdiction code should be come from this table  and if entry not found in this table then it should search as per the regular process like from last Po or info record.  then which user exit we can use for this.
    regards,
    zafar

    CLOSE

  • Custom error message in user exit is giving Short dump

    Hi All,
    We have a scenario where in if any user try to create/Change/Delete particular types of contract in SAP system we have to issue error message
    saying ZIN/ZIR contract creation/Change/Deletion is blocked in SAP. This has to be done from the web application. So we are putting below code
    in user exit MV45AFZZ in the form USEREXIT_SAVE_DOCUMENT_PREPARE.
    CONSTANTS: lc_vbcpic01 TYPE sy-uname VALUE u2018VBCPIC01u2019, u201CWeb application user ID
             lc_zin           TYPE vbak-auart VALUE u2018ZINu2019,
                         lc_zir            TYPE vbak-auart VALUE u2018ZIRu2019,
                         lc_text(32)    TYPE c VALUE u2018Check long text for more detailsu2019.
    DATA: l_uname TYPE sy-uname.
    CLEAR: l_uname.
    MOVE sy-uname TO l_uname.
    *If user ID is not the Web application ID then block the creation/Change/Deletion
    IF   l_uname NE lc_vbcpic01
    AND ( vbak-auart EQ lc_zin
    OR    vbak-auart EQ lc_zir ).
    MESSAGE e830(zv) WITH lc_text.
    ENDIF.
    This code is working fine while creating/Changing the contract i.e. Giving us error message so that user wonu2019t be able to create/change the contract.
    But when we delete the contract from VA42, Control is coming to this message statement and is giving Short dump. Below is the error analysis of the dump.
    Error Analysis:
    During "Exit Command" processing, the program tried to send a " " message.
    This is not allowed at this point in processing.
    The program had to be terminated.
    Screen name.............. "SAPMV45A"
    Screen number............ 4001
    If any one has come across such scenario/any work around for this problem please let me know your inputs. Your inputs are highly appreciated.
    I am working on 4.6C version of SAP.
    Note: When i issue information/Warning message contract is getting deleted after displaying the message.
    Thanks,
    Vinod.

    I exactly replicated the same in DELETE_DOCUMENT also
    I am getting the Dump. I tried with exit also , but it continued and deleted. To avoid deletion we have to use Leave program or LEAVE TO CURRENT TRANSACTION.
    Delete Function is Defined as EXIT command. so it is not possible to give error message. To convice you i just copied demo program and raised the error message.
    it is also giving the dump.
    copy the demo program DEMO_DYNPRO_AT_EXIT_COMMAND and make this change , information to error .
    MODULE cancel INPUT.
      MESSAGE e888(sabapdocu) WITH text-001 ok_code input1 input2.
      IF ok_code = 'CANCEL'.
        CLEAR ok_code.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.
    and see...

  • Raising error messages in user exit..

    hi,
    i have my code in sales order user exit FORM USEREXIT_SAVE_DOCUMENT.
    the code needs to check for a condition and if that fails i do not want to allow the user to save the sales order, rather do the change as i expect.
    i can display the message using my message class, right ? but then how to prevent further action of saving the sales order ?
    thks

    After you give the error message, set the FCODE to 'ENT1'.
    Like:
            message e398(00) with
                    'Some error occured. Press enter.'.
            fcode = 'ENT1'.
    Regards,
    Naimesh Patel

  • User-exit for ME21N: Check if outline agreement is valid (for date)

    Hopefully someone has seen this before..
    When creating a PO with ME21N, it is possible to create the PO with reference to an agreement that is not valid any more (Validity end field in ME33K is before todays date). No warning or error message is presented to the user.
    I have a list of 38 user-exits available for ME21N, but none of them seems to focus on this problem.
    I have to have EKKO-KDATE available in the exit, I think...
    Exit Name (for ME21N)
    AMPL0001 
    LMEDR001 
    LMELA002 
    LMELA010 
    LMEQR001 
    LMEXF001 
    LWSUS001 
    M06B0001 
    M06B0002 
    M06B0003 
    M06B0004 
    M06B0005 
    M06E0004 
    M06E0005 
    ME590001 
    MEETA001 
    MEFLD004 
    MELAB001 
    MEVME001 
    MM06E001 
    MM06E003 
    MM06E004 
    MM06E005 
    MM06E007 
    MM06E008 
    MM06E009 
    MM06E010 
    MMAL0001 
    MMAL0002 
    MMAL0003 
    MMAL0004 
    MMDA0001 
    MMFAB001
    MRFLB001
    LMEKO001
    LMEKO002
    MM06E011
    MEQUERY1

    Hello Helge,
    Did u try using EXIT_SAPMM06E_004. This is in the enhancement MM06E004. Use the code in the exit.
    tables: ekko.
    data: v_date like ekko-kdate,
          ebeln like ekko-ebeln.
    data: prog(30) value '(SAPLMEPO)ekko'.
    field-symbols: <fs1> type any.
    assign (prog) to <fs1>.
    ekko = <fs1>.
    *ekko-ebeln = <fs1>-ebeln.
    select single kdate into v_date from ekko
                 where ebeln = ekko-konnr.
    if v_date < sy-datum.
       message e000(zhb).
    endif.
    Try this.

  • Error Message in user-exit  EXIT_SAPLRRS0_001 in Query

    Hi,
    ABAP BW Guru's
    I got an ABAP  type problem with RANGE numeric variables  in EXIT_SAPLRRS0_001.
    With character or dates iuser-exits worke fine.
    My characteristic is CONNID Type  NUMC 4
    My user-exit variable is named CONNID_EXIT_STEP_2.
    My ABAP processing in the exit for the user-exit varibale is quite simple (testcase):
      DATA: l_e_t_range TYPE rsr_s_rangesid.
      l_e_t_range-low  =  '17'.
      l_e_t_range-opt  =  'EQ'.
      l_e_t_range-sign =  'I'.
      APPEND  l_e_t_range      TO   e_t_range.
    My Error message in the BEX Analyser is:
    Value "17" for user-exit variable CONNID_EXIT_STEP_2 is inavlid.
    What's wrong with the ABAP processing in the exit  (testcase) ?
    The debugger clearly shows l_e_t_range-low with value 17.
    l_e_t_range-low  seems is a character.
    Anyone can give a tip ?
    Thank You !
    Martin
    ThanXs

    Dear Karthik,
    You are right. First time my user exit execute, after that report automatically call message located Function Module LCOPDU13 504th row
         IF NOT SY-MSGID IS INITIAL.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    Message number is 806 message id is RU.
    Can you help me for fix this situation? I just want to add a data control in ZXCOFU05 user exit. For user fill data (werks based)
    Thanks your helpful answer

  • Error message from user exit - current screen becomes grayed(non-editable)

    I am working on a Sales Order (VA01/VA02) user exit(USEREXIT_SAVE_DOCUMENT_PREPARE) in MV45AFZZ program. I am validating certain values entered by user in this exit. Based on a condition, I issue a error message e.g. "message e001(ZV) with .....". I expect the processing to interrupt and the system control  returns to the current screen. When there is an error, error message shows up on the status bar, but the current screen is completely grayed out(non-editable), not able to modify the incorrect entries. I keep hitting ENTER but no change to the grayed screen. Is there anything wrong in the way I issue error message?
    I am on ECC6.
    Thanks.

    could you please help me if possible in my senario :-
    I am validating a field(serial number while creating delivery) in standard exit ZXQSMU04 and written a code to display an error message. The functionality is working correctly on validation and displaying the error message. But once the error is getting trigger the serial number field is becoming in gray mode i.e non editable.
    I tried a lot to overcome this issue but not getting success could anyone help me to make the field editable while triggering the error message.
    Please note : Its an exit and not having any message field in export or return table. Also tried with warning and information message.
    Thanks in advance.
    Regards,
    Gautam Kumar

  • Error message in user Exit

    Hi friends,
    Iam working on sone userexit in tcode Ko01 . actually  i have to through the error message ...break point comes to that point it is not throughting that message...the message format i have used is
    MESSAGE msgtypemsgnumber(messageid)   WITH 'text message'.
    the FM in which the include is there does not contain exceptions then can u plz tell me how i should through the error message....
    thanks in advace...

    hi praja,
    i m also facing the same problem. have u got any solution for this problem? if u have any solution pls share with me.
    regards,
    vicky.

Maybe you are looking for