on 03-11-2010 7:21 PM
Hi,
I had a reqiuirement based on the file name, i should drop the files in to different directories.
I can get the filename through variable substitution in receiver file communication channel, now i want to drop the file into different folders based on conditions.
suppose, if the file name is DDDX234
i should do substring of filename0+(4), if the value is L then i should drop in X directory
suppose, if the file name is DDDY234
i should do substring of filename0+(4), if the value is L then i should drop in Y directory.
How can i drop the file into differnent directories based on filename.
Thanks
Srinivas
hi,
this is pretty easy - you just have to learn to use ASMA - Adapter-Specific Message Attributes instead of variable substitution
one of the parameters that you can set in the mapping for ASMA is DIrectory:
http://help.sap.com/saphelp_NW04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
so you can set the directory in the mapping and it will be used by the file adapter
you can find many blogs about ASMA setting in mapping on sdn - so it's a pretty easy requirement
try this one:
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Michal,
I mapped the directory and filename to the target header in the mapping
Filename --> UDF --> Header(target)
and in the receiver channel checked the ASMA and given * in the filename and directory name.
But in runtime iam getting the error as
Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
MY UDF is
public String Directory(String a,Container container){
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
String FileName = conf.get(key);
FileName = a;
conf.put(key, FileName);
%%%based on filename the directory should change
String Directory = conf.get(key1);
Directory = "/SAPInterface/XI/PPD/DHX/out";
conf.put(key1, Directory);
return "";
Help me in correcting this error.
Thanks
Srinivas
Thanks Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
Handle it in mapping and send the directory name to the communicaiton channel at runtime using adapter specific message attributes.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
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.