cancel
Showing results for 
Search instead for 
Did you mean: 

need to remove special characters

Former Member
0 Kudos

Hello All

Some input is comming from source field, if any special characters comming from source field, I need remove special characters and send data source to target field. please suggest me how will i do .

Thanks&Regards,

Venkat

Accepted Solutions (0)

Answers (5)

Answers (5)

vijay_kumar133
Active Participant
0 Kudos

Hi venkat.

Use this udf u r issue will be solved..


   //write your code here
    //write your code here
  String str1 = a;

		char[] chr = str1.toCharArray();
		String res = "";
		for(int i = 0; i < chr.length ; i++) {

		if(Character.isLetterOrDigit(chr<i>)){
		res = res + Character.toString(chr<i>);
		}


		}
		//System.out.println(res);

return res;

check this and close it reward points.

Regard

Vijay

Former Member
0 Kudos

Hi

refer

SAP Network Blog: Handling the Special Characters in XI

https://weblogs.sdn.sap.com/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]

*Suppress Special Character *

Thanks

Swarup

Former Member
0 Kudos

HI Gohil

I am working on flat file to flat file. My inputfile having some special character.

ex: input field and value, ordernumber : 234#ABC, i need out put 234ABC. Can you suggest me how can i solve this problem.

Thanks&Regards,

Venkat

nisarkhan_n
Active Contributor
0 Kudos

use the method replaceAll to remove the char you want to

ex: String str= 234#ABC

str.replaceAll("#", "");

Former Member
0 Kudos

Hi Venkat,

input field and value, ordernumber : 234#ABC, i need out put 234ABC

for the above output use function "replaceString" , this will come under function category

Function Category: Text

Usinf this we are getting an out put of $23.00 as $2300 the "." is replaced with empty space.

Note:If this is a special charater you have to change the encoding in the sender file communication channel to the appropiate one., so that '#' can be read and replaced.

Cheers.

Sunil.

Former Member
0 Kudos

If '#' is not your seperator for FCC. then you can use java code given by Nisar during Message Mapping.

Gaurav Jain

Former Member
0 Kudos

Hey,

You can use User Defined Function, for example:

//String message = "post# here@ your s%ou%rce message@###";

public String removeChars(String message,Container container){{

String caracters = "#@%";

for (int x=0;x<caracters.length();x++){

message = message.replaceAll(caracters.substring(x,(x+1)), "");

}

return message;

}

Detail: In example above i am removing the chars # and @ and %, you can add or remove others chars.

I hope help you.

Edited by: João Noberto dos Santos Junior on Jun 11, 2008 11:38 PM

Edited by: João Noberto dos Santos Junior on Jun 11, 2008 11:39 PM

Former Member
0 Kudos

Hi Venkat,

check this thread.

check the document :

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79...

Depends upon encoding methods handling will differ,

you can use ISO-8859-1 or ISO-8859-2 instead of UTF-8 for some special characters.

check this blog:

/people/ulrich.brink/blog/2005/08/18/unicode-file-handling-in-abap

cheers

Sunil

GabrielSagaya
Active Contributor
0 Kudos

Handling the Special Characters in XI

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]

Former Member
0 Kudos

HI,

Can u give me one example what u need to do...

U need to use the UDF for this.

chirag