on 12-15-2011 5:49 AM
Hello every one,
I have just built a file to file interface and tested it its fine but i have got a small isuue with my file naming convention, here is the requirement
For the naming convention of the source file, we will use AckDelPre_CCYYMMDD-HHMMSS.csv
For the naming convention of the target file, we will use AckDel_CCYYMMDDHHMMSS.xml, what my doubt is how do i name the file, i mean the target file is autometically saving like this AckDel_CCYYMMDD-HH-MM-SS.xml, what should i do
My question might be dumb, but please pardon me i am really new to PI
HI,
naming convention of the source file, we will use AckDelPre_CCYYMMDD-HHMMSS.csv
PI does not accept Special characters like /,,:,*,?,",<,>,|,;,,,=,&,%,[,],#.
Please go through below blog how to use naming conventions in PI,
regards,
ganesh.
Edited by: ganesh.nijampudi on Dec 15, 2011 7:11 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Sorry for pervious post.
by using ASMA properties you can acheive this,
try {
String filename = "";
String timestamp = "";
DynamicConfiguration conf1 = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","SourceFileTimestamp");
filename = conf1.get(key1);
timestamp = conf1.get(key2);
filename = filename.replaceAll( ".txt" ,"_" );
filename = filenametimestamp".xml";
conf1.put(key1,filename);
return filename;
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
regards,
ganesh.
you need to go for dynamic configuration UDF in mapping level to assign your target file name as per your requirement.
search in sdn. you will find code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use Dyanmic configuration UDF for the file name
AckDel_CC is the constant
YYMMDDHHMMSS can be achevied by currentdate fn(if its system date) or if its a payload value use the specific field and use date trans fn.
Dont forget to tick Adapter Specific message attributes-- File Name in Receiverc omm Channel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
we will use AckDel_CCYYMMDDHHMMSS.xml, what my doubt is how do i name the file, i mean the target file is autometically saving like this AckDel_CCYYMMDD-HH-MM-SS.xml, what should i do
you ned to follow below steps
ESr:
IN Mapping level :
constant(AckDel_CC) + current date(YYMMDDHHMMSS) of date function group -> Concat-> Constant(.xml) -> concat-> Dynamic config(udf)->target.
dynamic config:
String DynamicConfiguration(String a, 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");
conf.put(key,a);
return "";
}
ID:
in receiver communication channel we need to enable ASMA and file name
thabnks,
Edited by: bhavanisankar.solasu on Dec 15, 2011 7:18 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
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.