on 12-07-2009 7:29 PM
Hi All,
We have the following scenario to send files: AS2 Sender --> PI 7.0 --> File. We want the target file to be of the format PO.yymmdd.LA where PO and LA are constant and yymmdd keep changes depending on the current date. How could I get the file name in PO.yymmdd.LA format? I dont see any option in receiver file adapter. Please help.
Thanks in advance.
Thanks,
Riya Patil
you can do this using Java mapping (fine name change) with Dynamic Configuration in Adapter level.
Regards,
Senthil Nattamai Sekar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
public String targetFileName(String Sono, String Div, Container container) throws StreamTransformationException
{
DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String MyFileName = sono + div + "<filename>"+".xml";
conf.put(key, MyFileName);
return MyFileName;
}
Regards
Ivan
Hi,
This is the javamapping
public class mymapping implements StreamTransformation {
/**
* List of runtime parameters
*/
Map param=null;
/**
* Set the runtime parameters
* @param map new runtime parameters
*/
public void setParameter(Map map) {
param = map;
if (param == null) {
param = new HashMap();
}
}
/**
* Principal method of the javamapping. It executes the transformation, adds information to message tracking and changes the name of the output file.
* @param in Input content
* @param out Output content
* @throws com.sap.aii.mapping.api.StreamTransformationException mapping error
*/
public void execute(InputStream in, OutputStream out) throws StreamTransformationException {
//your code here
String newFileName = "mycustommfilenamel";
DynamicConfiguration conf = (DynamicConfiguration) param.get("DynamicConfiguration");
DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(KEY_FILENAME, newFileName);
// </editor-fold>
}catch(Exception e){
throw new StreamTransformationException("Error during the mapping: " + e.toString());
}
}
}
Regards
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.