cancel
Showing results for 
Search instead for 
Did you mean: 

Reg Validations

jnmurthi
Participant
0 Kudos

Hi All,

I need to perform validation for a field which should accept only 10digit numbers.

Is there any facility in webdynpro to read keystrokes, so that the user is restricted to allow only 10 keystrokes in the field.

or

Is there any way of restricting the user not to allow typing any other values other than digits in the field.

Note: The field comes from a BAPI and is String Type.

Also, while validation date input field, I need to validate the format(i.e.,it should be of dd/mm/yyyy). Is there any simple way of validating the date format.

Please do help me regarding this.

Regards,

Murthy.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

To control the field length to ten

1.Create a simple type in dictionary say "input10"

2.In definition tab,Specify maximum length as 10

3.For inputFiled context variable, assign the type as "input10"

To make date field in dd/MM/yyyy format

1.Createa simple type in dictionary say "formattedDate" with builtin type as date

2.In Representation tab, enter format as dd/MM/yyyy

3.For dateFiled context variable, assign the type as "formattedDate"

4.while creating the action to submit, make sure that "without validation" box is not checked. If action is already created, u can check this by checking the action tab

Regards

Fahad Hamsa

jnmurthi
Participant
0 Kudos

Hi Fahad,

The first one regarding the length of input field is working.

But, the one with date is not working. No validation is being done.

Actually, according to one of the replies of my question the date field is automatically being validated, except that it is giving exception in German.

But, according to the steps, that you have suggested, the validations are not done, the screen is navigating to the next page without giving any exceptions.

Is there anything that I need to do apart from the steps that you have suggested in here for me regarding the date field? If so please do inform me

Regards,

Murthy.

Sharadha1
Active Contributor
0 Kudos

Hi ,

to validate the date format automatically, bind a variable fo type 'Date' to the input field.Webdynpro performs the check automatically i this case.

Regards,

Sharadha

jnmurthi
Participant
0 Kudos

Hi,

You are correct. But when I enter a wrong format, its giving exception in German language. What exactly needs to be done, so that we could raise that exception in english, so that the user could well understand.

Regards,

Murthy.