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: 

Removal of invalid characters

0 Kudos

Hi,

I am getting invalid characters from different system into R/3.IT is showing the invalid character as # or space

I have used this code to replace it with space

TRANSLATE field TO UPPER CASE.

IF field CA '@!#'.

REPLACE '@' WITH space INTO field.

REPLACE '!' WITH '1' INTO field.

REPLACE '#' WITH space INTO FIELD.

CONDENSE FIELD.

ENDIF.

but it is not working because the actuall field is not # or space it is something other than those since the system did not recognis it is showing as such. Some characters are like ά u0161 ų č ù á .

How can i code this . Please suggest

5 REPLIES 5

Former Member
0 Kudos

This are Eastern European Characters and if your system is Unicode and transfering system is not unicode then this charaters appears with "#".

If you are using Open dataset statement to get data in SAP, then plz check the extension code page for the Open dataset.

If you are using Portal to get data in SAP, then plz check the Portal code page

former_member536879
Active Contributor
0 Kudos

Hi,

For doing this the variable must be C,N,D,T Types.

1) CO

2) CN

3) CA

4) NA

5) CS

6) NS

7) CP

😎 NP .

The above listed are the Comparison Operator. Hope any one of this will solve ur problem

With Regards,

Sumodh.P

Edited by: Sumodh P on May 10, 2010 2:19 PM

Edited by: Sumodh P on May 10, 2010 2:27 PM

kesavadas_thekkillath
Active Contributor
0 Kudos


replace all occurrences of regex '[^[:alnum:]]' with ` `.

or

replace all occurrences of regex '[^[:alnum:]]' with space.

Edited by: Keshav.T on May 10, 2010 3:31 PM

Edited by: Keshav.T on May 10, 2010 3:31 PM

Former Member
0 Kudos

@Keshav: I don't think the use of replacing any non \[:alnum:\] characters is the right approach; this depends of course on the requirements, but a simple dash "-" would then also be replaced by a space. Also, your expression should actually read \[^\[:alnum:\]\].

@Ravi: You might want to check if you really want to kill any of those special characters by overwriting them with a space. I personally doubt that this is the right approach. Instead you might want to look at function module SCP_REPLACE_STRANGE_CHARS, e.g. see also this thread . This way you'd at least retain something that's closer to the original text...

Cheers, harald

0 Kudos

Hi Harald,

Thanks

Its a formating problem