Application Development and Automation 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: 
Read only

validation of alphanumeric fields

Former Member
0 Likes
643

Hi Experts,

i need to validate the data from the file which is uploaded from the desktop. I have the address field , zipcode and many alphanumeric fields . I tried to use the CO operator which includes numbers from 0-9 , char a-z and wildcard , but i am getting error as the address fields has space in between like 1234 wacker Dr and this is not picking up and also the address field may have capital letters , Please suggest me the good approach to validate the alpha numeric fields . I have about 30 char fields in the file which i need to validate.

Thanks,

Latha

2 REPLIES 2
Read only

Former Member
0 Likes
453

use - sy-abcde

data : l_val(10) type c value '0123456789'.

data : l_abcde type sy-abcde.

data : l_final(80) type c.

start-of-selection.

l_val = sy-abcde.

concatenate l_abcde l_val into l_final.

compare your value with i_final.

Reward Points if it is helpful

Thanks

Seshu

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
453

Try this.



report  zrich_0001.

data: this_value type string.
data: check_str type string.

this_value = 'This is the VALUE that I want to check 12345'.


check_str = sy-abcde.
translate check_str to lower case.
concatenate check_str sy-abcde into check_str.
concatenate check_str ' 0123456789' into check_str.

if this_value co check_str.
  write:/ 'This is ok'.
endif.

Regards,

Rich Heilman