cancel
Showing results for 
Search instead for 
Did you mean: 

Validation on extension field for numeric input -Regular expression

08-23-2017 10:31 PM
2306 views 2 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Dear Experts,

We have the requirement where we need to check if input in a extension field of type LANGUAGEINDEPENDENT_EXTENDED_Text contains characters other than the numbers. These other characters can be special characters, digits Etc.

If yes then it should not let the screen to save. For this I know we will have to use regular expression. But I don't know how to do the same and design the regular expression of such kind. Please help!

Regards,

Pragati Verma

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

marlosdamasceno
Participant

Hi Pragati,

You may use the Validation: OnSave event of your object to do this validation. There you can use this code:

if(this.yourField.FindRegex("[^[:digit:]]") >= 0) {
     raise Message.Create("E", "You should use only numbers!");
     return false;
}

If your field was created by screen you may get it using the References to Customer-Specific Fields.


Best regards

Marlos Damasceno

Answers (1)

Answers (1)

srikanthrathod
Explorer
0 Likes

Hi Pragati,

Did you complete your requirement ?

As i have the same requirement and need you help on how did you achieve this.

Regards,
Srikanth Rathod