How to display the eror message in the iView

Hi
I want to check the user input in the client side and display an error message in the iView instead of displaying the error message as an alert
it is ok when I tried to do it as an alert
alert('ERROR MESSAGE');
but the problem is how to display the error message as a text in the iView ...
I wrote the below code..
any one can see it and has any sugestion?
Thanks
=============
<%@ taglib uri="tagLib" prefix="hbj" %>
<%
String compid = "";
String message = "";
%>
<hbj:content id="MyContent">
<hbj:page title = "Selection Screen">
<hbj:form id = "myForm">
<br>
<br>
<br>
<center>
<H3>Benefits Statement </H3>
<H4>Selection Screen</H4>
<hbj:gridLayout
id="FSSLayout"
debugMode="False"
width="40%"
cellSpacing="5"
>
<hbj:gridLayoutCell
rowIndex="1"
columnIndex="1"
width="10%"
horizontalAlignment="LEFT"
style="WildStyle"
>
<hbj:label
id="label_inputPernr"
required="TRUE"
text="Personal Number:"
design="LABEL"
labelFor="inputPernr"
/>
</hbj:gridLayoutCell>
<hbj:gridLayoutCell
rowIndex="1"
columnIndex="2"
width="40%"
horizontalAlignment="LEFT"
>
<hbj:inputField id = "inputPernr"
>
<%
compid=MyContent.getParamIdForComponent(inputPernr);
%>
</hbj:inputField>
</hbj:gridLayoutCell>
<hbj:gridLayoutCell
rowIndex="10"
columnIndex="1"
width="40%"
horizontalAlignment="CENTER"
colSpan="2"
>
<hbj:button id = "myButton" text="Submit.." design="EMPHASIZED"
tooltip="Click me to submit this form" onClick="ClickEvent" onClientClick="validRequired()">
</hbj:button>
</hbj:gridLayoutCell>
</hbj:gridLayout>
</center>
<p font="Arial" size=20><%= message%></p>
</hbj:form>
<SCRIPT LANGUAGE="Javascript">
function validRequired()
var myvar = document.getElementById('<%=compid%>').value;
var ivID='<%=componentRequest.getComponentContext().getContextName()%>';
if (myvar = " ")
message = "Enter Employee Number";
ivuRefresh(ivID);
htmlbevent.cancelSubmit=true;
</SCRIPT>
</hbj:page>
</hbj:content>

