Table Input field validation

Hi Experts
I have an OIF Application in which I have an Input enabled table and it is mandatory to enter the date range fields. When the user clicks 'SAVE', I have to validate if the start and end dates are entered in each record, and give an error message if blank. I wanted to know if I have to loop through each record and validate manually or if there is a better way?
Thanks
Neo

Hello Neo,
you can use the utility method CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW to check for the mandatory attributes.
For this you need to set the STATE property of the inputfield (in the table column) to REQUIRED.
BR, Saravanan

Similar Messages

  • Input field validation in a Table based on the value of other column

    Hi all
    I have a table with 2 columns. column1 is of text view and  column2 is Input field.
    The user should not be allowed to enter a value  in the column2 ( input field) greater than the value populated in column1(textview).
    So for Eg; if the column1 is populated with value 100, The user should not be able to enter a number greater than 100 in the column2  input field.
    Please let me how this can be achieved.
    I appreciate the help.
    Thanks

    Hi,
    Let me make sure u r working with table control.
    First u have to create a event(VALIDATE) to do the validation.
    Inside the event,
    1. First get the current index where user has pointed the curson
    2. Once u get the index read the internal table with index value.
    3. Now u can compare the col1 and col2 values and populate the error message.
    1. DATA : lo_elt TYPE REF TO if_wd_context_element,
                   l_index type i.
    lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
         CALL METHOD LO_ELT->GET_INDEX( RECEIVING  MY_INDEX = l_index.
    above code should be written inside the event.
    Thanks,

  • Table Input Field Problem

    Hi All,
    I am facing a problem now where table row height is too big , as in 1 row size is actually a merged of 2 rows, the input field is shifted to the bottom of the cell.  And when you select the row, an asterik is visible at the bottom row, and the input field is shifted up to the top of the cell. I am using customized iterator and cl_crm_ic_inputfield to render the cell. Anyone have this problem before?
    Thanks!
    Cheers,
    cady

    Hi Guys,
    Some additional info i found on this issue. I am using design2003. I realized that the * added meant that its required field. However, upon further checking, when calling method RENDER_DESIGN2003 in class cl_crm_ic_inputfield, it checkes for me->required is not initial, which is kind of odd since the required field has the initial value of 'FALSE'. So , either required = 'TRUE' or 'FALSE', it will always be required field. Anyone encountered such problem before?
    Cheers,
    cady

  • Table input field.

    I have to create  a table which will take input from user. I have created the context and binded it to the table. At the time of biniding with table i mentioned that these will be input field. But the problem is as the node has no value the table becomes uneditable.I have to give user 5 rows for editing. Can any one tell me the steps of creating this.
    <b>If possible please provide the detail step & Sample code.
    Points will be rewarded.</b>
    Thanks,
    Prosun

    Hi Prosun,
    If you want five empty rows in the beginning Insert 5 empty lines in an Internal table and bind it to the context. You  can see 5 empty rows in ur table.
    Also if u want to add an intial line to ur table when you press add button in the toolbar of ur table.
    Provide a Add button linked wit action add
    In Action :On action add
    DATA: lo_new              TYPE REF TO if_wd_context_element,
            ls_employee         TYPE zemployee,
         lo_node type ref to if_wd_context_node.
    lo_node = wd_context-get_child_node( 'NODENAME' ).
          lo_new ?= lo_node->create_element( ).
      lo_new->set_static_attributes( ls_employee ).
      do_main_node->bind_element( new_item = lo_new
                                  set_initial_elements = abap_false ).
    Regards,
    Ismail.
    Message was edited by:
            Ismail Basha

  • 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);

  • Input field validation in web dynpro abap

    Hi....i have a input field in a view, which is bound with dictionary object of char type ,through context.for this input field, i have to allow the end users to enter the numeric and float values only,but in my condition it accepting everything and returns runtime error.for this how to validate inputs other than numerics.
    Thanks & regards,
    pavan maganti.

      DATA lo_nd_itab2 TYPE REF TO if_wd_context_node.
      DATA lo_el_itab2 TYPE REF TO if_wd_context_element.
      DATA ls_itab2 TYPE wd_this->element_itab2.
      DATA lv_non_numeric TYPE wd_this->element_itab2-non_numeric.
    *     get message manager
      DATA lo_api_controller     TYPE REF TO if_wd_controller.
      DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
    * navigate from <CONTEXT> to <ITAB2> via lead selection
      lo_nd_itab2 = wd_context->get_child_node( name = wd_this->wdctx_itab2 ).
    * get element via lead selection
      lo_el_itab2 = lo_nd_itab2->get_element( ).
    * get single attribute
      lo_el_itab2->get_attribute(
        EXPORTING
          name =  `NON_NUMERIC`
        IMPORTING
          value = lv_non_numeric ).
      IF lv_non_numeric CO '1234567890'.
        lo_api_controller ?= wd_this->wd_get_api( ).
        CALL METHOD lo_api_controller->get_message_manager
          RECEIVING
            message_manager = lo_message_manager.
    *     report message
        CALL METHOD lo_message_manager->report_success
          EXPORTING
            message_text = 'All numeric'.
      ELSE.
        lo_api_controller ?= wd_this->wd_get_api( ).
        CALL METHOD lo_api_controller->get_message_manager
          RECEIVING
            message_manager = lo_message_manager.
    * report message
        CALL METHOD lo_message_manager->report_warning
          EXPORTING
            message_text = 'Contains characters'.
      ENDIF.

  • Input field validation using JSP in HTMLB

    Hi All,
    How can we validate an input field in a form in BSP page.
    Like: There are two input fields in my form.I want the user to enter value in any one and only one of the fields.If the value is entered in both fields or none of the fields the user should get a popup and form  must not be submited.
    Shall i use the onClientClick attribute of Button element or doValidate attribute of Inputfield element or  validationScript attribute of From element?
    Please help.
    Thanks a lot,
    Anubhav.

    Here you go:
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title=" " >
        <htmlb:form id="form1" >
          < script t-ype = "text/javascript" >     "Remove "-" between t & ype in type
          function checkInput()
           var field1 = document.form1.field1.value;
           var field2 = document.form1.field2.value;
    var error = "";
    if(field1 != "" && field2 != "")
              { error = "X";
                  javascript error message here          }
    if(field1 == "" && field2 ==  "")
              { error = "X";
                                javascript error message here
    if(error == "")
              htmlbSL(this,2,'mybutton:Submit');
          < / script >
              <htmlb:textView text      = "Hello World!"
                              textColor = "RED"
                              design    = "HEADER1"
                              align     = "CENTER" />
              <htmlb:inputField id        = "field1"
                                value     = "<%= var1 %>"
                                type      = "integer"
                                alignment = "CENTER" />
              <htmlb:inputField id        = "field2"
                                value     = "<%= var2 %>"
                                type      = "integer"
                                alignment = "CENTER" />
              <htmlb:button id            = "mybutton"
                            text          = "Press Me"
                            onClientClick = "javascript:checkInput();" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Raja T
    Message was edited by:
            Raja Thangamani

  • Alv Input Field Validation

    Hi Experts,
    In my initial screen there are some search criteria based on which i ve to display the data by using ALV.
    And i ve hardcoded some value and the data are coming  in ALV . But my question is how can i validate the data which is enter by the user in the search field so that data can bedisplay based on the search criteria in the alv output.
    Regards,
    Satya

    Hi ,
    use OVS (object value selector) method there , it wll take input and according to that f4 will be displayed.
    OVS Component:
    https ://OVS Input Help
    http://help.sap.com/saphelp_erp2005/helpdata/en/30/d7fa41c915da6fe10000000a1550b0/content.htm
    Packages : WDR_TEST_OVS2,WDR_OVS,WDR_TEST_OVS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/webdynpro/wd%20java/wdjava%20archive/web%20dynpro%20valuehelp%20using%20object%20value%20selector.pdf
    /people/shruti.rathour/blog/2008/05/05/ovs-help-in-web-dynpro-abap
    Regards,
    Muneesh Gitta.

  • Field validation in table maintenance generator and input value grey out.

    i have created ztable with 3 fields as em_no,em_no and addrnumber.
    first two fields are custom fields but the third custom field need to validate the standard table adrc contains the value of the field addrnumber.
    i need the query of field validation query which we write in create entry events in table maintenance generator and also if we give wrong value for addrnumber in sm30 maintain table, the input field need not to be grey out for next entry...
    please help.

    Hi,
    create method -
    >before saving data.....write the logic between the method
    go to utilities->table maintanance ,,,after creating generator ---go to envirnment->modification->events.
    create event -.>.as zsave select event  type 1(before saving data to table) write code in include....
    consider data for field3 is 10 .
    lv_new = ztbr(table name)-field3.
    select field3  from ADRC(ZTABLE) into wa_new (TYPE ZTABLE) where field3 = lv_new.
    if sy-subrc = 0.
         working fine
         else.
        message  i888(sabapdocu) with 'data invalid'.
    endform.
    This will help u...
    Thank u.........

  • Input Data Validation Of A Field Associated To A Check Table

    Hello,
    Does Web Dynpro have an inherent functionality to validate input fields associated to a check table?
    For example I created a structure with the field UNAME and defined USR02 as the check table for it.  And then I defined a UI InputField in my View and bind it to UNAME.  Web Dynpro does NOT seem to do an automatic validation to check if the value entered by the user exists in USR02. 
    Is there an interface or class that can be called in method WDDOBEFOREACTION to do the validation.  Or do we just have to do some manual validation using SELECT statements?
    Thanks.
    Giscard

    Hi Giscard,
    Web Dynpro does automatic validation when  you assign the check table  .
    You need not write any code as such.
    If the data which you entered is incorrect ,when you are trying to perform any action(like saving the data in data base or performing any further action with the wrong data that ia entered )
       the system throws an error message as"USERNAME -
    NOT IN THE SYSTEM'.
    Regards,
    Priya

  • Error in validation an input field in a table ui and high lighting the cell

    Hello All,
    I have a table ui in one of my application.   This table has, say 6 columns; out of these 6 columns 4 columns are shown as input fields.  User needs to put in some numbers in two of the fields.  I need to capture these two number fields data and subtract one from the other.  If number is negative , I need to let the user know by error message that the number is negative and they need to fix their input to make the answer positive.  I am able to do all this, but I am not able to high light the corresponding field which needs to be fixed.  Is there anyway I can do that...I mean high light the particular field as one gets it when we use the "report attribute error message" method of message manager class. 
    Secondly I can not halt the application, I need to do some work around for that using some flags.  Is there a simple way to halt the application, other than using flags and if condition?  I searched this forum, but could not find any definite answer....
    Thanks very much!
    Any help would greatly be appreicated.

    Hi....
    First you should have the table values in an internal  table.... for that yo need to get the values from the context like this....
    *DECLARE INTERNAL TABLE AND WORKAREA.
    data ls_nd_stru type wd_this->element_<node name>
    data lt_nd_table type wd_this->elements_<node name>
    get all declared attributes
    lo_nd_<your context node>->get_static_attributes_table(
                                               importing
                                               table = lt_nd_table ).
    *now your lt_nd_table will have the values.....what ever you have in the table.
    *then
    loop at lt_nd_table into ls_nd_stru.
    <.....your logic.....>
    <ie., read the current line of the field like
    ls_nd_stru-<field name1> = ls_nd_stru-<field name2> - ls_nd_stru-<field name3>
    then check error msg... based on your postive or negative values
    endloop.
    Hope this will help you....
    Thanks & regards
    Raja

  • 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

  • Input field in a table view control

    Hi,
        I have a table view control, with input field in one of the columns.
        That is meant for entering some values.
        My problem is when i am entering a 3 input field with value and then by   using     mouse control i enter say 20th input field with value.  After that when i use the directional keys to enter the 21st field, the cursor is not in 21st field, it is somewhere else.
    How to correct this problem.
    Regards,
    Vijayalakshmi

    Hi,
    Try to use the TABINDEX property of <input>.
    Best regards,
    Guillaume

  • How to get the value from the Input field of the Table view.

    Hi Experts,
    I have created a table view with 10 rows and each rows contains input fields in it.Can you please help me getting the values that are entered in all 10 rows.
    Currently I am using the below code,but using the below I am able to get only the first row details of the table.
      lo_el_table->get_static_attributes(
        IMPORTING
          static_attributes = ls_table).
    Please let me know you suggestions on this.Thanks in advance.
    Regards,
    Arun

    Hi Arun,
    You should use this method:
    lo_nd_table->get_static_attributes_table(
    IMPORTING
    table = lt_table).
    Cheers,
    Roelof
    http://www.nl4b.com

  • Add data to table view from input fields in a page

    Hi
            I am developing a BSP page which will be called from SRM shop transaction. After user enters the line item data, data will be passed back to shop transaction using OCI interface and the page attributes (URL).
       (1) How can I add data from input fields to table view on a page on a button click? I am able to add first line but I could not retain first line data when I try to add the second line.
          I am able to add multiple lines to table view if I use view and controller by adding to the line data to static attribute of the controller. I can’t use the controller and view because I can not set the attribute to Controller automatically.
       (2) Is there a way to pass an attribute (URL) to controller from SPRO? Like we pass an attribute to page automatically (Automatic page attribute).
       (3) How can I call a controller and view and pass the page attribute to the controller on a button click from a page with out controller?
    Thanks
    Sreenivas

    I'm trying to test the merge with the following data in a test.txt file:
    ZZZZZ114923000004
    1234Z400660000001
    ZZZZZ114923000010
    Getting an error:
    SQL> @C:\dataformats\sql\pc12seriesMerge.sql
    Directory created.
    SP2-0552: Bind variable "17" not declared.
    SQL>
    here it the pc12seriesMerge.sql file
    set serveroutput on
    create or replace directory user_dir as 'c:\dataformats\incoming\';
    DECLARE
    v_filename VARCHAR2(100); -- Data filename
    v_file_exists boolean;
    v_file_length number;
    v_block_size number;
    f utl_file.file_type;
    s varchar2(200);
    lineString varchar(200);
    v_account varchar(5);
    v_IDN varchar(6);
    v_quantity varchar(6);
    BEGIN
    v_filename := 'TEST.TXT';
    DBMS_OUTPUT.PUT_LINE(v_filename); --shows filename
    utl_file.fgetattr('USER_DIR', v_filename, v_file_exists, v_file_length ,v_block_size );
    IF v_file_exists THEN
    dbms_output.put_line('File Exists');
    create table ext_table (
    account varchar2(5),
    idn number(6),
    quantity varchar2(6)
    organization external (
    type oracle_loader
    default directory user_dir
    access parameters (
    records delimited by newline
    fields (
    account position(1:5) char(5),
    idn position(6:11) char(6),
    quantity position(12:17) char(6)
    location ('test.txt')
    reject limit unlimited;
    MERGE INTO id_req_stg t
    USING (
    SELECT account,
    idn,
    decode(quantity, '-', 0, to_number(quantity)) as quantity
    FROM ext_table
    ) v
    ON ( t.account = v.account AND t.idn = v.idn )
    WHEN MATCHED THEN
    UPDATE SET t.quantity = v.quantity
    DELETE WHERE t.quantity = 0
    WHEN NOT MATCHED THEN
    INSERT (account, idn, quantity)
    VALUES (v.account, v.idn, v.quantity);
    ELSE
    dbms_output.put_line('File Does Not Exist');
    END IF; -- file exists
    EXCEPTION
    WHEN UTL_FILE.ACCESS_DENIED THEN
    DBMS_OUTPUT.PUT_LINE('No Access!!!');
    WHEN UTL_FILE.INVALID_PATH THEN
    DBMS_OUTPUT.PUT_LINE('PATH DOES NOT EXIST');
    WHEN others THEN
    DBMS_OUTPUT.PUT_LINE('SQLERRM: ' || SQLERRM);
    END;
    /

Maybe you are looking for

  • Comparison b/w itable and app server file

    Hi All, I have Postal code data (KNA1-PSTLZ) in internal table. And I have input file in the app server, in that I have a data of Postal code in range like Postal code FROM     Postal code TO   (KNA1-PSTLZ)        (KNA1-PSTLZ)   20001                

  • Possible Failing MacBook Pro 15" (mid 2007) B(lack)SOD?

    Yeah, yet another thread about the NVIDIA card. But! The screen goes black sporadically! The laptop screen and not my external monitor fails, sometimes comes back on again. A reboot used to help. Then it failed completely, I couldn't even get a signa

  • Cannot update my move app because of unknown error when entering my password for my apple id

    I am having problems updating my iMovie app. I saw the new update at my work place when finishing up the work day, so i thought i'd update it. But soon i relaised that it too some time as the file being downloaded was quite large, so i decided to pau

  • /var/lib/pacman/local empty

    Hello all, I've been using Arch for a few years, but I obviously haven't learn't anything in the process as I've done a very silly thing. I wanted to empty the pacman cache at /var/cache/pacman/pkg, but instead I did 'sudo rm -r /var/lib/pacman/local

  • Reseting  User ddic uflag parameter in Client 00 On Iseries as400 v5r4m0

    Hi I am busy doing a homogenous system copy from my prd system to a new 4th system (for Migration possibilities). I know that at the end of my db copy it will prompt ,me to provide the ddic password. My source system ddic user id (prd) at the moment