How to set number of characters in input field ?

I am creating an input field dynamically (via CL_WD_INPUT_FIELD).
I am binding the value (via BIND_VALUE) to an attribute with type CHAR30.
I want to give the possibility to enter a number with 4 digits (0 - 9999).
Is it possible to restrict the number of characters that can be entered to 4 (although the BIND_VALUE attribute has a type CHAR30, that allows 30)?
I have tried it via set_length, bind_length but it seems that the length of the BIND_VALUE attribute overrules the length information...

Hi Moritz,
AFAIk you have no other option as using a NUM4 here.
Set Length just sets the lengths of the inputfield according to the current character set ... count of charcters but does not limit the value you may enter
Cheers
Sascha

Similar Messages

  • How to set mask in web dynpro input fields

    i am looking for how to set mask in web dynpro input fields.
    Please suggest

    Argha,
    As Maksim suggested, read my weblog -- it is an exact answer for such "masking" (/people/valery.silaev/blog/2005/11/29/800format-your-way)
    Next, you may not add custom js files to WebDynpro and change the way WD processes client input, so there is no way to force user to type only digits and to insert hyphens automatically.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • How to make numbers in message text input  fields left aligned?

    Hi Friends
    I have completed one of my task .but getting result right side of the field.
    how to make numbers in message text input  fields left aligned?
    Thanks
    Aravinda

    Hi ,
    Sorry for late replay i am trying this alos not set that page....
    pageContext.forwardImmediatelyToCurrentPage(null, true, null);
    and one more that kff field working is fine for ex display any text pled displayed properly and only problem is not set the value and HrSitKeyFlex6 and HrSitKeyFlex7 fields are perfectly get the values but not pront HrSitKeyFlex8 that only my issue....
    Regards,
    Srini

  • How to set default date value to a field on screen

    How to set default date value to a field on screen and allow users to modify it ....

    Hello,
    In the PAI module, you need to save the changes to the database using the command MODIFY.
    Follow an example:
    Create or change a message in database table T100. If there is no message with the number 100 in the MYMSGCLASS message class in English, it will be created. Otherwise only the text is changed.
    DATA message_wa TYPE t100.
    message_wa-sprsl = 'EN'.
    message_wa-arbgb = 'MYMSGCLASS'.
    message_wa-msgnr =  '100'.
    message_wa-text =  'Some new message ...'.
    MODIFY t100 FROM message_wa.
    Regards.

  • How i can show the selection screen input field in the top of page in alv

    hi ,
              how i can show the selection screen input field in the top of page in alv  grid output.
    tell me the process

    Hi,
    excample from my program:
    FORM topof_page.
      DATA: l_it_header   TYPE TABLE OF slis_listheader WITH HEADER LINE,
            l_info        LIKE l_it_header-info.
      DATA: l_it_textpool TYPE TABLE OF textpool WITH HEADER LINE.
      DATA: l_key LIKE l_it_textpool-key.
      READ TEXTPOOL c_repid INTO l_it_textpool LANGUAGE sy-langu.
      DEFINE m_selinfo.
        if not &1 is initial.
          clear l_it_header.
          l_it_header-typ   = 'S'.
          l_key = '&1'.
          translate l_key to upper case.
          read table l_it_textpool with key key = l_key.
          if sy-subrc = 0.
            shift l_it_textpool-entry left deleting leading space.
            l_it_header-key = l_it_textpool-entry  .
          endif.
          loop at &1.
            case &1-option.
              when 'EQ'
                or 'BT'
                or 'CP'.
                write &1-low to l_it_header-info.
              when others.
                write &1-low to l_it_header-info.
                concatenate &1-option
                            l_it_header-info
                       into l_it_header-info
                       separated by space.
            endcase.
            if not &1-high is initial.
              write &1-high to l_info left-justified.
              concatenate l_it_header-info
                          l_info
                     into l_it_header-info
                     separated by space.
            endif.
            if &1-sign = 'E'.
              concatenate ']'
                          l_it_header-info
                     into l_it_header-info.
            endif.
            append l_it_header.
            clear: l_it_header-key,
                   l_it_header-info.
          endloop.
        endif.
      END-OF-DEFINITION.
      m_selinfo: s_trmdat,
                 s_trmext,
                 s_trmint,
                 s_fkdat,
                 s_delno,
                 s_vbeln,
                 s_deact,
                 s_kdmat.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = l_it_header[].
    ENDFORM.
    I hope, this will help you.
    Regards
    Nicole

  • How to set a default value for particular field in SRM PO Portal

    Dear Gurus,
    Im desparetly need a help in web dynpro on how to set a default value for a field(flag) in PO header tab in portal.
    My requirement is whenever the user press the edit button in PO screen,automatically a flag field should be set as abap_false.
    I dont think this will handle in check badi or change badi. i tried this part in onbuttonpressed overwriteexit in CNR_VIEW views,i can get the function EDIT in debugging mode,but dont know how to proceed further.....
    Many of them suggested to go with get attribute and set attribute for changing any particular field in web dynpro,but im not very familiar in using those get and set attributes.I request you people can give me sample code on how to identify my target field in the node and set the values while pressing EDIT Button.
    Thanks in advance...
    Regards,
    Sathish

    Dear Laurent,
    Thanks for your response,
    But i searched in enhancement spot of WD_BADI, but couldnt get the exact way to change the coding,
    My real requirement is, that particular flag should be enable and disable dynamically by checking a condition in my header values.So in that case i dont know how to proceed further to handle in the PO screen.
    Kinly guide me how to get the particular node of field in the Purchase order screen.
    Thanks you in advance,
    Sorry for the inconvenience if any
    Regards,
    sathish

  • How to set a new value for formula field in crystal reports xi?

    <p>How to set a new value for formula field in crystal reports xi?</p><p>//formula</p><p>{@description}</p><p> </p><p>exemplo in VB6</p><p>crxSubreport.FormulaFields.Item(1).Text =  "&#39;Subreport Formula&#39;"  or</p><p>crxSubreport.FormulaFields.Item("description").Text =  "&#39;Subreport Formula&#39;"</p><p>How to in JRC?</p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p>

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • How to set a date range for date field ?

    Dear Experts,
    Scenario:
    I have a query in validating the date field in my BSP application. My application is for maintain infotype 0023 Other/Previous Employers online by employees in the company.
    As per our design we are maintaining the all employment details of the employee both ( with in the current company / previous employment outside the company) in the same infotype.
    Every employee will have a hiring date within the SAP HR system. We consider this date as the cutoff date between current and previous employment in our application. When the employee updating the details wia BSP page I need to check the following.
    Record inside current company: Validation that, the user should only able to enter BEGIN DATE (BEGDA)  greater than or equal HIRING DATE and END DATE(ENDDA) should be greater than FROM  DATE (BEGDA).
    Record outside current Company: Validation that, the user should only able to enter BEGIN DATE (BEGDA)  less than or equal HIRING DATE and END DATE (ENDDA) should be greater than FROM  DATE (BEGDA) and less than HIRING DATE.
    Technical Requirement:
    How to set a date range for date field, i.e. how we can limit the date range in a HTMLB date field? Can this it be achieved via standard functionality of HTMLB?
    Following is the code to describe date field in my application.
        <htmlb:inputField id= "ENDDA_NEW_IN"
                          type= "date"
                    doValidate= "TRUE"
                      showHelp= "TRUE"
                      disabled= "FALSE"
                         width= "183"
                         style= "cssTextAreadate"
                         value= "<%='99991231'%>"/>
    Thanks a lot in advance for your assistance and help.
    Cibinu2026
    Edited by: cibin kuruvilla on Nov 12, 2008 11:13 AM

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • HOW TO  SET A DEAFULT  VALUE  FOR A FIELD?

    hi friends
      i have doubt..how to  set a default  value for a field..say  like in  local printer field i always want  lp01 to  be displayed defaultly..when i  click  F1  in that  field i  get the parameter id ..i  know there is something  dealt with that  parameter id..how can i  set that  default value ..in the case of the default  printer value i made in  own data settings as lp01 but  how to  do it  normally  for other  field which has parameter id ??????
    thanks and regards
    prince

    Hi Prince,
    u can set the default value in abap as given below
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS : S_BUKRS TYPE BSID-BUKRS OBLIGATORY DEFAULT '1000'.
    PARAMETERS : S_BELNR TYPE BELNR_D OBLIGATORY DEFAULT '1600000070'.
    PARAMETERS : S_GJAHR TYPE GJAHR OBLIGATORY DEFAULT '2008'.
    PARAMETERS : ASON TYPE BUDAT OBLIGATORY DEFAULT SY-DATUM.
    PARAMETERS : S_KUNNR TYPE KUNNR MODIF ID GP1.
    PARAMETERS : S_LIFNR TYPE LIFNR MODIF ID GP2.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN : END OF BLOCK B1.
    or
    u can give the default value in INITIALIZATION also.
    vlue = '1000'.

  • How to set a value to a disabled field in an B1 screen ?

    Hi,
    Can anyone tell me how to set a value to a disabled field in an existing screen.
    For example , I want to set a value to the Paid/Credited field in the Sales - A/R Invoice screen, which is a disabled field.
    I tried setting the field as enabled but it throws an error.
    Thanks in advance
    Mina

    It depends on the business process required for generating the invoice.  (What is this process just now?)
    I can think on quite a few ideas, but can't be sure if any of them will match your specific requirements.  I'll list a few here and see if any of them might work, or at least generate some new ideas for you. (Unfortunately you can't change an existing payment object to add an invoice to it at a later date, nor is the reconciliation process exposed through the SDK.  This limits your options a bit.)
    1) Is there a need for a separate delivery and invoice?  Would skipping the delivery process and using the standard Invoice + Payment screen work for you?  Stock would be issued, invoice created and payment matched directly to invoice without any work.
    2) This might apply if the invoice is simply a one for one match with the delivery.  Rather than just generate a payment in the delivery screen, generate the invoice and a payment at the same time.  The standard invoice screen will then show it as paid.  You can control the dates on the invoice raised through DI code.
    3) Where do you write the Paid Amount to?  How is it not available in the invoice screen?  Put it somewhere accessible and write it to the user field.
    John.

  • How auto turn lowercase to uppercase in input-field?

    Hi All,
    How auto turn lowercase to uppercase in input-field?
    Thanks
    Smile

    The way I implemented it was using a javascript function to change the case by calling the javascript function from the textfield tag with onblur event. Here is the javascript code and how it was called:
    enter the following code within your with the head tag
    <script>
    function case_checker(){
    var st = document.getElementById("form1:[Enter the textfield ID here]").value;
    document.getElementById("form1:[Enter the textfield ID here]").").value = st.toUpperCase();
    </script>
    call the code from the textfield tag has follow:
    <ui:textField binding="text" id="[Textfielf ID]" onBlur="case_checker(')" style="border-style: inset; border-color: #000000; left: 216px; top: 144px; position: absolute; width: 144px"/>

  • How to restrict number of characters for an input field

    Hi All,
    I have an input field.
    The max number of characters for this input field is 10.
    when a user enter more then 10 characters. it should prompt for an error or the input field should not allow to accpet the 11 character.
    how we do this in VC.
    need your helpful answers
    Rgds
    Srinivas

    Hi Srinu
    You could achieve this by configuring error messages under the formula:-
    Select the control properties and in the Input field at the Display tab write the formula
    "IF((@<LEN(text)>10),'appropriate message','Records available')"
    Note :- there is a LEN(text) under text functions in formula tab.
    Regards
    Navneet
    Message was edited by:
            Navneet Giria

  • How to set default email address for input

    G'day all
    Summary: I'm sick, it's difficult to type, and a combination of autocorrect, default Shift key settings for input fields and my iPad completely ignoring my default email account is making it laborious to input my email address. Help!
    (Edit: I had a micro-brainwave and checked my "Me" card in Contacts, since I have Safari set to autofill from that card. My default email address is not listed first in the card. I've now put it on top, Gmail second and "me.com" last. I'll comment later on if I see this help with point 3 below.)
    Details:
    I love my shiny new iPad2. I really do. But autocorrect is driving me crrrrrazy when I try to input my email address.
    Typing in general is an issue for me, because I am disabled and have difficulties with coordination and movement. On my laptop (MacBook Pro mid 2009), I used TextExpander. It lets you set an abbreviation for any text, so you can just type that abbreviation instead of the whole thing, and TextExpander automagically inputs the whole thing for you.
    I have a long email address, because my ISP has quite a long domain name. So only typing 4 characters (my abbreviation) instead of the whole 23 characters was a big help for me.
    Enter the iPad.
    I need to use the iPad now, because my laptop is now too heavy for my legs (and I do occasionally need a full-on laptop, so the MacBook Air isn't the solution). The iPad in general has been great for me. The simplification of the interface (while annoying at times, e.g. not being able to view full headers in an email) saves brain cycles, so I can read for longer.
    However, where on my laptop I only needed to input 4 chars for my email address, on my iPad I have to input the whole 23 chars. How many places online are you asked to input your email address? Way too many. Safari may eventually catch up and record some of them, but currrently, I'm using too much of my day's energy just on trying to input my email address. (Note: this post is written on my laptop, so I can use my abbreviations.)
    TextExpander is available for iOS, but due to Apple's current refusal to allow integration with its apps, TextExpander isn't allowed to input stuff directly. Just like with the indispensable password program 1Password, you have to switch from Safari to the other app., search for and select and copy the text you want, then switch back to Safari, select the field and press Paste.
    Grrr.
    I may get desperate enough to go through those steps each time, if things don't improve with my email address. My problems are:
    1. Very few email-address fields in webpages currently have the appropriate settings to instruct the iPad keyboard not to start with the Shift key down. This means every time you try to input your email address, it will start with an upper-case letter.
    Half the time I don't notice until I've got part-way through typing my address, so I have to delete all those chars and start again. About a quarter of the time, after deleting, I don't notice that the Shift key has been activated again, so I go through the whole process again.
    2. Even when the email-address field turns off the Shift key, or when I remember to do it myself before entering text, autocorrect will insist on changing the first letter back to upper-case, because my username is also my first name. Cue more deleting and getting confused.
    3. This is the big one: once my username is up there, autocorrect insists on entering my "me.com" email address. This is the email address I use least. When I laboriously (again) delete this text and start again, it will either insist again on "me.com", or input my Gmail address. That is the email address I use second least. Autocorrect never inputs my main email address, set as my default account in the Mail-Con-Cal Settings. (This is a POP-only account.)
    4. Even if I do manage to input my whole email address correctly, autocorrect will insist on capitalizing the first letter of the domain name (which is also a location). Cue yet more deletion and retyping.
    Are there any ways to avoid wasting so much energy on trying to input my email address?
    Is there any way to set the default input email address? Or to tell the iPad/Safari that an email address field doesn't require the Shift key?
    I've had my iPad for nearly three months now, using it for my day-to-day activities, and I've been hoping this problem would gradually go away, that the software would finally catch on to my main email address (from the default account) which I have input over and over (and OVER) into email-address fields.
    Evidently not.
    Any ideas?
    Thanks in advance for any help you can offer.

    As Roosevelt suggested, you can turn off Auto Correction in the keyboard settings. Go to Settings>General>Keyboard>Auto Correction>Off.
    This will also turn off spell check (unfortunately) and there is no fix for that. Auto Caps can also be turned off as well and so can the keyboard shortcut for the space/period. Frankly, all of these features drive me nuts and I wish the iOS allowed for more control, but it does not.
    As fars as typing your email address, be aware that even if you type your email address in all caps it still works. So if Autofill insists on capitalizing the first letter in your name in the email address - and it will insist on doing so - you can just let it go as is and it will still work. Doesn't really get to the heart of the matter but it would save you the laborious deleting and retyping.
    Having said that, when the Auto Correction suggests a word or wants to set a capital latter, you can tap the "x" in the pop up suggestion to ignore that word, cap, whatever. The dictionary is then supposed to "learn" your word if you refuse that suggested word enough times. This is another feature that seems to have a mind of it's own at times since sometimes it may take more than a few attempts to get the Auto Correct to not come up and instead allow your chosen word to be freely typed as desired.
    Lastly, with regard to your correct email address popping up, that is another case of if repeated time and time again, It should be another case of the iOS "learning" through repetition that your default email should popup when you begin entering the address.
    You could try to rectify all of this by resetting all of your settings and clearing Autofill but you would be starting all over again which is something I think you would rather avoid.
    Settings>General>Reset>Reset All Settings
    Settings>General>Reset>Reset Keyboard Dictionary
    Settings>Safari>Autofill -tap names and passwords>Clear all
    As Roosevelt suggested, submit feedback, and I hope you find some resolution to this.
    Quick Note - I originally typed this post on my iPad and when I read a few of the words that were substituted by auto correct - I quickly turned to my iMac to change the words. I do feel your pain with regard to auto Correct!
    Message was edited by: Demo

  • How to set number of Rows of a table to be displayed based on user action?

    Hi Experts,
    I am getting data into the table. But only 5 records are displayed default. I want it to be a user selection.
    If user wishes to see 10 records, then first 10 records should get displayed. If user selects 'n' records then 'n' records should get displayed..
    How to achieve this?
    Regards,
    Yugesh A.

    hi Yugesh ,
    1 create  a input field UI
    2 bind its value property  to a attribute
    3 suppose ca_check attribute ( type string ) under node cn_check is binded
    read this in ur doinit of the view
      DATA lo_nd_cn_check TYPE REF TO if_wd_context_node.
      DATA lo_el_cn_check TYPE REF TO if_wd_context_element.
      DATA ls_cn_check TYPE wd_this->element_cn_check.
      DATA lv_ca_check LIKE ls_cn_check-ca_check.
    * navigate from <CONTEXT> to <CN_CHECK> via lead selection
      lo_nd_cn_check = wd_context->get_child_node( name = wd_this->wdctx_cn_check ).
    * get element via lead selection
      lo_el_cn_check = lo_nd_cn_check->get_element(  ).
    * get single attribute
      lo_el_cn_check->get_attribute(
        EXPORTING
          name =  `CA_CHECK`
        IMPORTING
          value = lv_ca_check ).
    4 nw for  ur table , make a another context attribute of type either string or I , say attr1
    bind its visiblerowcount property of table to attr1
    5 make a attribute in ATTRIBUTES tab of type string , say attribute
    set its value to lv_ca_check in doinit itself
    wd_this->attribute = lv_ca_Check
    6 nw in the method , where u need to validate how m,any rows user enter or doinit itself , set attr1 to the value of that attribute created under ATTRIBUTES tab ( named attribute)
    DATA : lv_count type string .
    lv_count = wd_this->attribute
    7 nw its very simple , set attr1 to lv_count , as it contains the count of the number which has entered in the input field
    DATA lo_nd_cn_check TYPE REF TO if_wd_context_node.
      DATA lo_el_cn_check TYPE REF TO if_wd_context_element.
      DATA ls_cn_check TYPE wd_this->element_cn_check.
      DATA attr1 LIKE ls_cn_check-ca_check.
    * navigate from <CONTEXT> to <CN_CHECK> via lead selection
      lo_nd_cn_check = wd_context->get_child_node( name = wd_this->wdctx_cn_check ).
    * get element via lead selection
      lo_el_cn_check = lo_nd_cn_check->get_element(  ).
    * set single attribute
      lo_el_cn_check->set_attribute(
        EXPORTING
          name =  `attr1`
          value = lv_count ).
    I hope it shud help
    proceed like these , u wud be able to achieve the desired functionality
    regards,
    amit
    Edited by: amit saini on Oct 20, 2009 1:12 PM

  • How to find number of characters in a character string

    Hi,
      Can anyone please tell me about how to find the number of characters in a character string type variable.
    Reagards,
    Siva

    hi,
    Use STRLEN for Calculating String Length..
    Assign it to integer variable for Further Use.Suppse u need to find string length for "hai".. this piece of code will help u
    data:  var type string value 'hai',
             len type i.
    len = strlen(var).
    write len.

Maybe you are looking for