on 11-08-2013 12:47 PM
Hi Experts
I have the below UDF to set the date time stamp on the filename
String filename1 = "";
try {
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
SimpleDateFormat dateformat = new SimpleDateFormat("yyyymmddHHmm");
String timestamp = dateformat.format(new Date());
if ( UseTimeStamp == "X" ) {
filename1= Filenamepart + timestamp + "." + Fileextension;
}
else {
filename1= Filenamepart + "." + Fileextension;
}
conf.put(key, filename1);
} catch(Exception ex){}
return filename1;
However a very weird observation is that in Development system the file name comes out correctly - with today's date but in Production system the file name is wrong - i.e filename in Development system is ABC201311081202.txt while in Production it is ABC201302081320.txt
I have an issue with the date being wrong - the 4 chars of time do not matter much.
Any help on this is appreciated.
Girish,
SimpleDateFormat dateformat = new SimpleDateFormat("yyyymmddHHmm");
should be
SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMddHHmm");
Regards,
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Your date format is not defined correctly, you should use "yyyyMMddHHmm" instead.
MM is for Month
mm is for minutes
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satish,
See Javadoc: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
Regards
Mickael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Girish,
Check your PI system time once. I think the system might be put as wrong. UDF is taking PI system Current Date & Time.
Thanks,
Satish.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.