Raising Error messages

Hi all,
We are using SAP ABAP Web Dynpro Component: RPLM_QIMT_NOTIF_COMP to create notification(IW21). After entering data to create notification screen and press save, we want to do some validations and trough error message to screen and stop saving notifications until errors are fixed. I am able to raise error message but not able to stop further processing. Notification is geting saved even after trowing error message. could some one give us clue or Rather sample code to stop further processing. Notification is created via portal.
Rgds,
Harish
Edited by: Harish Aginati on Jul 19, 2009 2:25 PM

hi,
You can use Report Error message. ( control wizard ).
Use below mentioned code :
get message manager
DATA lo_api_controller     TYPE REF TO if_wd_controller.
DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
  RECEIVING
    message_manager = lo_message_manager
report message
CALL METHOD lo_message_manager->report_error_message
  EXPORTING
    message_text             = ' Error messge Text'
   params                   =
   msg_user_data            =
   is_permanent             = ABAP_FALSE
   scope_permanent_msg      = CO_MSG_SCOPE_CONTROLLER
   view                     =
   show_as_popup            =
   controller_permanent_msg =
   msg_index                =
   cancel_navigation        = ' X'
  receiving
    message_id               =
Give Cancel navigation X.
I hope it works.

Similar Messages

  • How to raise error message from PAI of oops ALV report

    Hi All,
    I have a requirement to raise error message form editable oops alv . After entering the data and then press SAVE button .
    Please help.
    Thanks in Advance

    HI SK,
    Write a Local class (Event Handeler) to handel the events. In Editable ALV once the user enter a value, CL_GUI_ALV_GRID will raise an event called DATA_CHANGED.
    1. Define and Implement a local class to handle that event.
    In the implementation of this class you need to get data from imported object to an internal table, then compare the same with the ALV output table.
    * Local Class to handler the events raised from the ALV Grid
    CLASS LCL_EVENT_HANDLER DEFINITION.
    PUBLIC SECTION.
    * Method to handel EDIT event, DATA_CHANGED of CL_GUI_ALV_GRID
      METHODS : ON_DATA_CHANGE FOR EVENT DATA_CHANGED OF CL_GUI_ALV_GRID
                           IMPORTING ER_DATA_CHANGED.
    ENDCLASS.
    * Event handler class Implementation
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
      METHOD ON_DATA_CHANGE.
        DATA : LT_MODIFY TYPE LVC_T_MODI,
                   LS_MODIFY TYPE LVC_S_MODI.
    * Copying changed data into intenal table from Object
        LT_MODIFY = ER_DATA_CHANGED->MT_MOD_CELLS.
    * Modifying the ouptut table with the changed values
        IF LT_MODIFY[] IS NOT INITIAL.
              *Compare the ALV Output table with LT_MODIFY
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    Then raise  a message on required condition in the same method.
    Note: To trigger the above method, you need to set event handler before displaying ALV (before calling method SET_TABLE_FOR_FIRST_DISPLAY)
    * Creating object for the Local event handler class
      CREATE OBJECT GR_HANDLER.
    * Set handler (call method of Event_handler) to handler Edit event
      SET HANDLER GR_HANDLER->ON_DATA_CHANGE FOR  GR_GRID.
    Regards,
    Vijay

  • Need a BADI for raising error messages for equi update (IE02)

    Hi,
    we are trying to raise few error messages while creating equipments through BADI's (Processing through IE02 and BAPI's).
    No BADI's are supporting for raising error messages.
    SAP doesnt support processing of userexits through BAPI's (refer note 564467).
    we actually need to implement these checks and should available for all the below processes:
    Through IE02
    while doing through BAPI's
    While Executing MASS CHANGE functionality (IE05)
    Please suggest any other solution to achieve all the three at one go instead of creating some enhancements for every thing.
    thanks.

    Hi,
    Try and search for a BADI....for transaction I102...take the package name and go to SE18 and see if BADI's are available...
    Alternatively search for key CL_EXITHANDLER or get BADI in the main program of IE02..
    if you are using SAP ECC6.0 then implicit or explicit enhancements will be available... Utilize them to meet your requirement...
    Thanks

  • How to raise Error Message in foreground through Dynamic Action?

    Hi,
    I have a requirement where I have to raise an error message in foreground so as to stop processing whenever HR_INFOTYPE_OPERATION fails to update a record in a dynamic program. I tried using MESSAGE statement but it did not work, as the error message was not displayed properly on the Infotype screen that calls the dynamic action.
    For ex.: If infotype PA0000 is calling PA0014 through dynamic action, then I want the error message to be displayed on the Actions Screen of PA0000.
    Is there any specific way to raise error messages through dynamic action programs?
    Quick answers will be appreciated.

    HI Sanjana,
    In the Substitution exits you can create the message in the configuration it self.
    You dont't need raise message explicitly.
    Thanks,

  • Raising Error message

    Hi all,
    We are using SAP ABAP Web Dynpro Component: RPLM_QIMT_NOTIF_COMP to create notification(IW21). After entering data to create notification screen and press save, we want to do some validations and trough error message to screen and stop saving notifications until errors are fixed. Could someone give us clue how we raise error messages. Rather sample code to raise error messages. Notification is created via portal.
    Rgds,
    Harish

    Hello Harish,
    When the user presses on the save button, an event would be triggered. You can catch this event and perform your validations. Once the validations are done, you can use the FPM message manager to report your error messages. (IF_FPM_MESSAGE_MANAGER). You can instantiate this API in your component and then use the methods from this API to report your messages on the UI.
    Regards
    Rohan

  • How to raise error message in substitution exits?

    Hello Experts,
    How to raise error message in substitution exits. I have tried with normal statement,
    Message 'Welcome!!' type E.
    But its inot stopped at that error message, Its goes next standard code and picked other messag and shown as error message.
    Th exit seems U100, I that I want to stop by using error message based on some condition. Please throw the answer quickly

    HI Sanjana,
    In the Substitution exits you can create the message in the configuration it self.
    You dont't need raise message explicitly.
    Thanks,

  • How to raise error message in MB_DOCUMENT_BEFORE_UPDATE?

    Dear Friends,
    I have a situation like, need to thro an error Message inside the BADI: MB_DOCUMENT_BEFORE_UPDATE.
    Based on some validations on XMSEG parameter inside the above BADI, I am raising an Error Message as usual.
    Message E208(00) with 'Posting error..'.
    When I raise the above error, the system ends with Short Dump.
    Could anyone please let me know, how to handle the above?
    Thanks in advance,
    Ramani N

    >
    Gaurav Gupta wrote:
    > Hi
    > I would like to suggest you to check whether you have used MESSAGE-ID addition in your REPORT statement or not. We are supposed to use it whenever we are trying to display error messages like *Message E208(00) with 'Posting error..' *.
    > Hope this solves your Problem.
    >
    > Regards
    > Gaurav.
    Hi Gaurav,
    My query is about BADI.  Hence, we can not use REPORT statement.
    Rgds,
    Ramani N

  • Suggest a way to raise error message.

    Hi Gurus,
    i am developing an enhancement for transaction QA10, QA11, QA12, QA16 , QA17, QA40, QA41.
    above transactions are to perform UD or Change UD (Usage Decision ) in foreground or background mode.
    Our requirement is to raise a error message if any NOTIFICATIONS are OPEN in QMEL Table for Material and Batch Combination for which UD is been done.
    We have to generate an error message as-  Open Notification XXXX for material XXXX Batch XXXX exist.
    But we can have more than one Notification for a material and batch combination, notifications can be of any number.
    we cannot show the error message as a-
    1.  pop-up with alv containing error's as UD can be also done in background mode.
    2.  nor we can raise a long message as Notification's can be of any number.
    what are the ways we can show error message in this scenario.
    Regards,
    Akash Rana

    Issue Resolved

  • Raising error message in a programme

    Dear All,
    I need to know a way in order to raise an error message in programme i.e when there is an error in the programme and if I run this program it should raise an error message.
    With Regards,
    Madhu.S.N

    Hi,
    write the statement :
    message E001 with text-001.
    Depending on the program context, an error dialog appears
    here the program stops because of the eerror message, if you correct that and reexecute then this will work.
    whateer you give in the TEXT-001, that will come as a message, and this message will show in the status bar...
    if you write this in the selection screen : -
    Selection screen processing terminates, and the selection screen is redisplayed. The screen fields specified through the additions to the AT SELECTION-SCREEN statement are ready for input. The user must enter a new value. The system then restarts the selection screen processing using the new values. You cannot use error messages with the ON HELP-REQUEST or ON VALUE-REQUEST additions. Instead, a runtime error occurs.
    Regards
    Sudheer

  • Alv oops raising error message

    Hi,
    iam displaying output using alv oops.
    one of the char field is editable i want to give only numeric values only.i cannot change datatype to numc for that field.if user enters char value(like abc) and click on any button in alv output i want to raise a error message and i want to stop the user in alv report output.
    Regards,
    Suresh

    Hello Suresh
    I assume that the editable field in your ALV list is defined as CHAR type in the underlying table (structure). In order to prevent non-numeric entries I would use the following approach:
    Define additional column for your ALV list, e.g.:
    TYPES: BEGIN OF ty_s_outtab.
      INCLUDE type <name of z-table> AS data.
    TYPES:  numfield(4)    TYPE n.  " Assumption: Your editable field is CHAR4, e.g. charfld
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab  TYPE STANDARD TABLE OF ty_s_outtab WITH DEFAULT KEY.
    DATA: gt_outtab   TYPE ty_t_outtab.  " your itab for ALV list
    Build fieldcatalog automatically and add additional column for NUMFIELD:
    " Call fm LVC_FIELDCATALOG_MERGE with your z-table
      LOOP AT gt_fcat INTO ls_fcat
                                WHERE ( fieldname = <name of editable field> ).
         " Suppress this field
           ls_fcat-tech = 'X'.
           MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
        " Modify LS_FCAT to reflect the additional NUMC4 field
          ls_fcat-fieldname = 'NUMFIELD'.
          ls_fcat-rolltype = ...  " change technical details from CHAR4 -> NUMC4
          ls_fcat-edit = 'X'.  " Now the NUMC4 field is editable
          INSERT ls_fcat INTO gt_fcat INDEX syst-tabix.
      ENDLOOP.
    Initial load of outtab: shuffle values from CHAR4 to NUMC4 field
    REFRESH: gt_outtab.
      LOOP AT gt_data INTO ls_data.
        clear: ls_outtab.
        ls_outtab-data = ls_data.
        move ls_data-charfld TO ls_outtab-numfield.
        APPEND ls_outtab TO gt_outtab.
      ENDLOOP.
    Regards
        Uwe

  • Raise Error Message in ESS for invalid Mobile number IT0105 - 9004

    Hi Experts,
    I was asked to put a small validation on mobile number being entered by user in his personal details (to check country code).
    As we are using both PA30 and ESS, I have implemented both the BADI's
    HRPAD00INFTY (for PA30) and HRPAD00INFTYDB (under enhancement spot HRPAD00INFTYBL) for ESS.
    My first one is working fine and stops user from entering wrong mobile number.
    Coming onto second one for ESS, I have written my coding in the method IF_EX_HRPAD00INFTYDB~UPDATE_DB as follows
        CASE infty.
        handle infotype 0105
          WHEN '0105'.
            CASE subty.
              WHEN '9004'.
                ASSIGN operation-old_pnnnn->* TO <old_p0105>.
                ASSIGN operation-new_pnnnn->* TO <new_p0105>.
                ASSIGN operation-new_psref->* TO <new_psref>.
                ASSIGN operation-old_psref->* TO <old_psref>.
                CASE operation-opera.
            UPDATE
                  WHEN if_hrpa_masterdata_db=>update_operation.
                    lv_prefix1 = <new_p0105>-usrid+0(4).
                    IF lv_prefix1 EQ '9715'.
                      lv_length = STRLEN( <new_p0105>-usrid ).
                      lv_length = lv_length - 4.
                      IF lv_length NE 12.
                        RAISE EXCEPTION TYPE cx_hrpa_violated_assertion.
                      ENDIF.
                    ELSE.
                        RAISE EXCEPTION TYPE cx_hrpa_violated_assertion.
                    ENDIF.
    Now though this method is getting trigged and doing the validation perfectly, it is resulting in RUNTIME ERROR due to "RAISE EXCEPTION TYPE cx_hrpa_violated_assertion" which is un-caught.
    Can any one please let me know how to send back the error message without runtime error so that user has clear knowledge of mistake that he has done.
    Appreciate any help in this regard,
    Thanks,
    Lakshmi Narayana

    Why don't you use HRPAD00INFTYUI instead?
    ~Suresh

  • 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

  • MBVR reservation deletion raising error message

    Hi,
    When we run the MBVR T-Code for deleting the reservations, it's throwing an error "A system error has occured while locking data". The error message number is M7 110. Could you please help me in understanding why this error occurs. The lock mode is set as "Blck reservations individually".
    Thanks,
    K R Vishnu Kumar

    The program "RM07RVER " has exceeded the maximum permitted runtime            
    and has therefore been terminated.                                            
    After a certain time, the program terminates to free the work process         
    for other users who are waiting.                                              
    This is to stop work processes being blocked for too long by                  
    - Endless loops (DO, WHILE, ...),                                             
    - Database acceses with large result sets,                                    
    - Database accesses without an apporpriate index (full table scan)            
    - database accesses producing an excessively large result set,                
    The maximum runtime of a program is set by the profile parameter              
    "rdisp/max_wprun_time".                                                      
    The current setting is 3200 seconds. After this, the system gives the         
    program a second chance. During the first half (>= 3200 seconds), a           
    call that is blocking the work process (such as a long-running SQL            
    statement) can occur. While the statement is being processed, the             
    database layer will not allow it to be interrupted. However, to               
    stop the program terminating immediately after the statement has been         
    successfully processed, the system gives it another 3200 seconds.             
    Hence the maximum runtime of a program is at least twice the value of         
    the system profile parameter "rdisp/max_wprun_time".

  • SRM 7.0 Process-Controlled (BRF) Workflow -- Error message to Shopping Cart

    I am modifying a BRF Expression used to calculate approval levels.  During this calculation, I may run into error conditions (e.g. Currency tranlsation not found) that I want to display to the user (in the Shopping Cart).
    I have tried raising the following exceptions:
    /sapsrm/CX_WF_RULE_ERROR.
    /sapsrm/CX_WF_RULE_ABORT.
    Raising these exceptions do result in SLG1 log entries being written, but the User is not informed of the error (ie. at top of shopping cart where other messages display).
    I can probably jump out of the Webdynrpo to read logs, but thought there MUST be some standard way of passing error conditions from the BRF, back to WF, and then back to the Webdynpro Window.
    Anybody raise error messages back to the online user from Process-Controlled Workflow?
    Thanks,
    - Tim

    >
    Saravanan Dharmaraj wrote:
    > Hi Tim,
    >
    >    I am not sure about your business requirement, but if you want to display custom error message while user create a SC, SAP has provided a standard BADI - BBP_DOC_CHECK_BADI. You can implement this Badi to raise a custom error,warning message. You can build your brf logic in the BADI implementation..
    >
    >
    > Best Regards,
    > Saravanan Dharmaraj.
    Hi Saravanan,
    I am actually modifying the Approval Limit Checks (for multi-currency translations) that you recently coded in Maryland.  It can occur that errors occur in determining limits (new Currency translation I just added), or during the lookup of agents (ie user config is inconsistent).
    In these cases, I can make the shopping cart Dump, by raising untrapped error messages, or assertions.   However, I would like to raise exceptions that get trapped (such as the ones I identified in original post), and then make their way to the shopping cart.
    Unless I am missing something, I don't think the WF BADIs, or BRF are gonna communicate errors back to the shopping cart, even though these components are called during cart creation and checks.
    I realize that I can recode the Agent Determination BADIs,  BRF calls, or even read BRF logs within BBP_DOC_CHECK_BADI.  I mentioned this in my original posting as well.
    Anyway, any help is appreciated.
    Thanks,
    - Tim

  • How to display error message in MSS

    Hi all ,
    I want to desplay an error message in MSS(Portal) at the time of  compensation management .
    I am implementing BADI HRECM00_SALARY.
    Please suggest me how to do that .
    Thanks in advance .
    Naval Bhatt
    Edited by: naval  bhatt on Jun 11, 2008 11:16 AM

    Hi,
    Raise error message in between begining of the BADI  HRECM00_SALARY and Closing statement of BADI.
    Implement the BADI at the time of Creating or submit the details of compensation.
    Thanks
    Gopal.sattiraju

Maybe you are looking for