Highlight input field at runtime

Hello,
I have a requirement of highlighting a inputfield.
This inpufield is binded with an attribute DATE. I want to create an error message if the date is in the past and at the same time the inpufield for DATE attribute should be highlighted( = red border).
Please suggest.
Regards,
Yogesh

Dear Yogesh,
You need to declare a field-symbol of type csequence.
FIELD-SYMBOLS: <LV_MSG> TYPE CSEQUENCE.
And the implementation methodology for this method is:
ASSIGN 'Entered date is invalid' TO <LV_MSG>.
     *       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.
      CALL METHOD lo_message_manager->report_attribute_error_message
        EXPORTING
          message_text   = <LV_MSG>
          element        = LO_EL_<ELEMENT> --> THIS IS YOUR CONTEXT ELEMENT.
          attribute_name = 'DATE'.
Regards,
-Syed.
Edited by: wahid hussain syed on Feb 10, 2010 9:08 AM

Similar Messages

  • Highlighting input field and  table cell column in red colour

    Hi,
           I have 4 input fields and a table in my screen. All the input fields are read only.
        I have a functionality where I have to highlight a input field with the red colour. In the sense, I have to put a thin Red border over the input field without thowing any errors or messages.
           Also, i have to highlight a particular cell in the table. i.e, i have to put Red colour border over the cell of the table for some rows only. Right now i have changed the background colour of the cell for required rows, but i need Red thin border rather than changing the entire background colour.
    Please guide me on achieving these functionalities..
    Thanks and Regards,
    -Shabir Rahim.

    Hi,
    The red thin lines border you are talking about comes from the framework during the exceptions. If this is the case then refer the following links, hope this will help you.
    [Re: Automatic message for inputfields with state=required]
    [Re: Validation of InputField]
    Well without exceptions, i dont think it will come.
    thanks & regards,
    Manoj
    Edited by: Manoj Kumar on Feb 7, 2008 12:09 PM

  • Get Value From an input field

    Hi All,
    I am a newbie to ABAP Webdynpro.I would liketo know how should I get the value from an input field at runtime?
    Thanks,Mukta

    By reading the context attribute which bound to inputfield, you can get the value.
    Say you have a node called 'MAIN_NODE' and has the attribute 'INPUT_VALUE', which is bound to the Inputfield.
      DATA LO_ND_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA LO_EL_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
      DATA LS_MAIN_NODE TYPE WD_THIS->ELEMENT_MAIN_NODE.
      DATA LV_INP_VALUE LIKE LS_MAIN_NODE-INP_VALUE.
    * navigate from <CONTEXT> to <MAIN_NODE> via lead selection
      LO_ND_MAIN_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = 'MAIN_NODE' ).
    * get element via lead selection
      LO_EL_MAIN_NODE = LO_ND_MAIN_NODE->GET_ELEMENT(  ).
    * get single attribute
      LO_EL_MAIN_NODE->GET_ATTRIBUTE(
        EXPORTING
          NAME =  `INPUT_VALUE`
        IMPORTING
          VALUE = LV_INP_VALUE ).  "LV_INP_VALUE will have the value of inputfield
    Raja T
    Message was edited by:
            Raja Thangamani

  • Dynamic Table Input Field - Disabled in runtime

    Hi,
    I have dynamically created a node. The node as a string attribute X.
    Then dynamically created a IWDTable to bind to the node.
    In the table I have a column, then a tablecelleditor of inputfield.
    The inputfield 'value' is binded to node->X attribute info.
    inputField.bindValue(attributeInfo).
    Then I created a few entries of the node, populating X with some dummy value.
    In runtime, my inputfields are disabled, and the dummy values don't appear.
    I believe it is something to do with my binding.
    Then I replaced the inputfield with a textview. textview text is binded to the node->X
    attribute info.
    textview.bindText(attributeInfo)
    (i.e. exact same attribute info I used for the inputfield)
    In runtime I see my textview with the dummy values.
    Can anyone point me in the right direction?
    Cheers,
    Michael.

    Hi Guys,
    I think to be clear I better include my code here.
    I did bind the table to the nodeInfo, and I did bind the textView/inputfield to the particular attribute.
    As mentioned before, it does show for the textView, but not for the inputfield.
    Create the new node:
              IWDNodeInfo newNode = wdContext.getNodeInfo().getChild("nodeName");
                   newNode =
                        wdContext.getNodeInfo().addChild(
                             "nodeName",
                             null,
                             true,
                             true,
                             true,
                             false,
                             false,
                             true,
                             null,
                             null,
                             null);
    Create the attribute:
                   IWDAttributeInfo detailAttribute =
                        newNode.addAttribute(
                             "xyz",
                             "ddic:com.sap.dictionary.string");
    Get the node
                             IWDNode specificNode =
                                  wdContext.getChildNode(
                                       "nodeName",
                                       0);
    Create the element from the node
                             newElement =
                                       specificNode.createElement();
    Set the attribute value:
                                  newElement.setAttributeValue(
                                       "xyz",
                                       "1234");
    Add the new element:
                                  specificNode.addElement(newElement);
    Create the table now:
                   IWDTable someTable =
                        (IWDTable) view.createElement(
                             IWDTable.class,
                             "TAB_ArticleQty" + articleElement.getArticleId());
                   someTable.setEnabled(true);
                   someTable.setReadOnly(false);
                   someTable.setRowSelectable(true);
                   someTable.setFooterVisible(false);
                   someTable.setSelectionMode(WDTableSelectionMode.NONE);
                   someTable.setVisibleRowCount(-1);
                   someTable.bindDataSource(
                   specificNode.getNodeInfo());
                   TC.addChild(someTable);
    Loop at all the attributes and create the column
    The code for the textView has been commented out
    The code is now for the input field
                    * LOOP AT ALL THE ATTRIBUTES IN THE NODE:
                    * CREATE ONE COLUMN FOR EACH ATTRIBUTE
                   Iterator allAttributes =
                   specificNode.getNodeInfo().iterateAttributes();
                   while (allAttributes.hasNext()) {
                        IWDAttributeInfo attrInfo =
                             (IWDAttributeInfo) allAttributes.next();
                        String attrName = attrInfo.getName();
                                  // Text View
                                  IWDTextView TV_info =
                                       (IWDTextView) view.createElement(
                                            IWDTextView.class,
                                            "TV_AQ_"
                                                 + counter
                                                 + attrName);
                                  TV_info.bindText(attrInfo);
                                  COL_qty.setTableCellEditor(TV_info);
                                  //input field for the user to enter the value
                                  IWDInputField input_Qty =
                                       (IWDInputField) view.createElement(
                                            IWDInputField.class,
                                            "input_Qty"
                                                 + counter
                                                 + attrName);
                                  input_Qty.setEnabled(true);
                                  input_Qty.bindValue(attrInfo);
                                  input_Qty.setWidth("4");
                                  COL_qty.setTableCellEditor(input_Qty);
                             someTab.addColumn(COL_qty);

  • Can i report one message and highlight two or more  input field  ?   in WD

    Hi All,
    I can use " report_attribute_error_message " , this will highlight the field with a red border.
    but  can i  highlight the two fields with a red border at the sametime ? 
    Can anyone help me ?
    Thanks!
    Edited by: DDT CHOU on May 6, 2010 10:20 AM

    Hi,
    Yes - but only for a single element
    use method REPORT_ELEMENT_T100_MESSAGE, or REPORT_ELEMENT_ERROR_MESSAGE or REPORT_ELEMENT_EXCEPTION of the message handler..
    data: lo_component type ref to if_wd_component,
          ls_msg type SYMSG,
           lo_message_manager    type ref to if_wd_message_manager.
      lo_component = wd_comp_controller->wd_get_api( ).
      lo_message_manager = lo_component->get_message_manager( ).
    * some code to populate element reference and populate table of attributes...
       lo_message_manager->report_element_t100_message(
                                                 msg                       = ls_msg
                                                 element                   = lo_element
                                                 attributes                = lt_attribs )
    you can pass a table of the attributes you want to relate to the error - but only one element.
    Nor can you highlight a dropdown by index with an error message. (At least not in a table).
    unfortuantely I don't see a way to do the same thing in the FPM message manger. Fingers crossed for NW7.02...
    Hope this helpful,
    Chris

  • Input Field of Type Time Unable to Keep Input Value

    Hi,
    I am facing the following problem:
    I am using an input field of type time that initially its value comes from a BAPI call. I want though to be able to change its value and use the same field as import parameter for another BAPI. The value of the field is populated correctly from the first BAPI but when I try to change it, the value disappears and it does not keep what I type within the field i.e. the field remains empty.
    Could you please let me know how to resolve this problem?
    Thank you in advance.
    Kind Regards
    Michael

    which runtime do you use?
    which version of VC?

  • F4 Help for a dynamic input field( class CL_DD_INPUT_ELEMENT)

    Hi all,
    I am programming a dynamic document which has several input fields on it. I want to program F4 helps for these fields, does anyone have an idea how I can do that?
    I have the idea to program a button(class CL_DD_BUTTON_ELEMENT) next to the input field and manually program an F4 help in the event handler of the button. But I do not know how I can handle pattern entries with '*' etc. in the input field. Is there a function module which could give me an F4 list(F4IF_INT_TABLE_VALUE_REQUEST could not be used, because it needs a dynpro field as a return field, which we do not have in this case).
    Kind Regards,
    Sükrü

    hi
    good
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE|TABLE node.
    allows you to define further nodes for dynamic selections. If the node has type T, you can use TABLE instead of NODE. The user can then decide at runtime the components of the node for which he or she wants to enter selections. Dynamic selections require special handling in the database program
    F4 HELP->
    AT SELECTION SCREEN ON VALUE REQUEST FOR P_SACHA.
        PERFORM VALUES_SACHA.
    THANKS
    MRUTYUN^

  • Read-only input field error

    I have an input field marked read-only on a form.  When I run the application, select the read-only field, press enter, then Save (validating action), I get a WebDynpro exception saying that I attempted to modify a read-only context attribute.  This does not happen if I select the field and press other keys (such as characters)...  only when I press enter.  If I make the field disabled (instead of read-only), this error is avoided because I cannot even select the input field - but I would rather use read-only because it doesn't gray out the field at runtime.  Is this a bug, or am I missing something?
    -Dave

    When you select the inputField and press enter the OnEnter action of the inputField is being called.
    When you disable the inputField it prevents you from entering values as well as accessing it actions also.
    When you try to keep you context attribute as read only and keep the input field as enabled it is similar to trying to modify a read only attribute which is not permissible.
    Hence the error.
    Revert for further clarifications.
    Message was edited by: Noufal Kareem

  • Interactive form that auto selects input fields based on initial selection

    i want to create a form that based on initial selections, automatically highlights "required" input fields.
    i.e.  if i create an item on the form called "promotion", when this item is "checked", all the fields that are required will automatically light up, and the person completing the form cannot exit, save, and submit the form until all related fields are filled in.
    is this possible using adobe products?  i have cs5 (with dreamweaver, indesign, etc.)
    can anyone point me toward any documentation that will show me how to do this?

    This forum is for Adobe FormsCentral (formscentral.adobe.com) which is a service that allows you to create, collect and analyze data using an online web form. You should ask general HTML form related questions in the Dreamweaver forums:http://forums.adobe.com/community/dreamweaver/dreamweaver_general
    I'll move your post to that forum so you don't need to retype it. They can help you out...
    Randy

  • In BSP how to give the input field as mandatory?

    Hi friends,
    In BSP how to give the input field as mandatory?
    In BSP i want to validate the input field (example checking the material no is valid or not)
    if this material no doesnot exit means i want to pass error message.What is the code for that.
    Moosa

    hi
    try this
    in LAYOUT
    <htmlb:inputField id = "vname"  disabled = "False" value = "<%= v_visitor %>"/> <font color="red" size="2"><b><%= page->messages->assert_message( 'vname' ) %></b></font></td>
    in DO_HANDLE_EVENT
    in oninputprocessing
    CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
      DATA: event TYPE REF TO CL_HTMLB_EVENT.
      event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
      IF event->name = 'button' AND event->event_type = 'click'.
        DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.
        button_event ?= event.
      ENDIF.
        case event->id.
            when 'select'.
               if v_visitor = ''.
                 page->messages->add_message(
                 condition = 'vname'
                 message   = 'Visitor Name can not be blank'
                 severity  = page->messages->CO_SEVERITY_ERROR ).
              ELSE.
                    here u can write ur when ur field getting filled
            endif.
         endcase.
    endif.
    give marks if it is helpful
    thanks

  • Disabling one input field if i enter text in second inputfield

    Hi,
    I am new to WebDynpro. My problem is very simple. I have two input fields. When i enter text in one input field i want the second input field to be disabled & Vice versa. The idea is that i want to give the user the option to enter in only 1 input field of his choice. The second input field should automatically get disabled. He can choose any input field of his choice. The second one should get disabled.
    EG: Assume that there are two input fields "Item No" & "Material". The user wants do a search using any one of these parameters, but not both. So, when he chooses to do a search based on "Item No", the "Material" input field should be greyed out(disabled). And, vice versa. The user may decide to choose any one of these fields.
    Please advise.

    This is not possible because there is no "onFocus" event on the input field.
    But you could use two radio buttons R1, R2 to enable exactly one of the input fields F1, F2 at a time.
    In the view designer, set R1.keyToSelect = "1", R2.keyToSelect = "2".
    Bind R1.selectedKey and R2.selectedKey to a common context attribute A (type string).
    If (at runtime) A contains "1", radio button R1 is selected, if A contains "2", radio button R2 is selected.
    To enable input field F1 exactly if R1 is selected:
    Create a calculated boolean attribute E1 that returns the boolean value ("1".equals(A)), bind property F1.enabled to E1. Do the same for F2.
    Armin

  • Input Field in table - I need a OnClick Event

    Hello everybody,
    I have the following problem:
    I have created a table in my view which is filled at runtime. The table has 3 different rows and every row has TableSingleMarkableCells, these cells further have a input field as their celleditor.
    I now want to know which cell the user is editing. I have a AttributePointer through which I know that at the time the user presses the enter key. But I need to know whether the focus has changed. Because there is the possibility that the user switches between the differnt cells with the arrow key or the tab key. But the AttributePointer only gives me the first selected cell.
    Have anybody a suggestion to solve this problem -  it seemed to be something like definingb a OnClick event for a input field (additionaly to the default OnEnter event...)
    Best regards,
    Sebastian

    Hi,
    You can find out at which row the editing goes, by using
    onLeadSelect action of TableUIElement.
    in onLeadSelect action you can find row number using this statement
    int rownumber= wdContext.node<TableNode>().getLeadSelection();
    Regards
    LakshmiNarayana

  • Dropdown list on Dynpro for a disabled input field - No PAI triggered?

    Hello experts,
    I am facing a problem with a dropdown list on a dynpro (defined as a subscreen). The drop down list should be  for a field that is not input ready (at least it should appear not being input ready).
    The user should be able to pick a value from the dropdown list and as soon the selected row changes a PAI should be processed as other fields on the main dynpro as well as the subscreen itself need to change accordingly.
    The dropdown list works fine but with the field not being set to input ready - neither the input field changes nor a PAI etc. is triggered.
    But if the property for input is set to input ready, it works fine.
    Info:
    Dropdown list is populated in POV
    A function code is assigned to the field
    What am I missing here?
    What properties must be set for the field.
    Thanks,
    Chris
    PS. If set to input - how do I prevent the single empty line in the list?

    hi
    good
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE|TABLE node.
    allows you to define further nodes for dynamic selections. If the node has type T, you can use TABLE instead of NODE. The user can then decide at runtime the components of the node for which he or she wants to enter selections. Dynamic selections require special handling in the database program
    F4 HELP->
    AT SELECTION SCREEN ON VALUE REQUEST FOR P_SACHA.
        PERFORM VALUES_SACHA.
    THANKS
    MRUTYUN^

  • Input Fields of Selection Screen

    HI
    GIven the program name and the Screen #, i need to figure out all the Input fields , Data type and Length  for that program( SAP STD REPORT).
    I checked out the Element List in Se51 for the program name and screen number, I need something similar to it ..I need to pull out that data. How should i approach.
    -Ravi.

    Output checkbox, means that it is a "disabled" input field.  Output Only checkbox, means that it is more like a static text box.
    F1 Help  on  Output Only.
    <i>Pure output field
    This specification makes sense only for template fields.
    At runtime, the format of a template field can be distinguished from that of a field/text field, if it is defined as an output field, but not if it is defined as an input field.
    If the flag is set for an output template, you cannot distinguish the format of a template field from that of a text field. This allows you to insert variable components in apparently fixed texts.
    At runtime, you cannot dynamically modify the input/output attributes of output templates which have this flag set within the LOOP AT SCREEN ... ENDLOOP block in PBO modules.</i>
    Regards,
    Rich Heilman
    Message was edited by: Rich Heilman

  • F4 help in dropdownlistbox and values in input fields

    I need a F4 help in dropdown list box. Actually i have 2 more input fields alongwith one dropwdown list box. As per my problem
    if i select one value from F4 help then corresponding other values should bepopulated into input fields. For example in F4 help
    of dropdown box i am getting single selection containg three values "15  LIMAPLANT     45802" after selecting it the "15" should
    be only input entry to dropdownlist box, values "LIMA PLANT" and "45802" should be input entry to other two input fields.

    Look at the below code:
    <b>Oncreate:</b>
            entry-name = '15'.   entry-value = '15'.   APPEND entry TO itab.
            entry-name = 'LIMAPLANT'. entry-value = 'LIMAPLANT'. APPEND entry TO itab.
            entry-name = '45802'.  entry-value = '45802'.  APPEND entry TO itab.
    <b>Layout:</b>
         <htmlb:dropdownListBox id                = "myid"
                                  nameOfKeyColumn   = "NAME"
                                  nameOfValueColumn = "VALUE"
                                  onSelect          = "myclick"
                                  selection = "<%= v_selected %>"
                                  table             = "<%= itab %>" />
        <htmlb:inputField id      = "myinp1"
                                value   = "<%= v_field1 %>"  />
        <htmlb:inputField id      = "myinp2"
                                value   = "<%= v_field2 %>"  />
    <b>Page attribute:</b>
    entry     TYPE     IHTTPNVP
    itab     TYPE     TIHTTPNVP
    <b>To capture the event:
    OnInputprocessing:</b>
    DATA: event TYPE REF TO CL_HTMLB_EVENT.
      event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
      IF event->id = 'myclick'.
    CALL METHOD request->get_form_field
          EXPORTING
            name  = 'myid'
          RECEIVING
            value = v_selected.
    clear: v_field1, v_field2.
    Loop at itab into entry where name NE v_selected.
    if v_field1 is initial.
    v_field1 = entry-value.
      else.
      v_field2 = entry-value.
      endif.
    endloop.
    endif.
    This will solve your problem..
    <b>* Reward each useful answer</b>
    Raja T

Maybe you are looking for

  • DELETE_CONFIRM_MSG Question

    Hi, I have an application, working in two Languages, and somewhere in the Application i have delete Buttons that call a javascript, javascript:confirmDelete('Would like to permanently delete this Record?','Delete_Clicked'); the Messagebox, is showing

  • Optical audio out not working (incl the solution for me)

    problem: new 2011 Mac Mini, 2.5G connecting to a) TV via HDMI b) to a D/A converter and amplifier for a bit better music output This worked perfectly for my previous MiniMac that I replace due to my need for speed. Now, I could see some red light at

  • Using mail with hotmail

    how do i use mail with my msn hotmail account (http) Thanks!

  • How do import an image into CS3 and resize it?

    Hi, let me say first I know very little of Illustrator C3.  I have a poster that was created by someone else.  I'm supposed to take that image and resize to fit on a pop up banner.  I created a new doc in Ill. with the correct dimensions and copied a

  • Reverse Engineering, with javadoc

    Hi, I want know, if there is any tool, which can create some class-diagrams which use javadoc-htmFiles, or the class/java-files as base. I ask this cause i don?t want a tool which you have to create a 'project' after you have write youre program only