on 05-29-2007 5:39 PM
Hi All,
I have a source file which is dynamic all the time. Can I create a target file which has the same name as the source file but with a different extension.
Scenaio is file to file.
test. xml is the source file name and the target file name should be as test.csv
Regards,
Amar
Hi Amareshwar,
you can write a java code (either in UDF or import in imported archive and use in imterface mapping).
The piece of code is..
DynamicConfiguration conf = (DynamicConfiguration) myParam.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey Filekey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String OriginalFileName = conf.get(Filekey);
if (OriginalFileName != null)
{
NewFileName=OriginalFileName.replaceAll(".csv",".txt");
conf.put(Filekey,NewFileName);
}
And in Integration Directory>Configuration Scenario>your communication channels (both sender and receiver) just select
Adapter specific message attributes- File name
This would solve your problem.....
Regards,
Vishal Gupta
Plz reward points if you are satisfied with the solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nemalikanti,
Yes you can create. Get the filename using this weblog. Then you use the variale substitution for the filename. In your receiver file adapter then put the filename as <b>%var1%.csv</b> where var1 is the variable substitution for the filename.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You should create the UDF function and pass this value to the last field in your target. Also you dont use this field in your content conversion.
Then you use this field in your variable susbtituion. Check this weblog on this:
/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
---Satish
Amar,
<i> I have a source file which is dynamic all the time</i>
What does it mean, could you please explain. Is it the source structure is always dynamic or the data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Assuming your scenario is file-2-file, you have 2 preferable options:
1. use dynamic configuration in mapping to change the file extension to .csv (make sure to check ASMA+filename in the receiver adapter). Check Michal's blog for reference: /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 (but you don't need to do the filename in payload part, just the UDF + ASMA options in adapters);
2. use dynamic configuration module (with a dummy header field holding your filename) + variable substitution to read this header field into the file name. Check Jin Shin's blog for further information: /people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean
Option 1 is preferable if you already have a message mapping in your scenario. If you don't have any mapping programs, use option 2.
Regards,
Henrique.
User | Count |
---|---|
84 | |
24 | |
11 | |
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.