‎2007 Jul 04 9:17 AM
i hav a requirement where i get an input (character format) from the interface ans i hav to check if its a 8 char long input or a 9 char long input, according to which i need to select data from diff table. how can i do this? kindly help.......useful answer wil surely be rewarded.
‎2007 Jul 04 9:20 AM
hi
basically u need to check the length of the character..which can be achived by using STRLEN command...
data : a type c value 'ABAP', b(10).
b = strlen( a ).
write b.
output will be 4
if helpful, reward
Sathish. R
‎2007 Jul 04 9:20 AM
hi
basically u need to check the length of the character..which can be achived by using STRLEN command...
data : a type c value 'ABAP', b(10).
b = strlen( a ).
write b.
output will be 4
if helpful, reward
Sathish. R
‎2007 Jul 04 9:23 AM
i two fields are character fields , but they hold numbers only.....
can we use str functions on chars........does it need to be declared as String?
‎2007 Jul 04 9:27 AM
hi
s..it's a command used explicitly to perform on character-type fields
from documentation
STRLEN : Returns the length of a character-type field in characters
if helpful, reward
Sathish. R
‎2007 Jul 04 9:22 AM
Hi,
You can do this way:
First declare 2 constants of value 8 and 9.
Then use the STRLEN keyword to get the string length of the input character format and then compare with the consatnts to check if they are 8 or 9 characters in length.
Hope it was useful.
Thanks,
Sandeep.