on 06-12-2007 4:17 PM
Dear All,
I am facing a scenario, which wants to change the CONVERSATION_ID based on one field of the source Message in Message Mapping dynamically, is it possible to change the CONVERSATION_ID in the User Defined Function? If it is possible, could anyone help me to give me some sample code? Or is there any other way to handle this situation?
Thanks and Regards,
Nick
Nick ,
I never tried this, can you please try the below UDF and lemme know it.
Get the input field and map to the root node of target element.
Select the UDF as Context with one input value.
java.util.Map map;
map = container.getTransformationParameters();
String test = (String) map.put (StreamTransformationConstants.CONVERSATION_ID,<b>input</b>);
result.addValue("");
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Raj,
Thank you very much for your suggestion, but it fails. I got an error with Error Category - MAPPING and Error Code - EXCEPTION_DURING_EXECUTE, detail error message in sxmb_moni:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- Request Message Mapping -->
<SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30"xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>Application</SAP:Category>
<SAP:Codearea="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>com/sap/xi/tf/_MM_File_to_MQ_</SAP:P1>
<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
<SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
<SAP:P4/>
<SAP:AdditionalText/><SAP:ApplicationFaultMessage namespace=""/>
<SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_File_to_MQ_: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
Do you have any suggestion?
Thanks and Regards,
Nick
Nick,
There may be something wrong in your udf.
Just you create a Value UDF with no input variables. Then you import java.*; and put this code:
String constant;
java.util.Map map;
map = container.getTransformationParameters();
constant = (String) map.get(StreamTransformationConstants.CONVERSATION_ID);
return constant;
If you need some help on this function check this michals weblog:
/people/michal.krawczyk2/blog/2005/02/25/simple-java-code-in-graphical-mapping--xi
http://help.sap.com/saphelp_nw04/helpdata/en/6e/ff0bf75772457b863ef5d99bc92404/content.htm
---Satish
Nick,
<i>which wants to change the CONVERSATION_ID based on one field</i>
Here what is conversation_id? From what I understand is you have field in the target which has different values based upon the input. If this is so then you can achieve in graphical mapping using If then else along with exists function or by writing a UDF.
Can you please let us know some more details?
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.