Tuesday, 26 May 2020

Replace double quotes for CSV files validation issue in SAP CPI

Some tools give a validation error on single double quote like:

123,Bricks measurement 24"/60cm,Erode,TN

where the double quotes cause an issue here.

So  in message mapping, we removed the single double quoted to two double quotes can escape the character.

Groovy Script:

import com.sap.it.api.mapping.*;

def String customFunc(String arg1){

def str2 = arg1.replaceAll("\"","\"\"")

return str2

}
Output:
123,Bricks measurement 24""/60cm,Erode,TN



No comments:

Post a Comment