on 02-18-2011 12:04 PM
hello Gurus,
i have a problem.
after following the wiky "Different ways to keep your Interface from processing duplicate files " i decided to crate my UDF and put it inside my graphical mapping.
All works fine but in case of duplicate file i have a error in monitor like this:
<SAP:Stack>During the application mapping com/sap/xi/tf/_MM_RTTicket1_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
I would like put a more exaustive text like "file duplicated!!!"
i put this code on end of module:
catch(Exception e){
+ throw new BaseRuntimeException(" file is already processed");+
}
but no result.
any suggestion??
if u want i can send u code of all module
thanks in advance
Alex
You can see your error message only in trace.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello Stefan,
in wich trace? trace in xml monitor?
i checked but i not found my message.
this is my UDF:
String processedFileDatabase = processedFile[0];
String sourceFileName;
DynamicConfiguration attrib = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey fileKey = DynamicConfigurationKey.create("http:/""/sap.com/xi/XI/System/File","FileName");+
attrib.put(fileKey,attrib.get(fileKey));
sourceFileName = attrib.get(fileKey);
File fileDB=new File(processedFileDatabase);
try{
if (!(fileDB.exists() && fileDB.canWrite() && fileDB.canRead())){
+ fileDB.createNewFile();+
}
Vector fileNameList = new Vector();
BufferedReader br = null;
br = new BufferedReader(new FileReader(processedFileDatabase));
String name = new String();
//loop and read a line from the file as long as we dont get null
while ((name = br.readLine()) != null)
+ //add the read word to the wordList+
+ fileNameList.add(name);+
br.close();
boolean fileAlreadyProcessed = fileNameList.contains(sourceFileName);
if (!fileAlreadyProcessed) {
+ Writer output = new BufferedWriter(new FileWriter(new File(processedFileDatabase),true));+
+ output.write(sourceFileName + "\r\n");+
+ output.flush();+
+ output.close();+
}
+result.addValue("" + !fileAlreadyProcessed);+
}
catch(Exception e){
+ throw new RuntimeException(" file is already processed");+
}
Hi Alex,
Ref: http://wiki.sdn.sap.com/wiki/display/XI/DifferentwaystokeepyourInterfacefromprocessingduplicate+files
You would find an UDF in the link.. that might help you.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alex,
Check the blog : /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
This may help you...
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
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.