2014 Aug 29 7:10 AM
Hello expert,
have an input field which should accept only letters, '.' and space (see image below). here is my code so far.
FIND FIRST OCCURRENCE OF REGEX '[^a-zA-Z]*' IN makt-maktx.
IF sy-subrc = 0.
MESSAGE e012.
ENDIF.
makt-maktx is the field on screen.
Help please
2014 Aug 29 7:49 AM
2014 Aug 29 8:11 AM
I don't understand your question, the code you have does what you ask so where is the issue?
2014 Aug 29 8:19 AM
2014 Aug 29 8:30 AM
Ok. I don't understand regex so well, was just trying to find out exactly why. As they only want to allow letters '.' and space, and the code pasted returns subrc = 0, so i assumed it was fine.
Hopefully i will learn something from this post.
2014 Aug 29 8:15 AM
Hi Hassim,
please try this:
'^[a-zA-Z/s/.]+[/s]*$'
or
'^[a-zA-Z]+[a-zA-Z/s/.]+[/s]*$'
Regards,
Klaus
2014 Aug 29 8:19 AM
2014 Aug 29 9:42 AM