‎2006 Nov 02 9:04 AM
Hi all,
Is there any function module to find out any special character in a STRING? OR any other method to find a special character???????
points will be rewarded
thanks
‎2006 Nov 02 9:08 AM
Hi,
FCT... i don't know.
you can create a constant contains all special symbol and you can control if string contains one of symbol.
‎2006 Nov 02 9:08 AM
Hi,
FCT... i don't know.
you can create a constant contains all special symbol and you can control if string contains one of symbol.
‎2006 Nov 02 9:10 AM
‎2006 Nov 02 9:12 AM
data: str(100) type c.
data: str_n type string.
data: str_c type string.
data: len type i.
data: ofst type i.
str = '#ABCD%'.
len = strlen( str ).
do.
if ofst = len.
exit.
endif.
if str+ofst(1) co sy-abcde.
concatenate str_c str+ofst(1) into str_c.
else.
concatenate str_n str+ofst(1) into str_n.
endif.
ofst = ofst + 1.
enddo.
write:/ str.
write:/ str_c.
write:/ 'spacial chracter',20 str_n.
‎2006 Nov 02 9:13 AM
HI
good
i dont think the function module can help you to find out any special character in a string, for that you have to write the logic,
try this
get the length of the string,
check each and every character using loop and store in a new character variable .
thanks
mrutyun^
‎2006 Nov 02 9:57 AM
Hi,
store all special characters in internal table
loop at itab.
if string ca itab-char.
write 'special characters'.
endif.
endloop.
Regards
amole
‎2006 Nov 02 10:20 AM
hi jaysree ,
we have answered this query in one of ur posts ..
in that code just include all the special charaters in to a single string and compare .
data : spchar(40) type c value '~!@#$$%^&()?...'etc.
data :gv_char .
data:inp(20) type c.
take the string length .
len = strlen (i/p).
do len times
MOVE FNAME+T(1) TO GV_CHAR.
IF gv_char CA spchar.
MOVE fnameT(1) TO inp2T(1).
ENDIF.
T = T + 1.
enddo.
regards,
Vijay
‎2006 Nov 02 10:27 AM
U can check this ..
REPORT ZEX4 .
PARAMETERS: fname LIKE rlgrap-filename .
DATA: len TYPE i,
T TYPE I VALUE 0,
inp(20) TYPE C,
inp1(20) type c,
inp2(20) type c,
inp3(20) type c.
DATA :gv_char.
data : spchar(20) type c value '#$%^&*()_+`~'.
START-OF-SELECTION.
CONDENSE fname.
len = strlen( fname ).
WRITE:/ len.
DO len TIMES.
MOVE FNAME+T(1) TO GV_CHAR.
IF gv_char ca spchar.
MOVE fnameT(1) TO inpT(1).
ENDIF.
T = T + 1.
ENDDO.
CONDENSE INP.
write:/ 'Special Characters :', inp.
‎2006 Nov 02 10:44 AM
Hi,
You can use SEARCH statement
SEARCH dobj FOR pattern
This statement searches the data object dobj according to the search pattern specified in pattern.