cancel
Showing results for 
Search instead for 
Did you mean: 

Removing commas before mapping to structure

Former Member
0 Kudos

All,

Is there a standard function to replace commas with spaces in XI? I am interfacing to a third party with a comma delimited file and commas (within descriptions) are throwing the file off.

What are my options? Please help!

Thanks in advance,

Michael

Accepted Solutions (1)

Accepted Solutions (1)

henrique_pinto
Active Contributor
0 Kudos

You mean you have a string data field where you want to replace all commas with whitespaces?

Just use the replaceAll standard function in message mapping (under Text types).

Answers (3)

Answers (3)

udo_martens
Active Contributor
0 Kudos

Hi Michael,

one more option is to use a xsl mapping with function translate:

<xsl:value-of select="translate(current(),',',' ')"/>

Regards,

Udo

Former Member
0 Kudos

Hi Michael,

If you are picking up a file with flat data which has commas in between its values...pick up the values separately giving NameA.fieldSeparator

as',' and then concat these values while sending it from XI to the target system...u can gve a space while concatenating if you like...this way, i think u will avoid the adapter module code...and other complication that would arise due to a module code..

Regards,

Sushumna

bhavesh_kantilal
Active Contributor
0 Kudos

Michael,

I guess you are using the File Adapters COntent COnversion.

Another option would be to use an Adapter Module and in this module write the java code to convert the <i>comma delimited file and commas (within descriptions)</i> into standrad XML.

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3bdc14e1-0901-0010-b5a9-a01e29d75a6a">How to create Modules for the J2EE Adapter Engine</a>

Regards,

Bhavesh