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: 

Removing spcial characters (#) from a file

Former Member
0 Kudos
658

Hello everyone,

I have a program that reads an input file and loads into Z table in SAP. Sometimes I am getting special characters in the file (example shown below) and wondering if there is any FM provided by SAP to clean files. I did research but could not find what I am looking for!

Example of file with special characters:

kostl,zwktran#

13216,Y#

I know I can use "replace" to get rid of special characted "#" but I am looking for something using which I can clean up any special characters before loading the file.

Thanks.

Mithun

3 REPLIES 3

brauliocorrea
Participant
0 Kudos
94

the fm can help perhaps as an example SCP_REPLACE_STRANGE_CHARS

if only # can try REPLACE ALL OCCURRENCES

tks

Edited by: Braulio Correa on Sep 4, 2009 6:15 PM

Former Member
0 Kudos
94

Hi,

After uploading the file to the internal table using any of the upload FM's , loop the internal table to one of the following FM's. That will remove all the special characters in the input file.

1) SF_SPECIALCHAR_DELETE

2) SCP_REPLACE_STRANGE_CHARS

or even with replace this can be used.


REPLACE ALL OCCURRENCES OF REGEX '[^[:alnum:]]' IN lv_text WITH ''.

Regards,

Vikranth

Former Member
0 Kudos
94

Thanks everyone for the help.

Mithun.