‎2009 May 11 7:42 AM
Hi,
I have table field of CHAR type.I am validating this field in my program for 'abcdefhijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.But its not working.If I remove the digits , its working fine.I guess I should have taken the field type as STRING.But now the database is not allowing me to change the field type.Please suggest how can I validate this field without changing its type in the database table.
‎2009 May 11 7:45 AM
So what are you trying to validate here and what is not working?
‎2009 May 11 7:49 AM
Hi,
even I had faced the same problem while validating one of the field.....
then I used this statement
DATA: C_STRING(63) TYPE C
VALUE 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.
IF field_name CN C_STRING.hope this works... if not please tell me how it is failing.....
Regards,
Siddarth
‎2009 May 11 7:51 AM
Hi Sunil,
I have a code for validating values from a - z (small) and A - Z (capital).
use the same for your requirement, but dont forget to add the ASCII range from 1 to 9 also in my code..
l_partner_name = wa_input-value.
l_length = STRLEN( l_partner_name ).
l_count = 0.
DO l_length TIMES.
CALL FUNCTION 'URL_ASCII_CODE_GET'
EXPORTING
trans_char = l_partner_name+l_count(1)
IMPORTING
char_code = l_asc.
l_hex = l_asc.
l_dec = l_hex.
IF l_dec EQ 32 OR l_dec
BETWEEN 65 AND 90
OR l_dec BETWEEN 97 AND 122.
l_count = l_count + 1.
ELSE.
l_split = l_partner_name+l_count(1).
EXIT.
ENDIF.
ENDDO.
Regards,
Amit.