Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

no special characters

Former Member
0 Kudos

hye techies...

i have a field which is of string type.. it should not have only special character. Later after there is a nuemric or an alphabet, space and . can be allowed. Please help me with the code.

Thanks

Imran.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
IF LV_STRING CA '`~!@#$%^&*()_+=-:;><,.?"\|}{[]'.
* ERROR
ENDIF.

Put as many speccial characters as possioble and make your code more safe :).

Aman

3 REPLIES 3

Former Member
0 Kudos
IF LV_STRING CA '`~!@#$%^&*()_+=-:;><,.?"\|}{[]'.
* ERROR
ENDIF.

Put as many speccial characters as possioble and make your code more safe :).

Aman

Former Member
0 Kudos

Hi IMRAN PASHA,

There is another way, just check whether it contains only

numeric or numbers or sapce.



  CONCATENATE SY-ABCDE '0123456789' INTO V_PATTERN
                SEPARATED BY SPACE.
  CHECK V_STR CO V_PATTEN.

Here, the variable V_STR contains the value to be checked.

the variable V_PATTERN can be string.

Regards,

R.Nagarajan.

Former Member
0 Kudos

Sorry i misunderstood your question. My previous answer is not correct.

In the above reply make sure u have SY-ABCDE converted to lower case as well. By default its in Upper case.

A