on 03-28-2013 8:28 AM
Dear All,
we have a requirement, where the file should be saved with date, without time stamp.
im using PI 7.3 ehp1, i have used file construction mode as ADD Time Stamp. as we know, it will save the file in YYYYMMDD HH:MM:SS format.
so how can i save the file with date.?
Hi,
Use dynamic configuration:
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
var_Filename = conf.get(key) + date in desired format;
conf.put(key, var_Filename);
Regards,
Beena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try the below code.
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
//get current date
Date date = new Date( );
var_Filename = conf.get(key) + dateFormat.format(date);
conf.put(key, var_Filename);
Thanks,
Satish
Hi all,
thanks for the inputs..
with the help of this website http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272171407
i have used variable substitution, it is showing the error as var1 is not found in message payload.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can achieve your requirement in 3 ways.
1)Dynamic configuration UDF.
2)Custom module in receiver file adapter.
3)OS based command in receiver file adapter.
1)If you are doing any transformation in PI .then choose this option.You can use the code provided by satish.
2)If you are not using any transformation then go with 2nd option.
3)I would recommend not to choose this option as this has some constraints(NFS,Need to make sure no body should delete script file,OS dependent...etc)
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
U have to use DC UDF for the same.
Thanks
Amit Srivastava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.