Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

Re: how to change the delimiter in output file

$
0
0

Sarjana,

 

Use FCC in sender channel to convert CSV to XML then one-to-one graphical mapping (mapping not required) then in receiver channel FCC XML to text file (; delimited).

 

OR.

 

1. Follow "Steps in ESR" mentioned in Link (As Hareesh mentioned)

2. Create Java Mapping.

3. Remove SWCV (as input is non XML- CSV).

ICO.PNG

package com.javaMapping;
import java.io.*;
import com.sap.aii.mapping.api.*;
public class WellformedXML_JavaMapping extends AbstractTransformation {    @Override    public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException {        try {            InputStream inputstream = transformationInput.getInputPayload().getInputStream();            OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();            // a) Copy Input content to String            byte[] b = new byte[inputstream.available()];            inputstream.read(b);            String inputContent = new String(b);            // b) Replace all , with ;            inputContent = inputContent.replaceAll(",", ";");            outputstream.write(inputContent.getBytes());        } catch (Exception exception) {            getTrace().addDebugMessage(exception.getMessage());            throw new StreamTransformationException(exception.toString());        }    }
}

How to create Java Mapping in SAP PI / PO


Viewing all articles
Browse latest Browse all 8581

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>