Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Special Characters in Text

Former Member
0 Kudos

I am fetching Job Description from IT-1002 using the FM HR_RU_GET_DETAIL_DESCR. However, this text contains some special characters like 'Ãu02DC' and § etc. These characters are present in the infotype itself (can be viewed through PO13).

I do not know what these special characters can be but I need to remove them from the text. The text is in an internal table in multiple rows. Is there any FM to remove such special characters?

Please help.

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

loop at itab into wa.
li_index = sy-tabix.
REPLACE ALL OCCURRENCES OF REGEX '[^[:alnum:]]' IN wa-line WITH space.
condense wa-line.
modify itab index li_index from wa transporting line.
endloop.
6 REPLIES 6

kesavadas_thekkillath
Active Contributor
0 Kudos

loop at itab into wa.
li_index = sy-tabix.
REPLACE ALL OCCURRENCES OF REGEX '[^[:alnum:]]' IN wa-line WITH space.
condense wa-line.
modify itab index li_index from wa transporting line.
endloop.

0 Kudos

That removed some characters, but characters like  remianed. Also, all the spaces were removed. Strange!

0 Kudos

Try this


REPLACE ALL OCCURRENCES OF REGEX '([^a-zA-Z0-9\s])' IN wa-line WITH ''.

0 Kudos

Thanx! That solved the problem. But since I am new to this, would you please explain this regex ? Or perhaps give me a link where I could get some additional information about this?

0 Kudos

But again, we need to retain the punctuation marks. Comma, fullstop, apostrophe etc are also removed by this regex..

I made some modification to this, which seems to work fine:


REPLACE ALL OCCURRENCES OF REGEX '([^a-zA-Z0-9,.''":;\s])' IN wa-line WITH ' '.

Edited by: CuriousLearner on Aug 26, 2010 6:11 AM

0 Kudos

>

> Thanx! That solved the problem. But since I am new to this, would you please explain this regex ? Or perhaps give me a link where I could get some additional information about this?

link:[http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f9cd701-0b01-0010-87b8-f86f9b7b823f]

link:[http://regexlib.com/]

There are lot of stuffs in google regarding this.