on 12-21-2009 3:07 PM
Hi experts,
i have the following scenario : file to file with no mapping
the only requirement is that if the file name from the source is lets say XXX then the output name should be abc and if the source file is YYY then it should be def
can i do that in 1 scenario?
Thanks a lot
any help would be greatly appreciated
Jamal
the only requirement is that if the file name from the source is lets say XXX then the output name should be abc and if the
source file is YYY then it should be def
AnySourceNode --> DynamicUDF --> AnyTargetNode
DynamiUDF will be:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String SourceFileName = conf.get(key);
if (SourceFileName.equals("XXX"))
{ String TargetFileName = abc;
conf.put(key, TargetFileName);
}
if (SourceFileName.equals("YYY))
{String TargetFileName = def;
conf.put(key, TargetFileName);
}
return "";
The above code may require some (syntax) corrections!
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamal,
> the only requirement is that if the file name from the source is lets say XXX then the output name should be abc and if the source file is YYY then it should be def
I know 2 options
1. One more option is you can write the OS command to change the target name (without mapping).
2. In the mapping by using the dynamic configuraiton you can configure this type (with mapping).
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> the only requirement is that if the file name from the source is lets say XXX then the output name should be abc and if the source file is YYY then it should be def
This can be done in two ways at least.
1. Since you always know that what files can come into your source directory therefore you can create that many sender & receiver CCs. But this will not be a good solution if you have 'n' number of different files.
2. So, second option is to use message mapping and change the name as per your conditions by using Dynamic Configuration UDF.
> can i do that in 1 scenario?
Yes
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I dont think you can do it with out using mapping for the same...
As the filename needs to be changed from the source file name you need some UDF with Dynamic Configuraiton...parameters..
You can use the same file name for receiver if needed but i dont think you can change the same with out mapping...
HTH
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes of course this can be done. Use Adapter Specific Message Attribute to access the file name and then check these conditions in a UDF. For help on ASMA use the following link:
http://help.sap.com/saphelp_nwpi711/helpdata/en/48/ce299c3a8e5430e10000000a42189b/frameset.htm
Another useful link is this:
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Regards,
Sanjeev.
Edited by: Sanjeev Shekhar Singh on Dec 21, 2009 4:12 PM
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 | |
10 | |
7 | |
6 | |
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.