on 11-01-2011 1:35 AM
Hello All,
I am working on a outbound scenario. As part of the requirement I have to create a file name as below:
Out<2digit month><last 2 digit year>.txt Example: Out0607.txt, taxr0911.txt (this is for September 2011)
And there is no source field has month/year Information. I am using a receiver FTP channel to create file.
Can anyone tell me how can I achieve this
Regards,
Moorthy
Hello,
You should include the month and year in your source message, otherwise, you can only use the date function currentDate in PI and from there substring the month and the year before passing to UDF
Constant:Out -> concat: --------------------------> concat: ----------> concat: ---> UDF -> TargetRootNode
currentDate -> substring: 8,10 -> / currentDate -> substring: 2,4 -> / constant: .txt -> /
Use this code for Simple UDF: argument is input
DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key =DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
conf.put(key,input);
return "";
Afterwards, in your File Receiver CC, make sure that the adapter specific message identifiers are checked and you select FileName.
Hope this helps
Mark
Edited by: Mark Dihiansan on Nov 1, 2011 3:06 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You can create two more temporary variables at target side to store your month and year variable.then using your current date variable and substring store this value into temporary created variable and at the end use this variable in your communication channel file name.
i hope this will work for you.
Thanks
Monica
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.