2014 Sep 17 12:06 PM
Hi,
I have this simple ABAP report that it supposed to print out on the screen a message if a string input contains a non-numeric symbol. I use regex '[^0-9]' in order to do that. However, the program never ends up setting sy-subrc to 0, so it never finds a non-numeric symbol in string. Is there something wrong with my regex?
REPORT Z_SAMPLE.
data: input type c length 4 value '123a'.
find first occurrence of '[^0-9]' in input.
if sy-subrc = 0.
Write: 'Found non-numeric character in ', input, /.
endif.
Thanks in advance
2014 Sep 17 12:16 PM
2014 Sep 17 12:16 PM
2014 Sep 17 12:25 PM
Hi, Jake!
Tomas is right
Please, refer to the document and you'll start using \D instead of your regex.