Displaying error msg

hi,
how i display error msg on page by using af:message from beans, based on some processing? i tried , but error msg is not coming on af:message?
i m using jdv10g. i checked by system.out.println(errormsg), & it displaying in console, but not on af:message.
thanks

hi thanks,
it is showing the message on af:messages on top of page. i want to display it on af:message fm bean.
i dragged a af:message fm components palette. i associated its value attribute to errormsg property in bean like this-
<af:message id="m1" message="#{xxbean.errormsg}"
inlineStyle="color:rgb(255,0,0);"/>
//in bean
private String errormsg = "";
based on some processing i filled the 'errormsg' property with desirable error string, by this.errormsg="error....." .
& getter method is there for returing the value, on page.
GlobalOnly= true for af:messages.
i m using 10gdev
Edited by: user78995 on Apr 7, 2010 2:44 AM

Similar Messages

  • FacesContext can't display error msg !

    Hi guys,
    I got this problem. For this function:
         public User saveUser(User user) throws DBException {
              try {
                   User newUser = this.userDao.saveUser(user);
                   return newUser;
              } catch (DataIntegrityViolationException di) {
                   String msg = "duplicate user id";
                   this.logger.error(msg, de);
                   throw new DuplicateUserIdException(msg);
    =======================================
    then the below function is to execute when user click the submit button
    public String submitAction() {.....
    catch (DuplicateUserIdException de) {
    String msg = "Username already exists";
    this.logger.info(msg);
    FacesContext.getCurrentInstance().addMessage(null, new FacesMessage( FacesMessage.SEVERITY_INFO, msg, msg));
    return QueryResults.RETRY;
    ========================================
    public class DuplicateUserIdException extends DBException {
         private String username;
         public DuplicateUserIdException(String newUsername) {     
              super("Username " + newUsername + " already exist");
              this.username = newUsername;
         public String getUsername() {
              return this.username;
    ====================================
    So when I click on the submit button after entering a duplicate username, it will just go back to the same page and no error message display. Username is a primary key and email address is set to UNIQUE in MySQL DB. I read the log file and indeed all the error messages can be catched. The registration.jsp page is like:
    <h:inputText value="#{userBean.username}" id="username" required="true">
    <f:validateLength maximum="20" minimum="5"/>
    </h:inputText>
    <h:message for="username"/>
    but I got my login page also the same h:inputText as above.
    I am using JSF + Spring + Hibernate.
    I hv tried to fix it a few time but failed !
    Appreciate any help here.

    K> then the below function is to execute when user click
    K> the submit button
    K>
    K> public String submitAction() {.....
    K>
    K> catch (DuplicateUserIdException de) {
    K> String msg = "Username already exists";
    K> this.logger.info(msg);
    K> FacesContext.getCurrentInstance().addMessage(null,
    K> l, new FacesMessage( FacesMessage.SEVERITY_INFO,
    K> msg, msg));
    K> return QueryResults.RETRY;
    K>           }
    K> }
    K> So when I click on the submit button after entering a
    K> duplicate username, it will just go back to the same
    K> page and no error message display. Username is a
    K> primary key and email address is set to UNIQUE in
    K> MySQL DB. I read the log file and indeed all the
    K> error messages can be catched. The registration.jsp
    K> page is like:
    K>
    K> <h:inputText value="#{userBean.username}"
    K> id="username" required="true">
    K> <f:validateLength maximum="20" minimum="5"/>
    K> </h:inputText>
    K> <h:message for="username"/>
    K>
    K> but I got my login page also the same h:inputText as
    K> above.
    K>
    K> I am using JSF + Spring + Hibernate.
    K>
    K> I hv tried to fix it a few time but failed !
    K> Appreciate any help here.
    Ok, we have to keep in mind the request processing lifecycle here. Your
    submitAction() method is called after conversion and validation have
    already occurred. Therefore, you can never queue an error from an
    action handler. Here's why.
    When your submitAction() is called, you queue a message into the faces
    context. Whatever you return from submitAction(), it's ultimately going
    to cause a requestDispatcher.forward() or
    httpServletRespones.sendRedirect(). Both of these cause a new
    FacesContext instance to be created, obliterating your carefully queued
    message.
    The best practice I've seen used is to handle the validation as close to
    the component in which the validation error occured as possible. I
    recommend creating a custom validator method binding, that does the
    trick. This is really easy to do. Just add a method to your bean:
    public void validate(FacesContext context,
    UIComponent component,
    Object value) throws ValidatorException {
    // queue the message here, make sure to call component.setValid(false)
    Then, in your inputText, you say:
    <h:inputText value="#{userBean.username}" validator="#{userBean.validate}
    id="username" required="true">
    <f:validateLength maximum="20" minimum="5"/>
    </h:inputText>
    And you're done.
    Ed (JSR-252 Spec co-lead)

  • Problm in displaying error msg

    hi
    i hav written error message for production sheduler...
    if the input is wrong i want the errror to be displayed as invalid input...
    if they dnt enter any data then no need to display any error msg i hav written this below code...
    here im getting error if i dont enter account group and if i enter correct group also it is giving error msg...
    wt is wrong in my code?
    AT SELECTION-SCREEN on s_fevor.
      s_fevor-sign = 'I'.
      s_fevor-option = 'EQ'.
      s_fevor-low = s_fevor.
      s_fevor-high = s_fevor.
      APPEND s_fevor.
      CLEAR s_fevor.
      IF not s_fevor-low in s_fevor.
        SELECT fevor
          from afko
          INTO TABLE t_fevor
          WHERE fevor in s_fevor.
          IF sy-subrc ne 0.
              MESSAGE e001.
          ENDIF.
      ENDIF.

    Hello
    Please modify your code as below .WHICH WIll work for all scenarios i mean even if you give Option as EXCLUSIVE also .....
    AT SELECTION-SCREEN on s_fevor.
       DATA : l_t_fevor TYPE TABLE OF afko-fevor WITH HEADER LINE.
      SELECT fevor INTO TABLE l_t_fevor FROM afko.
      LOOP AT s_fevor.
        IF NOT s_fevor-low IS INITIAL.
          READ TABLE l_t_fevor WITH KEY = s_fevor-low.
          IF sy-subrc <> 0.
            SET CURSOR FIELD 'S_FEVOR-LOW'.
            MESSAGE e<>      ENDIF.
        ENDIF.
        IF NOT s_FEVOR-high IS INITIAL.
          READ TABLE l_t_fevor WITH KEY = s_fevor-high.
          IF sy-subrc <> 0.
            SET CURSOR FIELD 'S_FEVOR-HIGH'.
            MESSAGE e<>      ENDIF.
        ENDIF.
      ENDLOOP.
    Regards

  • HT1212 My  fully charged iPhone screen is black and not responding. what can I do to get it to work again? I have never syncd on iTunes. I connected to my laptop and iTunes app displays error msg saying phone is locked and unlock phone to connect.

    My fully charged iPhone has a black screen and is not responding but has Siri and sound.  I connected to laptop and iTunes gives error msg indicating phone is locked and I to enter passcode. but I can't enter the passcode because the screen is black. I have never syncd with iTunes. What can I do to get my  phone back?

    First thing to try is to reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • How to make a field editable again after displaying error msg (validation)

    Dear All,
    In dialog programming, I have written a validation on a text field that it should not be left blank by the user, but after displaying the message the field becomes gray (non-editable). How can I make it editable once again after displaying the error message.
    My code is as following:
    ***INCLUDE MZFBPS1_SAVE_DATAF01 .
    *&      Form  save_data
          text
    -->  p1        text
    <--  p2        text
    FORM save_data .
    ****************Check For Empty Fields Start
    if ZFBPS_GATE_IN-truck_code is INITIAL
    or ZFBPS_GATE_IN-truck_no is INITIAL
    or ZFBPS_GATE_IN-transporter_code is INITIAL.
    MESSAGE e020(zmatlist).
    endif.
    ****************Check For Empty Fields Start
    Regards,
    Alok.

    hi,
    u can do it in chanin end chain.
    For example if there are 10 fields in the screen and for 5 fields whenever the user enters wrong values u like to give some error message. You can declare that fields in the chain enchain so that only those fields will be input enabled and all other fields will disabled.
    CHAIN.
    FIELD chk_connobj.
    FIELD chk_inst.
    FIELD chk_devloc.
    FIELD ehaud-haus.
    FIELD eanl-anlage.
    MODULE modify_screenfields.
    ENDCHAIN.
    *& Module modify_screenfields INPUT
    * text
    MODULE modify_screenfields INPUT.
    CLEAR okcode.
    okcode = sy-ucomm.
    CASE okcode.
    WHEN 'ENTER' OR 'EXECUTE'.
    IF chk_connobj IS INITIAL AND chk_inst EQ c_x AND
    chk_devloc EQ c_x.      -----------> ur condition
    IF ehaud-haus IS INITIAL.
    SET CURSOR FIELD 'EHAUD-HAUS'.
    MESSAGE e000(zo_spa) WITH text-017. " message obj
    ELSE
    loop at screen.
    if screen-name = 'FIELD_NAME'.
    field-name-input = 1. -----------> chnges to non-edit mod
    modify screen.
    endloop.
    ENDIF.
    ENDIF.
    ENDMODULE.
    Rgds
    Anver
    if hlped pls mark points

  • Code to display error msg if duplicate entry

    I have an upload program to upload csv file to itab, and i need a sample code for the employee id to give me an error message if a duplicate employee id is found during execution.

    After Upload you can delete the Duplicates comparing the employee Id.
    It Will be Possible only when you use OLE and read the file records line by Line. I am not sure of the error Handling with OLE control. It may lead to some performance issues..

  • Upgrade from RH8 to RH9 displays error msg for images/hyperlinks

    We imported a RH8 project into RH9 on another computer. For the most part, it went smoothly; however, for some images and hyperlinks, we get the message: The image file "___.jpg" used in "______.htm" is outside of the current project and will not be shown in Project Manager.
    Additionally, there are approximately 20 broken links displayed in the Broken Links tab.
    Your suggestions would be appreciated as we have multple huge projects we need to upgrade. Thanks

    Hi there
    For each of the messages about the image being outside the project, you will need to carefully note the image file name, the topic and the location it is reporting. Then you will need to edit the topic and click on the image icon and browse to the image to choose it. That action should correct the link and copy the image into your project.
    Broken links will have to be resolved on a "link by link" basis. I was assisting someone else in a different thread and it may be of use to you. Click the link below to view that thread.
    Click here to view
    Cheers... Rick

  • Error msg "Maximum number of items in FI reached" displayed while backflush

    Dear Gurus,
    The scenerio at our client's site is that of MTO using strategy group 50 and variant configuration.
    The production process goes through a sequence of three operations. Details are as under:
    1. Operation 10: Control key (PP01), all components (say some 1500) are allocated to this operation.
    2. Operation 20: Control Key (PP01), no components allocated to this operation.
    3. Operation 30: Control key ( PP03), no components allocated, AutoGR maintained in control key.
    Now the issue is while doing confirmation using T code CO1F, individually for all the operations, backflushing of some odd 900 components is not taking place. The components get stock in COGI. Each time these are to be cleared from COGI, although there is sufficient stock of these components for these components.
    The error msg that is being displayed in COGI is "Maximum number of items in FI reached".
    Pls suggest how to take care of it.
    Regards,
    Pradeep Santara

    Hi,
    The error is due to the maximum line items have been reached in FI.
    actually you cann't post more than 999 items in one acctg doc at one time.
    regards

  • Reg: Error msg display

    Hi
    I got a requirement that i have to display one error msg when some condition is fails for that i found one exit and i write the code. now i have to do ut the cursor position where that error is coming
    Please help me out
    Thanks in Advance.
    Regards
    Rao

    Hi
    use ,
    SET CURSOR FIELD itab-variable .
    regards,
    Ramya

  • After installing CF10, I get this error msg,"This page can't be displayed"

    After installing CF10, I get this error msg when I try to access the Administrator page,"This page can't be displayed"
    I'm running Window Server 2003, 64 bit version with IIS 6.0.
    Before I installed CF10, I uninstalled CF8.

    @Len said, “ BTW, there is no 64 Bit entry under Application Pools.”.
    I suspect @Anit was assuming you were using IIS 7, in which case you could check the IIS app pool (advanced settings, for the app pool used by the site you are browsing) to see if it was set to “enable 32-bit applications: false”, assuming CF is configured as 64-bit, or if CF is configured 32-bit, then you would want that to be set to “enable 32 bit applications: true”.
    It seems you’re using IIS 6, and there is no GUI means in the IIS 6 control panel to change the bitness of the app pool. There are various means discussing how to do that on the web, as well as a blog entry from Ben Forta, from back when people were deploying CF 7 (which was 32-bit only) 64-bit Windows and IIS:
    http://www.forta.com/blog/index.cfm/2006/2/6/connecting-coldfusion-mx-7-to-64bit-iis-6
    For those on IIS 7, here is at least one page showing how to configure it in IIS 7 (has no reference to CF, but I had a hard time finding any existing blog entry that showed screenshots of configuring this feature):
    https://help.webcontrolcenter.com/KB/a1114/how-to-enable-32-bit-application-pool-iis-7-ded icatedvps.aspx
    But back to your error, @Len, if setting the bitness of the IIS app pool is not the solution, I’ll note that there can be many other reasons that you get that error. What are you seeing in the Windows Event log (using “event viewer”), or the IIS logs (especially httperr.log), or the CF logs (\coldfusion10\cfusion\logs)?
    /charlie

  • Error converting image     get error msg when trying to display thumbnail

    Hi there
    Me again
    I am having some problems displaying thumbnails
    I keep getting the error
    Error converting image (create thumbnail). The "...........public_html/productimages/thumbnails/" folder has no write permissions.
    So I go to my host and change write permissions on the files to 755 and try again and get the same msg
    Then I contacted my host and changed the permissions to 777 and I went to the includes config file and changed the permissions to 777 too and still does not work
    So I go to my cpanel and check all the files are set to 777 I make a new test page with a dynamic table and show thumbnail behavior and get the same error msgs
    So I close DW restart and try again and get the same msg.......
    So then I check the file permissions in the DW split screen window when connected to server..... I right click on some files on my server.... namely the 'thumbnails' file and check its permission and it is only set to 755 but in my host it is set to 777
    So I try to change ppermissions from DW and get the
    "setting access properties failed for: ' error
    So what is the correct permissiion..... 755 or 777?
    I have read two other posts on this forum and I still cant get to work
    Does anyone have any ideas
    I have used up all my options and most of my patience
    I hope I can get this working asap....
    Have a nice day

    Try going through the steps in this document:
    http://support.apple.com/kb/TS1539
    CG

  • Display Error Message in ME21N

    Hi,
    As per my requirement, I need to display an error message while creating a PO based on certain conditions. I tried the Exit: EXIT_SAPMM06E_012 using which i can stop the creation of PO but it gives a pop up box saying HOLD or EDIT. Inside edit i can find my custom error message. The requirement is to print this error message at the task bar and not to allow the HOLD option to come. The creation of the PO should stop immediately after displaying an error msg at the task bar and before the Hold option.
    Please suggest which exit i need to use...

    Hi,
    You want to restrict the standard msg and instead of that u want to show your message,  i feel you can't erase the stnd message.
    However, try to use  where-used- list for that message using se93 mess no.
    Best thing, is to find the implicit enhancement and insert the message before your HOLD  mesages get populated.
    Try this keeping break point at ' MM06EFDCM' debug to find the excat place.
    Hope this will help you as i have done same for the similar type of requirment.

  • 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[].

  • BDC  display Error while converting the Currency ..

    Hi,
    Using BDC i have to cal Transaction Vk15.
    In this we have a field KONP-kbetr, which is a currency feild, with 2 decimals.
    I have to converted the Currency to 'EUR' and has moved it in a variable "gv_char13".
    ______________+declaration part+_____________________
    Data :  gv_eurconv_vk(14)      TYPE rkb1k-exchr,
               gv_eurconv_vk       TYPE konp-kbetr,
                 gv_char13(14) TYPE c.
    _____________+Currency Conversion+________________
      CALL FUNCTION 'RKC_SINGLE_EXCHANGE_RATE_GET'
        EXPORTING
          datum               = gv_sydatum
          kurst               = 'P'
          ncurr               = 'EUR'
          vcurr               = 'CZK'
    IMPORTING
       exchr               = gv_exchr_vk
       EXCEPTIONS
         no_rate_found       = 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.
      ENDIF.
      WRITE gv_exchr_vk  NO-GROUPING CURRENCY 'EUR'.
      MOVE gv_exchr_vk TO gv_eurconv_vk.
      CLEAR gv_char13.
      WRITE gv_eurconv_vk TO gv_char13.
    _________+Passing Value IN BDC VK15+__________
        wa_bdcdata_vk-fnam     = 'KONP-KBETR(01)'.
        wa_bdcdata_vk-fval     =  gv_char13.                     
        SHIFT  wa_bdcdata_vk-fval LEFT DELETING LEADING space.
        APPEND wa_bdcdata_vk TO gt_bdcdata_vk.
        CLEAR wa_bdcdata_vk.
    ----------+Calling the Transaction VK15+____
      CALL TRANSACTION 'VK15' USING gt_bdcdata_vk  MODE 'E' MESSAGES INTO gt_bdcmsg_vk.
    **--Display the error message if the call transaction fails--**
        IF sy-subrc EQ 0.
          IF NOT gt_bdcmsg_vk IS INITIAL.
            READ TABLE gt_bdcmsg_vk INTO wa_bdcmsg_vk INDEX sy-index.
            CALL FUNCTION 'FORMAT_MESSAGE'
              EXPORTING
                id     = wa_bdcmsg_vk-msgid
                lang   = 'EN'
                no     = wa_bdcmsg_vk-msgnr
                v1     = wa_bdcmsg_vk-msgv1
                v2     = wa_bdcmsg_vk-msgv2
                v3     = wa_bdcmsg_vk-msgv3
                v4     = wa_bdcmsg_vk-msgv4
              IMPORTING
                msg    = gv_text_vk
              EXCEPTIONS
                OTHERS = 0.
            IF sy-subrc EQ 0.
              APPEND  gv_text_vk TO gt_mess_vk.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
    **--Display the error message on the screen--**
      IF NOT gt_mess_vk[] IS INITIAL.
        LOOP AT gt_mess_vk INTO wa_mess_vk.
          WRITE:/ wa_mess_vk.
          CLEAR wa_mess_vk.
        ENDLOOP.
      ENDIF.
    In the dispaly tabkle for error message "gt_bdcmsg_vk" we get the sucess message and in table "gt_mess_vk" we get the message as the "Condition records Saved."
    The problem is when this report is executed it displayes the converted currency Value and in next line it dispalyes the ""Condition records Saved".
    But idealy the converted currency value should not be dispalyed.
    Actual Sample display:(shuld be this ):
    xyz.. message
    Condition Record Saved.
    Sample display (Error Dispaly ):
    xyz.. message
      3,14E-02 -
    (This shuold not be dispalyed)
    Condition Record Saved.

    Use modified code...
    *______________declaration part_____________________
    Data :  gv_eurconv_vk(14)      TYPE rkb1k-exchr,
              gv_eurconv_vk       TYPE konp-kbetr,
                 gv_eurconv_vk TYPE p DECIMALS 2,
                 gv_char13(14) TYPE c.
    *_____________Currency Conversion________________
      CALL FUNCTION 'RKC_SINGLE_EXCHANGE_RATE_GET'
        EXPORTING
          datum               = gv_sydatum
          kurst               = 'P'
          ncurr               = 'EUR'
          vcurr               = 'CZK'
    IMPORTING
       exchr               = gv_exchr_vk
       EXCEPTIONS
         no_rate_found       = 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.
      ENDIF.
    WRITE gv_exchr_vk  NO-GROUPING CURRENCY 'EUR'.
    MOVE gv_exchr_vk TO gv_eurconv_vk.
      gv_eurconv_vk = gv_exchr_vk.    
      CLEAR gv_char13.
      WRITE gv_eurconv_vk TO gv_char13.
    *_________Passing Value IN BDC VK15__________
        wa_bdcdata_vk-fnam     = 'KONP-KBETR(01)'.
        wa_bdcdata_vk-fval     =  gv_char13.                     
        SHIFT  wa_bdcdata_vk-fval LEFT DELETING LEADING space.
        APPEND wa_bdcdata_vk TO gt_bdcdata_vk.
        CLEAR wa_bdcdata_vk.
    Calling the Transaction VK15____
      CALL TRANSACTION 'VK15' USING gt_bdcdata_vk  MODE 'E' MESSAGES INTO gt_bdcmsg_vk.
    *Display the error message if the call transaction fails*
        IF sy-subrc EQ 0.
          IF NOT gt_bdcmsg_vk IS INITIAL.
            READ TABLE gt_bdcmsg_vk INTO wa_bdcmsg_vk INDEX sy-index.
            CALL FUNCTION 'FORMAT_MESSAGE'
              EXPORTING
                id     = wa_bdcmsg_vk-msgid
                lang   = 'EN'
                no     = wa_bdcmsg_vk-msgnr
                v1     = wa_bdcmsg_vk-msgv1
                v2     = wa_bdcmsg_vk-msgv2
                v3     = wa_bdcmsg_vk-msgv3
                v4     = wa_bdcmsg_vk-msgv4
              IMPORTING
                msg    = gv_text_vk
              EXCEPTIONS
                OTHERS = 0.
            IF sy-subrc EQ 0.
              APPEND  gv_text_vk TO gt_mess_vk.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
    *Display the error message on the screen*
      IF NOT gt_mess_vk[] IS INITIAL.
        LOOP AT gt_mess_vk INTO wa_mess_vk.
          WRITE:/ wa_mess_vk.
          CLEAR wa_mess_vk.
        ENDLOOP.
      ENDIF.

  • 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.

Maybe you are looking for