Restricting max lenfth in Input field

Hi,
I have use BW standard Object and this is binded to my Input field. Since BW Object is of length 60, Input field in Web Dynpro is allowing me to enter 60 Character. I want to restrict the input field to 40 so that user can not enter more than 40 character.
Is there any possiblity to restrict input field without changing binding elemnt.
Thanks
Abhishek

Other option is restrict the no of characters entered by user by binding it with context attribute of char40.
OR 
you could even avoid the OnEnter event of Input field if you have some more UI fields in your layout i.e.
If you have a dropdown or a button to naviagate to other screen, then you could check there also.
If there is no other UI, Try writing the code in wddomodify, but please be aware that wddomodify is called on evry event.
So if you are writing code to restrict no of characters to 40 in wddomodify, write it with a conditon like :
if lv_input is not initial.
<  check the no of char and throw erro.>
endif.
lv_input has the value of input field which you could read by code wizard i.e control + F7.

Similar Messages

  • How to restrict the length of input field

    Hi,
    How to restrict the length of input field. That is we should not be able to enter more thatn 10 charecters.
    Regards,
    H.V.Swathi

    Hi swathi,
    For this you have to create a simple data type. No need of writing a code.
    Go to Dictionaries -> Local Dictionary -> Data Type - > Simple Type - > Right click and "Create Simple Type".
    Here you should create a Simple type with String as built-in Type. Here you will also see the Length Constraints option.
    Set the value of maximum length and minimum length. In your case set the value of maximum length to 10. At runtime this will not allow the user to enter more than 10 characters.
    Now create an attribute and bind it to this newly created simple type. Bind the value of the input field with this particular attribute.
    Regards
    Manohar

  • How do you restrict new line in input field or delete last char. in as3?

    Sorry, Noobie here!
    I have a text input box. If the enter key is pressed, a new line begins; thus making the previous line invisible unless the backspace key is pressed.
    So, if i type "1" into the input box, then hit eneter the number "1" becomes invisible, unless I hit back.
    Now, I still need the enter key because i have an event listener that calls a function once it is pressed, but i still need that "1" to be visible.
    So, I need one of either:
    To be able to restrict the input text field from creating a new line (making max line allowed= 1)
    or
    To delete the last character entered in the input text if the enter key is pressed.
    Both of these should have the same result, however I don't know how to do both.
    If anyone can help, i'd be very grateful!

    This worked! Thanks so much!

  • How can we restrict the sub-screen input field for particluar country?

    Hi all i am having infotype 21 maintained with custom fields for sub-screen 200.
    Out of that custom fields(City , District) They restricted city field not to appear for australian employees.
    and district is sucesfully appearing .
    They have written logic in the sub-screen 200 in PBO.this is reflecting in alll sub-types of 21(alomst 20 subtypes)
    module abc_output.
    If T001P-MOLGA = 'australia'.
    if screen name = 'city'.
    screen-input = 'OFF'.
    screen-invisible = 'ON'.
    endif.
    endif.
    Now the requirement is that this logic should be modified such that this city should appear in 7 sub-type instead of district.
    what should be written can any one guide please .
    regards
    sas

    Hi we can do in this way.
    If T001P-MOLGA = 'australia'
    if p00021-subty ne '7'.
    if screen name = 'city'.
    screen-input = 'OFF'.
    screen-invisible = 'ON'.
    endif.
    endif.
    if p0021-subty = '7'.
    if screen name = 'district'.
    screen-input = 'OFF'.
    endif.
    endif.
    Thanks and closing the thread
    regards
    sas

  • Setting input field restrictions.

    without using a text box component, is it possible to add
    restrictions to a basic input field?
    Basically I have this input field and I would like to
    restrict the value to be >= 1000. So when a user enters a
    number, it must be between 1000-100,000.
    Also how do I set a minimum and maximum number of characters
    for the field?
    Any help would be greatly appreciated.
    Thanks in advance.

    Any suggestions?

  • How to restrict the user to enter only numeric values in a input field

    How to restrict the user to enter only numeric values in a input field.
    For example,
    i have an input field in that i would like to enter
    only numeric values. no special characters,alphabets .
    reply ASAP

    Hi Venuthurupalli,
    As valery has said once you select the value to be of type integer,once you perform an action it will be validated and error message that non numeric characters are there will be shown. If you want to set additional constraints like max value, min value etc you can use simple types for it.
    On the project structure on left hand side under local dictionary ->datatypes->simple types create a simple type of type integer
    The attribute which you are binding to value property ;make its type as simple type which you made
    Hope this helps you
    Regards
    Rohit

  • 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 restrict number of character to be entered in an input field??????

    Hi All,
    I am using the tab phtmlb:formLayoutInputField to define an input field. I need to restrict the end user from entering a maximum of 70 characters(can be any character/number) in the textbox.
    I'll explain in another sentence:::: the end user should be able to enter only 70 characters in the textbox and 71st character should not be allowed to enter. Could anyone please suggest as to how I can achieve this?
    Thanks a lot in advance,
    Best Regards,
    Varun

    Hi,
    We can limit the length of an inputfield by mentioning the maxlength properties of an inputfield.
       <htmlb:inputField   id= "get"
    maxlength="6" />
    This restricts the
    Hope this helps you.
    Regards,
    Rajani

  • Is it possible to restrict the "paste" functionality on a wd input field?

    The requirement I have is not allow to copy and paste a value on a given webdynpro input field. Does anyone know if this is possible? If so, how?
    Thanks in advance,
    Diego

    Hi Yuval,
    not sure about your answer. Does the attribute "readonly" will prevent or will not prevent pasting values? I am not sure about your reply since after your sentence you say "there is not way to restrict user from copying the value....." and that for me reads like "there is no way to prevent from pasting the value ......".
    Please advice and thanks in advance,
    Diego.

  • Restrict Input Field For Fix Length

    I want to restrict the input field to 10 chars.
    Both JTextField + PlaintDocument or JFormattedTexTField + MaskFormatter can do that.
    So, I want to know which one is much better.
    Thank you!

    I, personally, prefer the approach via PlainDocument. The thing about JFormattedTextField is that it's giving a pretty bad user feedback as it allows entering the text and then rejects it when losing focus. With subclassing PlainDocument you ensure the user won't enter more than 10 characters in the first place.

  • Restrict multiline input field to 2 lines?

    Is there a way to restrict the amount of lines that a
    multiline input field will allow?

    Double post

  • Restricting a user to enter fixed characters in an input field (mobile)

    Hi All,
    I have created a simple type and set its length to some fixed characters. I have mapped this simple type to an input field. When I run this application on desktop it doesn't allow the user to enter characters more than the fixed length of the simple type. But this functionality is not available on the mobile ie. when I try to enter some text in the input field on the mobile device it allows me to enter as many characters as I want and the fixed length property of the simple type doesn't work here. Can anyone suggest me a solution for this. Reply ASAP.
    Thanks in advance,
    Murtuza

    padma,
    You have to set it in the wdDoModifyView()
    if ( firstTime )  {
    IWDInputfield inp_field  = (IWDInputfield) view.getElement("<inputField_ID>");
    inp_field.requestFocus();
    regards,
    nikhil
    xxxxxxxxxxxxxxx
    Edited by: Armin Reichert on Feb 23, 2008 6:29 PM

  • How to restrict AS02 access to certain fields only

    How to restrict AS02 (Asset Master Record) access to certain fields only. Currently when you assigned AS02 to a certain user, this will enable the user to change all the fields in the asset master record. Suppose i want only the user to restrict the access to certain field eg.NDJAR (Life in Yrs).
    Thanks for your inputs.
    Regards,
    Robert

    hello,
    basis has to assign the proper activity with object A_S_ANLKL. in this case they have to allow activity 03 only with combination of Cocode,asset class. see some more details below.
    This authorization object is the first part of the object "asset master record."
    The definition at this level determines whether the user is authorized to process data in a given company code. The activity type for the transaction is also defined here. This authorization object is used for master data transactions, for the display of value fields, and for reporting.
    Defined Fields
    The following fields are assigned to the authorization object
    Asset class (specified by entering a value in the pop-up window)
    Company code (specified by entering a value in the pop-up window)
    Activity type - there are three different activity types:
    01 = Create
    02 = Change (including blocking and deleting)
    03 = Display

  • The list doesn't appear in the input field

    Hi All
    The list doesn't appear in the input field when I make input or press the BACKSPACE key.
    Notes:
    I made this modifications:
    1. In connection properties I set High speed connections (LAN)
    2. In local data settings I set the historial to ON
    we had SAPGUI 620 in workstations and now we have installed SAPGUI 710
    Thanks for your time and help
    Message was edited by:
            Genner Sanchez

    Hello Genner,
    see note 399180:
    o  FIELD NAME LENGTH
       The history is only written for field names with a maximum length
       of 40 characters. In earlier SAP GUI versions, this length was
       restricted to 30 characters. The history file must be deleted to
       achieve extended support.
    o  FIELD LENGTH
       If the length of the input field is 60 or more characters,
       history is not written either. "Input field length" refers to the
       dictionary length of the field, not to the "visible length" on
       the screen. (The restriction of the input data to 60 characters
       results from the fact that text editors were often built as lists
       of text fields with a length of 60 in the past. In those editors,
       this history was quite annoying.  On customer request, this was
    Regards, Martin

  • Custom Exit Button not working..looks for required input field on screen?

    I defined this EXIT button as type E in Menu Painter.
    I am using "MODULE At EXIT-COMMAND" in my PAI.
    SAP message still asks for the required input field when I select the function EXIT button?
    The logic still will not break into the At EXIT-COMMAND of my PAI?
       Thank-You.

    Hi
    Have you assigned variable OK_CODE in the list of screen element?
    IF NOT zin_railid is initial.
        LEAVE TO SCREEN 0100.
    ENDIF.
    Which is the sense to create a button for exit-command and doesn't allow the exit if the input field is empty?
    In SE41 I entered "Back" over the back button, "EXIT" over the exit button, and "CANCEL" over the cancel button.
    I selected each one, and got a popup to enter "E" for each type. As I said they appear, but do nothing?
    Did I need to set a status for these?
    No you don't, it's only important to define a functional having the attribute for EXIT-COMMAND
    Max
    Max
    Edited by: max bianchi on Nov 5, 2010 6:31 PM

Maybe you are looking for

  • Cisco Jabber client to support Multiple e-mail domains

    Hi All, Per the following link, CUCM an IM&Presence starts supporting multiple domains at version 10: http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/rel_notes/10_0_1/delta/CUCM_BK_C206A718_00_cucm-new-and-changed-1001/CUCM_BK_C206A718_00_cuc

  • Unable to insert earphones jack in the audio port

    I am unable to insert the earphoen jack completely into the audio port.

  • Copy database structure but not the data

    I'm looking to create a new version of a database but with completely reloaded data - so I want to retain the database structure but none of the data. Is there an easy way (read: without a DBA on staff) to copy an existing database structure - prefer

  • Java.lang.Runtime()

    I made a small addition program using 'C'. It accepts 2 no.s and produces the result. how can i send the 2 no.s to the C program? Here is the code i tried: Runtime r=Runtime.getRuntime(); Process p=r.exec("add.exe"); InputStream ios=p.getInputStream(

  • Apex on Sourceforge!

    Just ran into Scott's recently blog entry about Apex on Sourceforge! http://spendolini.blogspot.com/2006/04/apex-open-source-applications.html http://sourceforge.net/projects/oracle-apex/ http://apex.oracle.com/pls/otn/f?p=45326:107 Looks like this i