2008 Mar 18 6:28 AM
hi all,
i'm working on module pool, i got field called Mobile number, whose length is 10 chars.
if the user enters less then 10 chars it should give error, how to accomplish this one.
regards
suprith
2008 Mar 18 6:38 AM
Hi,
Try out this
Parameters : p_num(10) type c.
At selection-screen.
If not strlen( p_num ) EQ 10.
Message 'Please enter 10 digit number' type 'E'.
Endif.
Hope this will help you.
Please reward points if useful.
Regards
Rose
hi all,
i'm working on module pool, i got field called Mobile number, whose length is 10 chars.
if the user enters less then 10 chars it should give error, how to accomplish this one.
regards
suprith
2008 Mar 18 6:30 AM
2008 Mar 18 6:36 AM
2008 Mar 18 6:38 AM
Hi,
Try out this
Parameters : p_num(10) type c.
At selection-screen.
If not strlen( p_num ) EQ 10.
Message 'Please enter 10 digit number' type 'E'.
Endif.
Hope this will help you.
Please reward points if useful.
Regards
Rose
2008 Mar 18 6:43 AM
preethi
thanks preethi, it works.
i may need some more help from u,
can u give me ur gmail ID if any doubt i'll contact u directly
2008 Mar 18 7:01 AM
Hi Suprith,
Sure i will try my best to help u.
Regards
Rose
Edited by: Rose Preethi on Apr 3, 2008 5:02 PM
2008 Mar 18 6:40 AM
Hi,
You can use one of the following function to determine the length of the characters.
strlen
numofchar-Same as for the function strlen, except that in this case when a non-Unicode double-byte code is used, a character that occupies 2 bytes is only counted once.
You can also use Get Cursor..Length Len where Len is of type i.
Regards,
Pavithra
2008 Mar 18 6:41 AM
Find the length of the filed and if its less than 10 trrow the error message also validate the filed only contains numerics.
2008 Mar 18 6:42 AM
Suprith,
data:char(40) type c.
data:v type I.
char = 'SUPRITH'.
v = strlen( char ).
write:/ 'String length is', v.
IF V > 10
give your message here.
endif.
K.Kiran.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |