2007 May 24 11:32 PM
I would like to know , is there any FUNCTION MODULE to remove special characters in the text. or ANY code.
Ex : GV_TEXT = 'FINA#N#CIAL S#TATUS'.
but i want to display "FINANCIAL STATUS'..
please help me in this, it would be great help full and gr8 rewrdable.
Krisna
I would like to know , is there any FUNCTION MODULE to remove special characters in the text. or ANY code.
Ex : GV_TEXT = 'FINA#N#CIAL S#TATUS'.
but i want to display "FINANCIAL STATUS'..
please help me in this, it would be great help full and gr8 rewrdable.
Krisna
2007 May 24 11:38 PM
Hi,
Please try this.
TRANSLATE GV_TEXT USING '# '.
CONDENSE GV_TEXT NO-GAPS.
Regards.
Ferry Lianto
2007 May 24 11:42 PM
HI,
TRANSLATE GV_TEXT USING ' _'.
TRANSLATE GV_TEXT USING '# '.
CONDENSE GV_TEXT NO-GAPS.
TRANSLATE GV_TEXT USING '_ '.
Ferry: it seems it becomes FINANCIALSTATUS.
Regards
SAB
2007 May 25 12:05 AM
Another method:
replace all occurences of '#' in gv_text with ''.
Regards,
ravi
2007 May 25 12:44 AM
There is no function module to do that. This may be the tab special character that you are seeing as a #. So use a combination of REPLACE and CONDENSE.
[code]
REPLACE ALL OCCURRENCES OF space IN gv_text WITH '$'.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>HORIZONTAL_TAB IN gv_text WITH space.
CONDENSE gv_text NO-GAPS.
REPLACE ALL OCCURRENCES OF '$' IN gv_text WITH space.[/code]
2007 May 25 8:47 AM
Hi krisna,
U can do this as follows
Sample Code 1:
DATA:
w_char(30) TYPE c, Provide the string here
w_key(30) TYPE c,
w_len TYPE i,
w_ind TYPE i.
w_key = '~!@#$%^&*()_+|}{":?><,/;[]\=-'.
w_len = STRLEN( w_key ).
DO w_len TIMES.
w_ind = sy-index - 1.
REPLACE ALL OCCURRENCES OF w_key+w_ind(1) IN w_char WITH ''.
ENDDO.
WRITE:/ w_char.
Sample code2:
DATA:
w_char(20) TYPE c, Provide the string here
w_char1(20) TYPE c,
w_len TYPE i,
w_ind type i.
w_char = 'A@Cd*K!()A'.
w_len = STRLEN( w_char ).
DO w_len TIMES.
w_ind = sy-index - 1.
IF w_char+w_ind(1) CO sy-abcde.
concatenate w_char1 w_char+w_ind(1) into w_char1.
ENDIF.
ENDDO.
WRITE:/ w_char1.
Restriction for the sample code 2 is that the numeric values is not possible.
2007 May 25 8:54 AM
hi krisna,
REPLACE ALL OCCURRENCES OF ' # ' IN gv_text WITH no-space.
if helpful reward some points.
with regards,
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |