11-16-2007 5:39 AM
Hello friends,
does anyone know of any function module by which we can count the number of digits in a field.
Say i have a priority field which is numc2, and the the user fills in a 5 digit number in it, i was to calculate this and raise an error if the number of digits is more than 2.
Thanks in advance.
charu.
11-16-2007 5:41 AM
Yes you can use the STRLEN syntax.
DATA: L_LEN TYPE I.
L_LEN = STRLEN( L_VAR ).
Regards,
Naimesh Patel
11-16-2007 5:42 AM
data : text(10),
len type i.
text = <your variable which user is passing>
len = strlen( text ).
if len gt 2.
message 'Length incresed' type 'E'.
endif.
regards
shiba dutta