on 08-30-2007 12:54 PM
Hi All:
I have a scenario where I am want to use Java Mapping.
Input Data :
Fname
Mname
Lname
EmpNo
DOB
Output Data:
Employee (Only one filed with type Sting.)
With the help of Java Mapping I need to concatinate all the input fields and want to assign/map it in filed called Employee (singel target field)
Can any one let me konw what are the basics steps for it?
Thanks & Regards,
Farooq.
You can do:
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationConstants;
/**/
public class JavaMapping
implements StreamTransformation {
private Map param = null;
private MappingTrace trace = null;
public void setParameter(Map param) {
this.param = param;
if (param == null) {
this.param = new HashMap();
}
}
public void execute(InputStream in, OutputStream out) {
try{
this.trace = (MappingTrace) param.get(
StreamTransformationConstants.MAPPING_TRACE);
//MAKES PROCEDURE TO DO Inputstream to XML Document
//NOW you have an XML -> PROCEDURE TO DO search XML nodes
String prewString = nodeValueA + nodeValueB...
String outString = ("<?xml version="1.0" encoding="UTF-8"?>
" +
"<ns:OUT xmlns:ns10="http://namespace">" +
prewString +
"</ns:OUT>
");
out.write( outString.getBytes());
trace.addInfo("TRACE OK");
}catch (Exception e) {
trace.addInfo("TRACE EXCEPTION:" + e.getMessage());}
// Put this i forgot!
String receiverName = (String) param.get(
StreamTransformationConstants.RECEIVER_NAME);
}
}
null
Message was edited by:
Iñaki Vila (i forgot the final code)
Message was edited by:
Iñaki Vila
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
11 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.