Displaying Error Messages in a variant FM (Object Dependency)

Hi Guru's,
I've developed a variant Function Module (FM) for validating the characteristics of a material.
In the validation, if the condition doesn't satisfied, i need to through error message.
In the variant FM, under the exceptions tab., always 2 parameters we should declare like following..
1 FAIL
2.Internal_Erro
I'm using the following syntax for throwing the error message.
MESSAGE EXXX(MSG_CLASS) RAISING FAIL.
With the above syntax i'm not able to get the error message at all??
If i use the normal syntax like MESSAGE EXXX(MSG_CLASS), it is causing me other problems???
Could you please let me know how to display the error messages in Variant FM????
Thanks for the Help in advance..
Thanks,
Adi.

Usually in a function module, where you write source code, the line where you want to raise an exception ..you can raise exception this way
RAISE FAIL.
  or 
RAISE Internal_Erro.
In the program/report where you call your function module, you can get the exception using sy-subrc and display your custom message as
CALL FUNCTION <FM>
* EXPORTING
* IMPORTING
EXCEPTIONS
   FAIL                        = 1
   Internal_Erro          = 2
IF SY-SUBRC <> 0.
  if sy-subrc = 1.  " Exception - FAIL
    MESSAGE EXXX(MSG_CLASS).
  elseif sy-subrc = 2. "Exception - Internal_Erro
    MESSAGE EXXX(MSG_CLASS).
  endif.
ENDIF.

Similar Messages

  • Displaying error messages from application log

    Hi,
    I am using the function module RV_DELIVERY_CREATE for creating delivery in my program. If the sy-subrc is not zero i.e if delivery is not created, i have to display error messages collected inside the application.How can i do this ?
    The object nd subobject are existing in SLG0 but when i
    tried to see the object and subobject in SLG1 transaction , no logs were found.
    Do we need to activate the object and sunobject somewhere before logging can take place??
    I am using the following code in my program to display the logs but it is displaying no logs found: 
    CALL FUNCTION 'APPL_LOG_SET_OBJECT'
          EXPORTING
            object                    = 'ZCH_SCL'
            subobject                 = 'DL'
      LOG_HANDLE                = ' '
      NO_LOG                    = ' '
    EXCEPTIONS
      OBJECT_NOT_FOUND          = 1
      SUBOBJECT_NOT_FOUND       = 2
      OTHERS                    = 3
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    CALL FUNCTION 'APPL_LOG_INIT'
    EXPORTING
    OBJECT                    = 'ZCH_SCL'
       SUBOBJECT                 = 'DL'
      LOG_HANDLE                = ' '
    EXCEPTIONS
      OBJECT_NOT_FOUND          = 1
      SUBOBJECT_NOT_FOUND       = 2
      OTHERS                    = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
          PERFORM z_call_rv_delivery_create. " to call fm rv_delivery_create
          IF sy-subrc ne 0.
            CALL FUNCTION 'APPL_LOG_DISPLAY_INTERN'
      EXPORTING
        object                               = 'ZCH_SCL'
       subobject                            = 'DL'
       title_list_screen                    = 'Error Logs'
      COLUMN_SELECTION                     = '11112221122   '
      COLUMN_SELECTION_MSG_JUMP            = '1'
      EXTERNAL_NUMBER_DISPLAY_LENGTH       = 20
      I_S_DISPLAY_PROFILE                  =
    IMPORTING
      NUMBER_OF_PROTOCOLS                  =
    EXCEPTIONS
      OBJECT_NOT_FOUND                     = 1
      SUBOBJECT_NOT_FOUND                  = 2
      OTHERS                               = 3
    thanks,
    vartika

    Hi Vartika,
    you need to save that log after creating and appending to it.
    here is a code to save that log.
    If log created, save to database
      if e_bal_hndl is not initial.
        refresh: bal_hndl.
        append e_bal_hndl to bal_hndl.
        call function 'BAL_DB_SAVE'
          exporting
            i_client         = sy-mandt
           i_in_update_task = 'X'
            i_t_log_handle   = bal_hndl
          importing
            e_new_lognumbers = log_no
          exceptions
            log_not_found    = 1
            save_not_allowed = 2
            numbering_error  = 3
            others           = 4.
    u have to write this code after appending info to Log.
    hope this will help.
    regards,
    vikas

  • Internet Sales B2C - Display error message on the basket

    Hi, I am working on developments on the Internet Sales B2C scenario. I am trying to add new checks that are to be performed after the user has clicked the "Order" button on the basket.jsp page.
    I have already created the action and the BO, BOM, and Backend object and I changed the action flow so after b2c/basketcheckout.do instead of calling b2c/maintaincheckout.do the system calls my own action, and if I have an error what I am doing is calling the addMessage() on the Basket object, and then sending the action flow to b2c/basketdisplay.do.
    Everything is working fine except that the messages that I add to the basket are not shown when basket.jsp is displayed and I think this is because somewhere after the b2c/basketdisplay.do action is called and before the basket.jsp page is displayed the standard deletes any messages on the basket.
    Should I change my program so instead of calling b2c/basketdisplay.do I call a different action to display the basket but keep my messages?
    Does anyone has any better idea than what I am doing rigth now? I would gladly appreciate any help.
    The config.xml that I have looks like this:
    <action path="/b2c/basketcheckout" type="com.sapmarkets.isa.isacore.action.b2c.order.MaintainBasketB2CCheckoutAction">
                   <forward name="login" path="/b2c/login.jsp"/>
                   <forward name="basketEmpty" path="/b2c/order/basketEmpty.jsp"/>
                   <forward name="checkout" path="/b2c/basketchecktopes.do"/>
                   <forward name="ordersplit" path="/b2c/busy.jsp"/>
              </action>
              <action path="/b2c/basketchecktopes" type="com.orbitel.isa.action.CheckTopes">
                   <forward name="checkout" path="/b2c/maintainCheckout.do"/>
                   <forward name="basket" path="/b2c/basketdisplay.do"/>
              </action>
    And the coding in my action is:
    UserSessionData userSessionData = UserSessionData.getUserSessionData(request.getSession());
    BusinessObjectManager bom = (BusinessObjectManager)userSessionData. getBOM(BusinessObjectManager.ISACORE_BOM);
    SalesDocument miOrden = bom.getBasket();
    if(miResp.equals("A"))
         return mapping.findForward("checkout");
    else
         miOrden.addMessage(new Message(Message.ERROR, "system.forward.info", new String[]{"Ha superado el tope de sesion"}, null));
         return mapping.findForward("basket");
    Thanks
    Juan

    You can do this using java script throwing an alert popup or you can check if the fields are initial in oninputprocessing and fill a variable like gv_error = 'Enter values of mandatory fields.' and display the same in layout using
    <phtmlb:messageBar id = "messageBar"
    type = "<%= gv_severity_str %>"
    text = "error"/>
    See this thread for more..
    How to display error messages in bsp page
    search the forum before posting a new thread....

  • Display error message in batch job log

    Hello
    I have a batch job running and I have an error coming during some validation logic.
    The problem is I need to continue the batch job when this error message comes and it should not cancel the batch job as it is doing currently but display that error message in batch job log, there are more similar error messages coming in job log and job gets finished, but when my error message comes job gets cancelled.
    I cannot give it as info message as it will give wrong idea about message type.
    Is there any FM by which we can add message in job log?

    Sanjeev I have done that but problem is I do not want to give that as Information message but Error message only and continue processing.
    If you see in screenshot 3rd message is given by me as information and you can see error messages also 6th and 7th and job continued till it is finished
    Basically I want that 'I' to be displayed as 'E'.
    Display error message in batch job log 

  • How to display error message ??

    Hi,
    I have a BDC program to upload data from an excel sheet. I could see that some records of data fail to pass and hence after my bdc run i would like to display error message for the failed records as follows:
    costcenter:
    cost element:
    fiscal year:
    etc etc
    is it possible ?? how to do that ? please explain in detail.
    for ur reference my program is pasted below.
    thanks
    *& Report  ZBDC_BUDGET_UPLOAD
    REPORT  ZBDC_BUDGET_UPLOAD.
    types: begin of tdata,
             rec(150) type c,
           end of tdata,
           begin of tmtgp,
             costcent LIKE CCSS-KOSTL,
             costelem LIKE CCSS-KSTAR,
             fisyear LIKE CCSS-GJAHR,
             jan(10),
             feb(10),
             mar(10),
             apr(10),
             may(10),
             jun(10),
             jul(10),
             aug(10),
             sep(10),
             oct(10),
             nov(10),
             dec(10),
           end of tmtgp.
    data: idata type table of tdata with header line.
    data: imtgp type table of tmtgp with header line.
    Data : fieldval(10) type c.
    selection-screen begin of block b1 with frame title text-001.
    parameters: p_file type localfile default 'C:\budget_data_csv.csv'.
    selection-screen end of block b1.
    include zbdcrecx1.
    at selection-screen on value-request for p_file.
    call function 'KD_GET_FILENAME_ON_F4'
            exporting            static    = 'X'
            changing            file_name = p_file.
    start-of-selection.
    perform upload_data.
    loop at imtgp.
    Write imtgp-fisyear to fieldval.
    perform open_group.
    perform bdc_dynpro      using 'SAPLKPP0' '1000'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'KPP0B-VALUE(04)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'KPP0B-VALUE(04)'
                                  fieldval.
    Write imtgp-costcent to fieldval.
    perform bdc_dynpro      using 'SAPLKPP0' '1000'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'KPP0B-VALUE(06)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'KPP0B-VALUE(06)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP0' '1000'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'KPP0B-VALUE(09)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-costelem to fieldval.
    perform bdc_field       using 'KPP0B-VALUE(09)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP0' '1000'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'KPP0B-VALUE(04)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=CSPB'.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-jan to fieldval.
    perform bdc_field       using 'Z-BDC03(01)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-feb to fieldval.
    perform bdc_field       using 'Z-BDC03(02)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(03)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-mar to fieldval.
    perform bdc_field       using 'Z-BDC03(03)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(04)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-apr to fieldval.
    perform bdc_field       using 'Z-BDC03(04)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(05)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-may to fieldval.
    perform bdc_field       using 'Z-BDC03(05)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(06)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-jun to fieldval.
    perform bdc_field       using 'Z-BDC03(06)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(07)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-jul to fieldval.
    perform bdc_field       using 'Z-BDC03(07)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(08)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-aug to fieldval.
    perform bdc_field       using 'Z-BDC03(08)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(09)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-sep to fieldval.
    perform bdc_field       using 'Z-BDC03(09)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(10)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-oct to fieldval.
    perform bdc_field       using 'Z-BDC03(10)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(11)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-nov to fieldval.
    perform bdc_field       using 'Z-BDC03(11)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(12)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    Write imtgp-dec to fieldval.
    perform bdc_field       using 'Z-BDC03(12)'
                                  fieldval.
    perform bdc_dynpro      using 'SAPLKPP2' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z-BDC03(12)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=CBUC'.
    perform bdc_transaction using 'KP06'.
    perform close_group.
    endloop.
    form upload_data.
    data: filename type string.
    clear idata.
    refresh idata.
    filename = p_file.
    call function 'GUI_UPLOAD'
        exporting            filename        = filename
        filetype        = 'ASC'
        tables            data_tab        = idata
        exceptions            file_open_error = 1
        file_read_error = 2
        no_authority    = 6
        others          = 17.
        check sy-subrc = 0.
        loop at idata.
        clear imtgp.
        split idata at ',' into imtgp-costcent imtgp-costelem imtgp-fisyear
    imtgp-jan imtgp-feb imtgp-mar imtgp-apr imtgp-may imtgp-jun imtgp-jul
    imtgp-aug imtgp-sep imtgp-oct imtgp-nov imtgp-dec.
        append imtgp.
        endloop.
    endform.

    check the below code,.,
    DATA : t_bdcmsgcoll TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE.
      CALL TRANSACTION '<DELIVERYTRANSACTION>' USING t_bdctab
                              mode 'N'
                              MESSAGES INTO t_bdcmsgcoll.
      DESCRIBE TABLE t_bdcmsgcoll LINES g_lines.
      READ TABLE t_bdcmsgcoll INDEX g_lines.
      IF t_bdcmsgcoll-msgtyp = 'S' AND
         t_bdcmsgcoll-msgid = <Msg id> AND
         t_bdcmsgcoll-msgnr = <Msg number>.
    * Trap your Call Transaction messages
        t_success-deliverynumber = t_bdcmsgcoll-msgv1.
    * You can format the message returned by call transaction using function 'FORMAT_MESSAGE' which will return g_mesg
        t_success-message = g_mesg.
        APPEND t_success.
        CLEAR  t_success.
      ELSE.
    * If there an Error-Do this..
        READ TABLE t_bdcmsgcoll WITH KEY msgtyp = 'E'.
        IF sy-subrc = 0.
    * Format your message using FORMAT_MESSAGE "FM
         CLEAR g_mesg.
         t_error-msg   = g_mesg_incl.
         APPEND t_error.
         CLEAR  t_error.
       ENDIF.
    ENDIF.
    * Clear for next run
      CLEAR: t_bdcmsgcoll,
             t_bdctab.
      REFRESH: t_bdcmsgcoll[],
               t_bdctab[].

  • Prb display error message while creating PR at ME51n in ME_PROCESS_REQ_CUST

    Hi All,
    I have this requirement to check the cost center availability in PR screen (ME51n).
    If cost center in the Account assignment tab is not empty, display error message  and not able to create the PR.
    With my code below, it doesn't triggered the error message and PR created.
    Could anyone help?
    METHOD if_ex_me_process_req_cust~process_account.
    DATA: w_account_ref TYPE exkn.
    w_account_ref = im_account_ref->get_data( )
    IF w_account_ref-kostl IS NOT INITIAL.
      MESSAGE e303(ME) WITH text-001 w_account_ref-kostl text-002.
    ENDIF.
    ENDMETHOD.
    Thank you.
    SW

    Hi,
    You have to use definition MMPUR_MESSAGE 'E'  ME 303   text-001 w_account_ref-kostl text-002.
    This will throw the error during check and save instead of message e303(me) .
    Hope it helps.
    Sujay
    Edited by: Sujay Venkateswaran Krishnakumar on Oct 5, 2010 2:54 PM

  • A way to display error messages from the program

    Dear all,
    I am looking forward to display a set of error messages(in a internal table) during the execution of the program to the user.
    I wanted to know the better way of displaying error messages from my program with more options.
    Well I tried out using displaying errors as ALV list/Grid or as simple list processing.
    But I found some  stanadard transactions (Like in MM and FI  where errors are shown in a better way, but failed to find out how they are done.
    Please guide me.
    Thanks in advance
    Aryan

    Try to use application logging it has a very good way to display a set of messages.
    [http://abap4.tripod.com/Using_Application_Logging.html|http://abap4.tripod.com/Using_Application_Logging.html]
    Run this report in se38 an example sap report to understand logging way to show a set of messages
    Report Name  :  SBAL_DEMO_01
    Edited by: Vighneswaran CE on Dec 19, 2010 3:01 PM
    Edited by: Vighneswaran CE on Dec 19, 2010 3:11 PM

  • Displaying error messages in table...

    Hi All,
    How can we display error messages in a table in a bsp page.
    I am filling an internal table in OnInputProcessing on some event with all the error messages to be displayed.
    Table sould have two columns
    1)Graphic depending on error type.
    2)Error message.
    Thanks,
    Anubhav.

    Hi Graham,
    The solution is perfect!
    One more thing...when the page is displayed with errors table , i need to set focus on the table.
    My code is:
    <htmlb:gridLayoutCell columnIndex="1" rowIndex="1" id="fourthmain">
    <% if itab_message is not initial .%>
      <table class=""urGridLayout" border="1" cellpadding="2" id="err_tab">
        <%
      loop at itab_message into wa_message.
        %>
        <tr>
        <td class="urCoB2Whl">
        <% case wa_message-typ.
          when 'S'. %>
          <htmlb:image src = "ICON_MESSAGE_INFORMATION" />
          <% when 'error'. %>
          <htmlb:image src = "ICON_MESSAGE_ERROR" tooltip="Error" />
          <% when 'W'. %>
          <htmlb:image src = "ICON_MESSAGE_WARNING" />
          <% when 'I'. %>
          <htmlb:image src = "ICON_MESSAGE_INFORMATION" />
          <% when 'A'. %>
          <htmlb:image src = "ICON_MESSAGE_CRITICAL" />
          <% endcase. %>
        </td>
        <td><font size="2" face="Times">
        <%= wa_message-msg%>
        </font>
        </td >
        </tr>
        <%
      endloop.
        %>
        </table>
    <% refresh itab_message. %>
    <% endif. %>
          </htmlb:gridLayoutCell>
    I tried using
    <phtmlb:focusRect focusElementId="err_tab"/>
    and also:
    <s cript="text/javascript">
    daument.farm.elementid.focus();
    </s cript>
    But failed...pls help me out.
    Thanks,
    Anubhav.

  • Not able to display error message in PR creation.

    HI Experts,
    In PR creation process i am not able to display error message.
    BADI: ME_PROCESS_REQ_CUST
    method : PROCESS_ACCOUNT, PROCESS_ITEM
    I have used Include mm_messages_mac for handling error .
    MESSAGE e112(XXX) WITH XX-XX. this is my error message.
    even tried this also  mmpur_message 'W' 'ZMM_PUR' '001' '' '' '' ''.
    Please provide solution for this.
    Regards,
    Jayant

    Hi,
    In devepoment system im able to display the message but not in quality,code is 100% algined with quality.
    In quality system error message is being executed but not displayed,i mean control is comming out after the error message.
    i am using
    message EXXX(XXX).
    regards,
    Jayant.

  • How To Display Error Message In Self Service Page

    Dear All,
    I am using 11.5.10 Oracle HRMS self Service ,,,
    How can I display error message on the top of the self service page if some action happen ?
    Best Regards

    Time entry rules maybe?

  • How to display error message in Billing Output Type (VF03).

    Hi,
    could anyone suggest how do i display error message via billing (VF03) output type?

    i want to display an error message from my sapscript program.
    *determine discount
    it_zmas-discount = it_zmas-gross_value - zkwert.
    MODIFY it_zmas.
    ELSE.
    MESSAGE ID 'Z0' TYPE 'S' NUMBER '999' WITH 'Please maintain cust pricing grp 34 for ' wa_zmas-matnr.
    p_proc_screen = 'X'.
    ENDIF.
    when user enter billing doc no in vf03, user will click 'issue output type' and select their output type to be printed out.
    if there's an error in the print program, it should promt out an error message and do not allowed user to print preview and print the form out.
    what i had did previously, i prompt the error message and disable the print preview button. i think its not a good solution and i am not sure how to stop the form from not printing it out.
    i was wondering is there any user exit of the output type, vofm (which i had this solutions from my previous question, but unsure how to use it) or any other solutions.
    please help.

  • How to display error message in abap

    How to dispaly error message in report?
    i have to check the range bewteen two days and if it is not in range have to display error message only once.
    next time if i press the execute button report will get executed without showing the warning message.
    i am calculating the days between two dates, i am displaying the error message but if i press the execute button i will not allow me to execute the report.it again shows me the error message.i have to skip this in 2nd time.
    can any one  suggest what to do with this?

    hello suman,
    i am using select-option in my report. And i have to check the difference between two dates in select option input box( low-value and high-value). if it is greater then suppose 10 then i have to display warning message at once and then if click on execute button , the report should get executed without showing any warning messages in report.
    here i am attaching my source code.please take a close look and tell me where should i have to make change.
    SELECT-OPTIONS :s_bedat FOR ekko-bedat.
    AT SELECTION-SCREEN ON s_bedat.
      IF NOT s_bedat IS INITIAL.
        PERFORM bedat_validate.                       " Perform for Purchasing Document Date Validation
      ENDIF.
    FORM bedat_validate .                        " Form for Purchasing Document Date Validation
      DATA  : diffr TYPE i.
      CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
        EXPORTING
          i_datum_bis                   = s_bedat-high
          i_datum_von                   = s_bedat-low
      I_KZ_EXCL_VON                 = '0'
      I_KZ_INCL_BIS                 = '0'
      I_KZ_ULT_BIS                  = ' '
      I_KZ_ULT_VON                  = ' '
      I_STGMETH                     = '0'
      I_SZBMETH                     = '1'
       IMPORTING
         e_tage                        =  diffr
    EXCEPTIONS
      DAYS_METHOD_NOT_DEFINED       = 1
      OTHERS                        = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        IF diffr GT 31.
          MESSAGE s009(zerrormsg) WITH text-000 DISPLAY LIKE 'W'.
          LEAVE TO LIST-PROCESSING.
        ENDIF.
      ENDIF.
    ENDFORM.                    " BEDAT_VALIDATE

  • How to display error message in case of function module ?

    In the report i was using  " message-id "   to display error message....
    how to use in function module ?

    Hi,
    Messages in Function Modules and Methods
    Messages have two different functions in function modules and methods:
    Normal Messages
    If you use messages in function modules and methods without the RAISING addition in the MESSAGE statement, and the caller does not catch the message, the message is handled
    normally according to the context in which it is called within the function module or method.
    Triggering Exceptions with Messages
    If you use messages in function modules and methods with the addition
    ... RAISING <exc>
    the way in which the message is handled depends on whether the calling program handles the exception <exc> or not.
      If the calling program does not handle the exception, the message is displayed and handled according to the context in which it occurs in the function module or method from which it
    was called.
      If the calling program handles the exception, the message is not displayed. Instead, the procedure is interrupted in accordance with the message type, and processing returns to the calling program. The contents of the message are placed in the system fields SY-MSGID, SY-MSGTY, SY-MSGNO, and SY-MSGV1 to SY-MSGV4.
    Catching Message in the Calling Program
    You can catch messages from function modules that are not sent using the RAISING addition in the MESSAGE statement by including the implicit exception ERROR_MESSAGE in the
    EXCEPTIONS list of the CALL FUNCTION statement. The following conditions apply:
      Type S, I, and W messages are ignored (but logged during background processing)
      Type E and A messages trigger the exception ERROR_MESSAGE
      Type X messages trigger the usual runtime error and short dump.
    Catching messages is not currently supported for methods.
    Regards,
    Bhaskar

  • How to display error message in Shopping Cart?

    How to display error message in Shopping Cart and stop the shopping cart for further processing? I try MESSAGE w001(zshop) or MESSAGE e001(zshop). But it is causing run-time error.

    Hi Paul,
    In the DOC_CHECK or DOC_SAVE BADI, you have a global internal table named et_messages. The structure of this table is 'bbp_smessages_badi'. You can append your error message here by inputting the message type, ID and number. The message type is either 'E' for error or 'W' for warning and the number would depend on your message class(ID). You will be able to see the error message on top of the screen, can be a red or yellow highlight depending on your appended message. I don't think creating the error message via the MESSAGE syntax will be successful, maybe this is why you are getting a runtime error.
    Regards,
    Noel

  • Display error message in userexit

    I have a checking which implement in userexit. When the criteria meet, it will block po saving and display error message. I would like to know how to display the error message. Thanks!

    Use like this for first approach else if second one were serve you purpose than you may go with second one also.
    DATA: mid  TYPE sy-msgid VALUE 'SABAPDOCU',
          mtype TYPE sy-msgty VALUE 'I',
          num  TYPE sy-msgno VALUE '014'.
    MESSAGE ID mid TYPE mtype NUMBER num.

Maybe you are looking for

  • Is there a maximum RAM capacity for a Macbook Pro 13 inch Mid 2009?

    My questions is essentially, is there a maximum RAM capacity for a Macbook Pro 13 inch Mid 2009? I'm aware there are two RAM slots in my machine, but in past experiences with other laptops/desktop computers (not Apple) there was a default maximum whi

  • WTK22 JSR172Demo - missing SOAP body

    Hi, I tried the sample JSR172Demo provided with WTK22, with the server running on localhost. Hence the WSDL port is as below: location="http://localhost:8080/serverscript2/serverscript" The service has been verified to be running. The stubs for the c

  • Reader 9.4.1

    My wife is using Reader on her Mac OS X 10.6.5. When ever she tries to save the pdf after inserting text into the forms etc the pdf will not save.  There is no "Save as" option either, also going through print>save as .pdf still will not allow you to

  • Flex 3 How to recording the voice to the local file.can u help sample souce code

    How to recording the voice to the local file.can u help sample souce code

  • Laptop recommendations

    I recently bought a Dell 1720 laptop that had such a poor display that I returned it. Can anyone here recommend a good Windows laptop for running Photoshop and Illustrator. Something for around $1400 would be great. Thanks! Richard