2007 Sep 24 12:00 PM
Hi,
I have to remove special characters from string and replace it with space.
Kindly help its urgent.
Thanks
2007 Sep 24 12:04 PM
Hi i can explain this with an example.
Write a program to give input as +91-44-42040260, output should be 91 44 42040260.
Ans :
DATA:INPUT(15) VALUE '+91-44-42040260',
STR(4) VALUE '+ - '.
TRANSLATE INPUT USING STR.
WRITE:/ INPUT.
Please reward if helpful.
Hi,
I have to remove special characters from string and replace it with space.
Kindly help its urgent.
Thanks
2007 Sep 24 12:04 PM
Hi i can explain this with an example.
Write a program to give input as +91-44-42040260, output should be 91 44 42040260.
Ans :
DATA:INPUT(15) VALUE '+91-44-42040260',
STR(4) VALUE '+ - '.
TRANSLATE INPUT USING STR.
WRITE:/ INPUT.
Please reward if helpful.
2007 Sep 24 12:04 PM
Hi,
You Can use Overlay command for this.
Syntax
OVERLAY text1 WITH text2 [ONLY pattern].
Effect
Characters in the text1 variable are replaced by characters in the text2 data object which are there in the same location. If the ONLY addition is not specified, all blank characters in text1 are replaced. If the ONLY addition is specified, all characters are replaced that occur in the pattern data object, and upper and lowercase is taken into consideration. If the lengths of text1 and text2 are different, text1 is processed using the shorter length only.
CONSTANTS initial_time TYPE t VALUE IS INITIAL.
DATA: time TYPE t,
text(4) TYPE c.
text = '12'.
time = text.
write : time.
Thanks,
Reward If Helpful.
2007 Sep 24 12:05 PM
declare a constant that has all the special characters like
gc_spl(20) type c value '!@#$%....'
if string CA gc_spl.
string+0(sy-fdpos) = space.
endif.
2007 Oct 12 9:08 AM