on 06-25-2009 2:13 AM
Hello Experts,
http://help.sap.com/saphelp_nwpi71/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
I need to write a Java mapping class that outputs MessageID, NameSpace, Sender and Receiver Interface etc into log file. I was able to figure out how to push this information into log viewer by using Java Mapping API (SAP NetWeaver 2004 und 7.0) Link:[http://help.sap.com/saphelp_nwpi71/helpdata/en/43/a6ec37a9151bbce10000000a1553f7/content.htm]
But, I need to access mapping program parameters using code on this page Link:[http://help.sap.com/saphelp_nwpi71/helpdata/en/43/bc2fd4da1e1bbce10000000a1553f7/content.htm]
The problem is I can't access mapping program parameters usings old API Java Mapping API (SAP NetWeaver 2004 und 7.0). So, I'll have to use the new mapping API Link:[http://help.sap.com/saphelp_nwpi71/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm]. but I haven't found a useful code where I can access MessageID, NameSpace, Sender and Receiver Interface etc using this new mapping API.
Please let me know if you know any blogs or tutorials etc
this link Link:[https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/usingPI7.1APIforJavamapping] talks about why I should use transform(..) new API method instead of execute(..) old API metod. Becauas, I need to use #4 i.e. parameters in the mapping
Thanks for your help.
http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/TransformationInput.html
arg0.getInputParameters().getInputHeader().getMessageId();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Stefan, it worked. So, now I no longer need execute() function.
package helloWorld;
import java.io.*;
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
//1. AbstractTransformation class is imported.
// The associated jar file is: com.sap.xpi.ib.mapping.lib.jar
import java.util.Map;
import java.util.HashMap;
import com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.DynamicConfiguration;
import com.sap.aii.mapping.api.DynamicConfigurationKey;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;
import com.sap.aii.mapping.api. AbstractTrace;
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationConstants;
import com.sap.tc.logging.*; //Standard.*;
import java.util.Map;
import com.sap.aii.mappingtool.*;
import com.sap.aii.mapping.lookup.Channel;
public class helloWorld extends AbstractTransformation implements StreamTransformation {
private Map map = null;
private AbstractTrace trace = null;
private String prName = null; // input parameter from Interface Determination into Operation Mapping
public void setParameter (Map param) {
this.map = param;
if (param == null) {
this.map = new HashMap();
}
}
public void transform(TransformationInput in,
TransformationOutput out)
throws StreamTransformationException {
try {
String paramS = in.getInputParameters().getString("PARAM_S"); // Read my Import parameter from Interface Determination
this.prName=paramS;
String nameSpace = (String) in.getInputHeader().getInterfaceNamespace();
String interface_nm = (String) in.getInputHeader().getInterface() ;
String rcv_name = (String) in.getInputHeader().getReceiverInterface();
String msgID = (String) in.getInputHeader().getMessageId();
} finally {}
}
} //end of class
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.