on 11-01-2013 8:58 AM
Dear All,
I have the UDF error in the Message mapping it doesn't tranform the values finally mapping failing
Input values are
TYPE = E
MESSAGE = Order129602 and JobID28948 with Material000000000000000468 - Returned Quantity exceeds Shipment Quantity !!
UDF:
import com.sap.aii.mapping.api.*;
public void throwAlert(String[] type, String[] message, ResultList result, Container container) throws StreamTransformationException{
String outputStr = "";
Map map;
String filename = "";
MappingTrace importanttrace = null;
/***** Concatenating all the error messages *****/
for ( int i = 0; i < type.length; i++ )
{
if (type[i].equals("E")){
outputStr = outputStr + " " + message[i];
}
}
try{
map = container.getTransformationParameters();
importanttrace = container.getTrace();
// Get the Filename.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
filename = conf.get(key);
createAlertMessage.throwAlert(": Shipped Tool List Execution Error",outputStr,filename,map,"TCTP001A3_STL_001");
}
catch(Exception e){
importanttrace.addWarning("Error In UDF throwAlert " + e.getMessage() );
throw new RuntimeException(" Runtime Exception thrown",e);
// System.out.println(e.getMessage());
// throw new RuntimeException(" Error Occured In UDF",e);
}
result.addValue("");
}
Could you please suggest me where it was wrong?
Thank you.
Sateesh
Hi Sateesh,
I don't see a problem with the code other than the definition of class for createAlertMessage. I assume it is an object handler. How you imported the relevant classes in the UDF?
Does this code compile?
In debug trace, where do you see the code execution failing ?
Hope it helps!
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satish,
Adding to the Indrajit suggestion please also check length of message[i] in below loop.
for ( int i = 0; i < type.length; i++ )
{
if (type[i].equals("E")){
outputStr = outputStr + " " + message[i];
}
Regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sateesh
In your udf I can see this line
createAlertMessage.throwAlert(": Shipped Tool List Execution Error",outputStr,filename,map,"TCTP001A3_STL_001");
where is the defination of the function createAlertMessage ??
Also change the line
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
Remove the space infront of container.
Also remove the line
throw new RuntimeException(" Runtime Exception thrown",e);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.