on 02-04-2009 5:52 AM
Hi,
I am trying to check wether file exist in the target folder in my scenario.
I got following java code which is working fine in java environment.
boolean blnFile= false;
AbstractTrace trace = container.getTrace();
try
{
try
{
URL url = new URL("ftp://abdur:abdur@/fin.flg;type=i");
con = url.openConnection();
blnFile = true;
}
catch(Exception e)
{
blnFile = false;
}
if(blnFile == true)
{
trace.addWarning("fin.flg Found !!!");
}
else
{
trace.addWarning("fin.flg NOT Found !!!");
}
}
catch(Exception e)
{
trace.addWarning("FTP Main Function Error.");
}
But when i wrote same code in SAP XI (message mapping under function tab in init function) it is not working . It is always giving file found.
Hi,
i think this behaviour is because the code is excecuted from the PI server, the ftp url is accessable from your computer but not from the server.
btw: The file adapter provides some nice settings to control the process depending from existing files. Please have a look to "Processing Tab Page" in [SAP help: Configuring the Receiver File/FTP Adapter|http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm]
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try including your code in the java mapping itself instead of going for message mapping. Compile your code in a java editor like NWDS and include the .class file in the Interface mapping (zip the class file and include this zip file as Imported Archives and then in the Interface mapping instead of Message Mapping option select the JAVA option and include this imported archive)....hope it helps you ....
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
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.