No problem, here is an example of some html code and javascript that you can adapt to your needs. You can display this standalone to see how it works.
I hope this helps
<html>
     <head>
          <script language="JavaScript">
               function validateForm(){
                    if(document.getElementById("nameField").value == "")
                         document.getElementById("errormessage").innerHTML = "Please enter the Name";
                    else if(document.getElementById("ageField").value == "")
                         document.getElementById("errormessage").innerHTML = "Please enter the Age";
                    else if(document.getElementById("idField").value == "")
                         document.getElementById("errormessage").innerHTML = "Please enter the id";                         
                    else
                         document.getElementById("errormessage").innerHTML = "";
          </script>
     </head>
     <body>
          <table border="0" cellpadding="0" cellspacing="0">
               <tr>
                 <td>Name</td>
                 <td><input type="input" id="nameField" name="nameField"></td>
               </tr>
               <tr>
                 <td>Age</td>
                 <td><input type="input" id="ageField" name="ageField"></td>
               </tr>
               <tr>
                 <td>Id</td>
                 <td><input type="input" id="idField" name="idField"></td>
               </tr>
               <tr><td><font color="red"><span id="errormessage"></span></font></td></tr>
               <tr><td><input type="button" name="validate" onClick="validateForm()" value="Click to validate"/></td></tr>
          </table>
     </body>
</html>

Similar Messages

  • How to display the variable content in message?

    Hi anybody
    please let me know How to display the variable content in message?
    please send few lines of sample code to understand that
    thanks in advance

    Hi,
    Check out the link
    http://help.sap.com/saphelp_nw70/helpdata/en/2c/840b42202cce6ce10000000a155106/content.htm
    REPORT Y9020027 LINE-SIZE 130.    "Release 3.1G, 4.5A                  
    BREAK-POINT.
    MOVE: 'TESTREPORT for    "ASSIGN  FFeld+o(l)  TO  "        '     
            TO SY-TITLE.
          Declaration of variables    **********************
    FIELD-SYMBOLS <FS1>.
    DATA: FFELD8(8)   TYPE F VALUE '1022333'.   "Unusual: Explicit 8 bytes
    *DATA: ZFELD1(2)    TYPE N.            "Here slack bytes are (DW border)
                                         "necessary                      
                  "If you like computing error, please uncomment the above
    DATA: FFELDX(8)   TYPE F VALUE '7777777'.
    DATA: FFELDA(8)   TYPE F VALUE '7333213'.
    DATA: NFELDX(400) TYPE N.
    DATA: OFFX(4) TYPE I VALUE 160.
    DATA: LENX(4) TYPE I VALUE 8.
                  Main Section             *******************
        SKIP.
        WRITE: /5  'Example 1   **** inadmissible ASSIGN ***' COLOR 6.
        WRITE: /10 'Inadmissible ASSIGN: ''ASSIGN FFELD4+1(3) TO <FS1>'' '.
      ASSIGN FFELD4+1(3) TO <FS1>.
        ULINE.
        SKIP 2.
        SKIP.
    ASSIGN FFELD8+8(8) TO <FS1>.     "<-- Assigning of variable  FFELDX  !!
        BREAK-POINT.
        WRITE: / 'ASSIGN command with FFELD8, but FFELDX will be assigned'
                  COLOR 3.
        WRITE: /5 'Example 2'.
        PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
        WRITE: /10 'Content of   FFELDX      :', FFELDX.
        ULINE. SKIP 2.
        SKIP.
    ASSIGN FFELD8+16(8) TO <FS1>.    "<-- Assiging a few FFELDA to <FS1>  
        BREAK-POINT.
        WRITE: / 'ASSIGN with FFELD8, but instead FFELDA is assigned'
                  COLOR 3.
        WRITE: /5 'Example 3'.
        WRITE: /10 'Content of   FFELDA      :', FFELDA.
        PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
        WRITE: /10 'Content of   FFELDA      :', FFELDA.
        ULINE. SKIP 2.
    BREAK-POINT.
       DO 4 TIMES.
         ASSIGN FFELD8+OFFX(LENX) TO <FS1>.     "Zuordnung auf OFFX zu <FS1>
            WRITE: / 'ASSIGN command with FFELD8, es wird NFELDX zugeordnet'
                      COLOR 5.
             WRITE: /5 'Example 4', 'DO-Schleife Nr.:', SY-INDEX.
             PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
             WRITE: /10 'Content of NFELDX145(40)  :', NFELDX145(40).
             ULINE. SKIP 2.
             ADD 8 TO OFFX.
       ENDDO.
                   Subroutines             *******************
               Display of data fields and field symbols                  *
    FORM DISPLAY-FFELD USING FFELD FNAME.
    WRITE: /10 'Content of', FNAME, ':', FFELD.
    PERFORM FELDEIGENSCHAFTEN USING FFELD.
    WRITE: /10 'Content of <FS1> :', <FS1>.
    PERFORM FELDEIGENSCHAFTEN USING <FS1>.
    ADD   111    TO <FS1>.               "<-- Das Feldsybmol wird verwendet
    WRITE: /10 'ADD 111 TO <FS1>'.
    ULINE.
    WRITE: /10 'Content of', FNAME, 35 ':', FFELD.
    WRITE: /10 'Content of <FS1>',  35 ':', <FS1>.
    ENDFORM.
       Determination of field properties (only for information)          *
    FORM FELDEIGENSCHAFTEN USING ALLG.
    DATA: FLAENGE(2) TYPE N.
    DATA: FTYP(1) TYPE C.
    DATA: FOUT(2) TYPE N.
    DATA: FDEZ(2) TYPE N.
      ULINE.
      DESCRIBE FIELD ALLG LENGTH FLAENGE.
      WRITE: /10 'Field length  :', FLAENGE.
      DESCRIBE FIELD ALLG TYPE FTYP.
      WRITE: /10 'Field type    :', FTYP.
      DESCRIBE FIELD ALLG OUTPUT-LENGTH FOUT.
      WRITE: /10 'Output length :', FOUT.
      DESCRIBE FIELD ALLG DECIMALS FDEZ.
      WRITE: /10 'Decimals      :', FDEZ.
      SKIP 1.
    ENDFORM.
    END OF PROGRAM *************************************

  • How to display the message along with a value using BBP_CHECK_BADI

    Hi Gurus,
    I need to display a message dynamically when the user create's a shopping cart. I am using Check_badi for this. i.e., I need to display the buyer number and amount left for him dynamically. I am storing both of them in variables and don't know how to display the messages laong with some message " the amount left for <XXXXXX> is <$$$$$$$$>". Can you help me out.
    Thanks,
    Neelima

    Hi,
    you can use the function module 'BBP_PD_MSG_ADD'. This is the function module normally used for the displaying the error messages in SRM.
    See wether you can use already available error messages , use the transaction SE91 , and the message class being BBP_PD

  • How to display the Message Pool Messages in CE 7.2

    Hi Experts,
    Please let me know how to display the Message Pool Messages in CE 7.2.
    I have tried with reportContextAttributeMessage, but it is deprecated in CE 7.2.
    Please do the needful.Its Urgent.
    Thanks & Regards,
    SatheshKumar R

    Hi Sathesh,
    Do the following steps:
    1.) After creating a component, under it you will see Message Pools. Double click and open it.
    2).Click "Add Message" and add a new message. (Give a message key, type of message (either warning, error etc ) and message text).
    3). Save the metadata.
    4). Raise this message where all you want by using following code(For example, on click of a button) :
          IWDMessageManager msgnr = wdThis.wdGetAPI().getComponent().getMessageManager();
          msgnr.reportMessage(IMessage<component name>.<message>,null,true);
    For example, I have a component name TestAppComp and under message pool I have message called message1, then use lik this:
            IWDMessageManager msgnr = wdThis.wdGetAPI().getComponent().getMessageManager();
            msgnr.reportMessage(IMessageTestAppComp.MESSAGE1,null,true);
    Reply me if you any doubt.
    Regards,
    Jithin

  • How to display the err msg in statusbar

    Hi friends,
        How to display the error msg (red color) in statusbar and other msg is green color in same report of the status bar .
    Plz help any one.
    Thanks in advance.

    Hi YUMKUMAR ,
    You can use the below code. 
    Create a message class : ZMSSG or with any other name and use the below code.
    IF SY-SUBRC  NE 0 .
        MESSAGE : E000(ZMSSG) WITH 'Data not available for this entry'.
      ENDIF .
    or
    IF SY-SUBRC NE 0 .
        MESSAGE : S000(ZMSSG) WITH 'Data not available for this entry'.
      ENDIF .
    Regards,
    Kittu
    Edited by: Kittu on Feb 1, 2010 7:51 AM

  • In sap scripts how to display the driver program

    Hi,
        I Want to know the sap scripts How to display the output to driver program

    Hi,
    Go to NACE Transaction.
    Select application for ex: if sales V1.
    Click on output types.
    Select the output type for ex : BA00
    Double click on Processing routines.
    There you can find the Driver Program name and Script/smart form name.
    Reward if useful.
    Thanks,
    Raju

  • How to display the sort value in the selection screen in the report title

    Dear All,
    How to display the sort value in the selection screen in the report title? I have selected a value in the selection screen for sorting , but i need that values by which i have sorted with in the report title. Can you please throw some light on this!!
    Good day,
    Thanks and regards
    Arun S

    Hi Arun,
    Try this.
    1, Set one dynamic parameter,
    2, Drag and drop that parameter into  your report title.
    3, Pass the value(sort value) dynamically from your application,
    4, Cheers..
    Other wise Try with Dataset, create a dataset and fill thev alue into that.. Then  set the data source from CR designer. and darg and drop that data column into the report.
    Hope this will work,
    Regards,
    Salah
    Edited by: salahudheen muhammed on Mar 25, 2009 11:13 AM

  • How to display the header data on different position in alv report

    hi all,
    how to display the header data on different position in alv report.
    for example ,
    customer                                                   name
      xxxx                                                         xxxx
                     vendor        name     street 
                      xxxx         xxxx      xxxxx
    pls   help me .

    hi
    as per my understanding you need to trnasfer header internal table data  to pdf..
    please check the following links for internal table to pdf..
    Convertion of Internal table data to PDF
    This link is related to ur issue
    Re: how to insert the calling of the FM: OTF to PDF
    Thanks

  • HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS

    HI,
       HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS?

    in ur script main window
    /: IF &TTXSY-PAGE& = 15.              
    ur text or standard text           
    /: ENDIF.                             
    use this.
    hope it helps if any issues revert back

  • How to display the Buyer's signature in PO BI Publisher Report

    Hi,
    How to display the Buyer's signature dynamically in XMLP Purchase Order Report.
    Please anybody help on this.Your help greatly appriciated.

    Hi All once again
    I was able to display the signature on XMLP AP Check Print Report by went through the follwoing Tim's blog http://blogs.oracle.com/xmlpublisher/2006/04/13#a12
    But in Purchase Order report requirement is different. We need to display the Buyer's signature on XMLP PO Report. So, where is the best place to store the buyers signatures.(For example if we have 10 buyers with 10 signatures respectively then after approving the PO, we should display that particular buyer's signature in PO XML Publisher report).We observed that in byuers & User's form there is no attachment feature enabled.
    This is an urgent requiremnt. Please help/guide/suggest to resolve this issue.
    Thanks in advance.

  • How to display the results in order by based on search value

    Hi All,
    how to display the results in the below order.
    CREATE TABLE TEST( SONGID  NUMBER, TITLE   VARCHAR2(200))
    INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
    INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
    INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');     
    INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
    INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
    SELECT *FROM  TEST WHERE INSTR (TITLE, 'MADONNA') > 0
    output:
    SONGID     TITLE
    10     AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    11     CICCONE, MADONNA (CA)
    12     DALLIN, MADONNA LOUISE/STOCK
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    16     MIRWAIS AHMADZAI, MADONNA
    17     MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
    18     MADONNA (CA),CICCONE
    Expected output :
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    18     MADONNA (CA),CICCONE
    ...if user searches with 'MADONNA' , I have to display the results like title starts with 'MADONNA' first then rest of the records.
    Please let me know is it possible to display the results in that order.
    Regards,
    Rajasekhar

    This may be a bit more accurate:
    SQL> SELECT *
      2  FROM   TEST
      3  WHERE  INSTR (TITLE, 'MADONNA') > 0
      4  ORDER  BY INSTR (TITLE, 'MADONNA')
      5           ,TITLE
      6  ;
                  SONGID TITLE
                      13 MADONNA
                      14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
                      15 MADONNA (CA)
                      18 MADONNA (CA),CICCONE
                      12 DALLIN, MADONNA LOUISE/STOCK
                      11 CICCONE, MADONNA (CA)
                      17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
                      16 MIRWAIS AHMADZAI, MADONNA
                      10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)

  • How to display the fields in ALV Output without using Field catalog?

    How to display the fields in ALV Output without using Field catalog?
    Could you pls tell me the coding?
    Akshitha.

    Hi,
    u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
    data: itab type table of mara.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = sy-repid
    i_structure_name = itab
    CHANGING
    ct_fieldcat = lt_fieldcat[]
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    *Pass that field catalog into the fillowing FM
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_grid_title            = 'REPORTING'
                is_layout              = gt_layout
                it_fieldcat             = lt_fieldcat[]
           tables
                t_outtab                = itab.

  • How to display the proxy settings for a specific group of servers in an OU ?

    Hi,
    Can anyone here please assist me in how to display the value of Proxy server settings from the computers in a specific OU member ?
    $Computers = Get-ADComputer -Filter * -SearchBase "OU=Terminal Servers,OU=Servers,DC=domain,DC=com" | Where-Object { Test-Connection $_.Name -Count 1 -Quiet }
    ForEach ($Computer in $Computers) {
    | Export-csv "C:\Proxy-Setting-Results.csv" -Append -NoTypeInformation -UseCulture
    I've done similar script for some other task but not sure how to do this for Proxy setting.
    Thanks.
    /* Server Support Specialist */

    Proxy settings are not set in Active Directory
    The below code works for 2003 servers and Win XP
    $colItems = get-wmiobject -class "Win32_Proxy" -namespace "root\CIMV2" `
    -computername $env:computername
    foreach ($objItem in $colItems) {
    write-host "Caption: " $objItem.Caption
    write-host "Description: " $objItem.Description
    write-host "Proxy Port Number: " $objItem.ProxyPortNumber
    write-host "Proxy Server: " $objItem.ProxyServer
    write-host "Server Name: " $objItem.ServerName
    write-host "Setting ID: " $objItem.SettingID
    write-host
    You can try checking the registry values- Works in 2008 + and Windows 7
    Get-Item 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings'
    or use netsh
    netsh winhttp show proxy -r <remotemachinename>
    Regards Chen V [MCTS SharePoint 2010]

  • How to display the text as a Bold in the Text Element of a Smart Form

    Hi,
    I created one Smart Form.
    In that i created the Text element.
    I provide some data also in that.
    It is coming as a MS WORD.
    I executed my smart form.
    Customer Number:  &WA_KNA1-KUNNR&
    it display the data of the particular customer.
    But i need to display the Customer Number as BOLD or else Increase the Size.
    For this also I created one SMARTSTYLE.
    In that I created the Paragraph and Character Formats also.
    Now i assignee that SMARTSTYLE in the Output Option Tab of the Text Element also.
    But i unable to get the CUSTOMER NUMBER in Bold.
    In MS WORD we have BOLD button.
    I selected the Text and Press the BOLD button. At that time it is Highlighted.
    Whenever i press the SAVE Button.
    Then it is not saved with BOLD.
    It is coming in Normal Format.
    In the ECC 6.0.  I am unable to get the Text as a BOLD.
    This text Element is like a MS WORD.
    Can you please tell me how to display the Data with BOLD. please tell me. I am unable to get that one.
    Thank You.
    Regards,
    B. Krishna.

    Hi,
    Check where u have given BOLD. In character Format or in Paragraph format.
    In SMART FORM,
    1. Change to OLD EDITOR if u are confused with the new one.
            (This can be done by clicking the button left to new editor ).
    2. If it is PARAGRAPH FORMAT,
               Give the name of paragraph format in the editor.
                P1         &WA_KNA1-KUNNR&
        If it is CHARACTER FORMAT,
                             <C1> &WA_KNA1-KUNNR&
    Thanks,
    Nithya.

  • How to display the time 00:00:00 as blank?

    Dear Friends,
    I have created a new field GDF_9000_CREATED_AT in the normal screen (dynpro), the format is TIMS, however, when there is no value for it, is always display like "00:00:00" on the screen.
    So how to display the time 00:00:00 as blank in the normal screen (dynpro) when there is no value for it?
    Thanks a lot!!

    In screen PBO module:
            LOOP AT SCREEN.
              if screen-name EQ 'my_time' AND my_time EQ time_zero.
                screen-invisible = 'X'.
                screen-active = 0.
                MODIFY SCREEN.
              endif.
            ENDLOOP.
    I don't try this, but i think is true...
    Edited by: Marco Modenese on May 7, 2009 10:36 AM
    Edited by: Marco Modenese on May 7, 2009 10:36 AM

Maybe you are looking for

  • Printer is asking for an user acces code instead of windows login and password?

    I have been seeing the HP printers asking(LaserJet M4555 MFP, LaserJet 500 color MFP M575 etc) for user access code instead of windows login and password. One thing i have noticed  is that when this happens there is a slight change in the EWS page co

  • MASS_ vendor changes

    All, I'm trying to change the vendors master via MASS transaction. I'm doing only purchasing block and CC block.  Some vendors have some errors. I got  red light with message number with no description of message.  How do I veiw the error? Some vednd

  • User equivalence check failed for user "oragrid" in HP-UX

    Dear Friends, while cluster verification utility i gotthe below error. $ ./runcluvfy.sh stage -pre crsinst -n aeadsverp11-adp.adp.ae,aeadsverp12-adp.adp.ae -fixup -verbose Performing pre-checks for cluster services setup Checking node reachability...

  • Employee Directory

    Dear Friends, Employee Directory is not Displaying the photo of the employee. I am working on 12.1 Please let me know wat would be the reason and watz the solution for it. Regards, Jithin

  • How to check for Auto Allocated Serial Numbers

    Hi I have chosen ALLOCATE SERIAL NUMBERS = YES in Organization Parameters Form. I have set the Item SERIAL GENERATION = AT SALES ORDER ISSUE at Item Level. Done with the creation of Sales Orders Done with Releasing a SO(Auto Allocate = NO and Auto PI