on 12-15-2013 11:54 PM
Hi,
I have scenario of SFTP - SFTP.
Receiver wants the file name dynamically like X0000+part of source file name_ datestamp.
I have message mapping, Can someone suggest me how to achive this through UDF of through channel parameters in SFTP receiver channel.
Thanks in Advance
Thanks
Sarada
please refer the below link
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarada,
You can achieve this dynamic file name in meesage mapping by below udf.
1. Create a UDF
2. Set Dynamic configuration checked in Receiver adapter.
UDF:
public String getFileName(Container container, var1 String, var2 String) throws StreamTransformationException{
//For getting filename
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String filename = var1 + var2;
conf.put(key, filename);
Best Regards,
Monikandan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sarada,
The format for DynamicConfiguration:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(String namespace, String TechnicalName);
conf.put(key, String TechnicalNameValue);
Depending on the Adapter Specific message attributes, the namespaces differ e.g for File it is http://sap.com/xi/XI/System/File, for SFTP it is usually
http://sap.com/xi/XI/System/SFTP , same is true with the FileName, the TechnicalName is usually "FileName". The TechnicalNameValue is the value of the FileName in your case X0000+partOfSourceFileName_ datestamp.
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarada,
"Nikhil" reply helps you from the link provided by Mr.Hareesh Gampa.
I suggest you, don't go through entire thread which makes you confuse.
************************************
you can do this in message mapping.
1. Create a UDF
2. Set Dynamic configuration checked in Receiver adapter.
UDF will accept two parameters
public String getFileName(Container container, var1 String, var2 String) throws StreamTransformationException{
//For getting filename
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String filename = var1 + var2;
conf.put(key, filename);
return FileName;}
- Nikhil
**********************************************
Hello Hari,
The reason I used a namespace and a technical name is because it is entirely vendor-specific. For example, we are using Aedaptive SFTP so the namespace would be "http://aedaptive.com/xi" and the technical name for the FileName would be "fileName". Best would be to consult the vendor SFTP documentation for the namespace and technical name.
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.