on 10-05-2008 11:22 AM
Hi,
i have a input field (passport number), The input field should display only 30 chars & the maximum length of input files should be 30 Chars.
i.e. , even though user enters more than 30 chars it shouldn't take.the size of the text in the input field should be less or equal to 30 chars, but shouldn't exceed 30 chars.
i tried giving the value for the property - length to 30 in the layout. but it is not restricting me to 30 chars.
Thanks
Maha
Hi Hussain,
Please follow the following procedure:
In your WD Project, Web Dynpro Explorer, Expand the context "Dictionaries" , You would see Data Types Context, On expanding that, there will be a node: "Simple Types".
Right Click on Simple Types and create simple types.
Give your simple types a name and give it a package, say "com.ls.test".
In the simple type definition, select the built in type, in your case, it would be string. In length constraints, choose the maximum length (In your case, it would be 30). You can even choose a fixed length and minimum length here.
Go back to the view, where you need input field. Create a value attribute of name say "attr_input" In the properties of the value attribute "attr_input", choose the type and click on the browse(...) button. In the dictionary you would see the package that we made "com.ls.test". Expand it and choose the simple types.
Bind this context to your input field. Now, the input field will not take values more than that of 30 char.
I hope this will help you.
In case of any problem, please get back, I'll be happy to help you.
Cheers !!!
Umang
[SAPHCM|www.saphcm.org]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
or else you try by validating that input field at runtime by writing code. In for loop iterator you break letter by letter and keep a counter(i) in for loop and check condition if counter(i)<=30, Use message manager to validate the input field. If you have any doubt regarding Error Messages go through saptechnical.com, where you find a step-bystep procedure blog along with screen shots.
Regards
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maha,
Just go thru this URL. i hope it will help you
http://help.sap.com/erp2005_ehp_03/helpdata/EN/d7/ef8841e3af1609e10000000a155106/frameset.htm
Thanks
Anup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
try with simple type,
define a simple type and set the minimum and maximum length for that simple type.
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.