This blog will complement other blogs on 'Java Mapping' in SCN.
Direct link: How to create Java Mapping in SAP PI PO - YouTube
Sample Java Mapping used in the video: -
package com.map;
import java.io.*;
import com.sap.aii.mapping.api.*;
public class Test_JavaMapping extends AbstractTransformation {
@Override
public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException {
try {
InputStream inputstream = transformationInput.getInputPayload().getInputStream();
OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();
// Copy Input content to Output content
byte[] b = new byte[inputstream.available()];
inputstream.read(b);
outputstream.write("Prefixing this line to input. Test_JavaMapping. \r\n".getBytes());
outputstream.write(b);
} catch (Exception exception) {
getTrace().addDebugMessage(exception.getMessage());
throw new StreamTransformationException(exception.toString());
}
}
}
Sample text file used in the video:-
Name,ID,Phone
AAAA,11,123456789
世界,22,987654321
BBBB,33,777777777
Helpful links: -
NWDS Download Links - Java Development - SCN Wiki
SAP Support Portal S user id is required to download NWDS.
JAVA Mapping - Managing Services in the Enterprise Services Repository - SAP Library
PI Mapping and Lookup API - SAP Javadocs
Trail: Java API for XML Processing (JAXP) (The Java Tutorials)
Dynamic file name for pass-through scenario - Process Integration - SCN Wiki
Multi-Mapping using Java Mapping - Process Integration - SCN Wiki
Java Mapping in Exchange Infrastructure (download the mwv file).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |