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: 

Delete all occurances of any character outside a given set in a string

amit_singh20
Explorer
0 Kudos

Hi Experts,

I have a situation in which I have to send a file to some external system.

The file is a fixed length file and I have been provided with the range of

acceptable ASCII character set for the external system, which comprises of

alphabet,digits and specific symbols: '-=\][';/.,!@#$%&*()_{}|:"?<>

If any fiield of the file has any character outside this range, then I have to delete it.

Looking at the huge length of the file.

Please suggest some Function Module or anything that can handle this

scenario without leaving an advese effect on the performance.

Thanks in advance.

Regards,

Amit.

3 REPLIES 3

former_member305388
Active Contributor
0 Kudos

Hi,

Check this FM SF_SPECIALCHAR_DELETE. But it can't delete ][*{}

Just try this once... till you get an exact one..

First use the FM to delete maximum special characters and write some ABAP code for the deletion of the remaining..

Edited by: Srinivas Kalluri on Apr 17, 2009 10:22 AM

Former Member
0 Kudos

hi,

u can search internal table fields other than this '-=][';/.,!@#$%&*()_{}|:"? pattern if u find delete the fields .

use search command or find command it will work .

amit_singh20
Explorer
0 Kudos

Hi,

@Srinivas--> Thanks for your solution , but I have a different situation, I have to exclude all the characters which are not in the range provided. I don't know what are those characters.

@Katigiri---> Thanks for your solution, but using search I can find the known field. Here I have to find all those fields which are not in this range and delete them.

Experts, please suggest me a procedure to find all the fields which are not in this range . So, that I can find them and delete them.