Skip to Content
-3

How to validate field if it contains a numeric or alphabet or alpha numeric or blank

Mar 22, 2017 at 02:54 PM

67

avatar image
Former Member

Dear all,

I have a internal table it1 with 5 fields, one of the field (Lets say f3 had 4 char). this field contains values like (0001, 01, AB, ABCD, AB01, 01AB). In the next steps, we are comparing the values of this f3 (char4) wa-f3+2(2) = wa-f6 with other field f6 (Char2) in the read statement. My doubt is, it is working fine for all values (0001, 01, ABCD, AB01, 01AB) except AB. for AB, it is giving 00 values. I am not understanding why it behaves like this,?

Please advice or throw some light on it.

Thanks

KRSRCM

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Horst Keller
Mar 22, 2017 at 03:27 PM
0

Debug and look at the (memory) layout of your fields. Check left or right boundness. Read the documentation of the langauge elements that you are using. Consider alternatives as string expressions or regular expressions.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 22, 2017 at 04:48 PM
0

Use regular expressions in ABAP. You can use to decide if your strings agree with a pattern.

In this link you have more details and examples Regular expressions

Share
10 |10000 characters needed characters left characters exceeded