on 09-11-2008 4:37 AM
I am doing File->File Scenarios. There is no Recrod set also. I want to rename the file using XI. No mapping required. To rename the File name we can do the coding related to Dynamica configuration in one UDF and will map to the top node of the target. But i don't have the mapping here, So How can i execture this UDF or Do i need to write the Module in File adapter CC.
I tried with dummy mapping , But I am getting the following error
</SAP:Category>
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE
</SAP:Code>
<SAP:P1>com/sap/xi/tf/_MM_Target_File_determined_
</SAP:P1>
<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException
</SAP:P2>
<SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~
</SAP:P3>
<SAP:P4/>
<SAP:AdditionalText/>
<SAP:ApplicationFaultMessage namespace=""/>
<SAP:Stack>During the application mapping com/sap/xi/tf/_MM_Target_File_determined_ a com.sap.aii.utilxi.misc.api.BaseRu
ntimeException was thrown: Fatal Error: com.sap.engine.lib.xml.parser.Parser~
</SAP:Stack>
The mapping part is correct. There is no doubt on that. I don;t know why i am getting this error. Can you please tell me what could be the reason or any solution to resolve my problem.
Hi,
Case 1: If you only want to rename the file then pick the file and rename the file in receiver communicatin channel and write. Check this weblog for some help:
Case 2: If you want to rename the file dynamically then you should do the mapping. Check this weblog for this:
Case 33: If you are picking the file within your organisation which is shared on NFS then you use OS commands in the file adapterd to rename the file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To rename the original file name, you must have MM defined. If you want to just copy the source file name you can do it without MM, just choose the "adapter specific attribute" in file adapter.
Thanks & Regards,
Dijesh Tanna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use Java Mapping instead of GraphicalMapping with UDF.
The purpose of JavaMapping is to bypass the inputstream to outputstream along with Dynamic Configuration code which meant for renaming the picked source file name according your requirement
Code:
import com.sap.aii.mapping.api.StreamTransformation;
import java.io.*;
import java.util.Map;
public class RenameSourceFile
implements StreamTransformation
{
public RenameSourceFile()
{
}
public void setParameter(Map map1)
{
map = map1;
}
public void execute(InputStream inputstream, OutputStream outputstream)
{
try
{
DynamicConfiguration conf = (DynamicConfiguration) param.get("DynamicConfiguration");
DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
ourSourceFileName = conf.get(KEY_FILENAME);
//logic to rename the file name - do it according to your requirement
// put the filename in below statement
conf.put(KEY_FILENAME, "ModifiedFileName");
String s = null;
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream));
StringBuffer stringbuffer = new StringBuffer();
while((s = bufferedreader.readLine()) != null)
outputstream.write(s.getBytes());
}
catch(Throwable throwable)
{
throwable.printStackTrace();
}
}
private Map map;
}
Thanks,
Gujjeti.
Edited by: Praveen Gujjeti on Sep 11, 2008 6:07 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Radhika,
Just try to get the data from the sourse payload in SXMB_MONI,Test it in the Message mapping..
There is some problem with the data you are testing. Please check the data and test it again..
Hope it helps..
Thanks,
kumar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.