on 08-24-2011 2:51 PM
Hi,
I have a requirement (file to ERP) of picking a file from a directory, take a part of file name and use it in the mapping to populate it as a field. I got the following code from SDN and using it as it is.
public String AccessFileName(Container container){
DynamicConfiguration attrib = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey fileKey = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
String FILE_NAME = attrib.get(fileKey);
return FILE_NAME;
}
In File sender adapter, what are the configurations I have to make so that the above function in mapping gets the file name to work on?
I gave the AF_Modules/DynamicConfigurationBean and CallSapAdapter without giving any parameters. And also I ticked the Adapter-Specific Message Attributes and File Name check boxes.
I am getting an fatal mappping error.
Any more configurations to add?
Please help.
I gave the AF_Modules/DynamicConfigurationBean and CallSapAdapter without giving any parameters. And also I ticked the Adapter-Specific Message Attributes and File Name check boxes.
No need to use any module AF_Modules/DynamicConfigurationBean
Only ticked the Adapter-Specific Message Attributes and File Name check boxes is enough.
String inputFileName;
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
inputFileName= conf.get(key1);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramesh,
>>> In File sender adapter, what are the configurations I have to make so that the above function in mapping gets the file name to work on?
All you need to do in File Sender Adapter is to check the Adapter-Specific Message Attributes and File Name check boxes in the "Advanced" tab of the File channel.
Please remember one thing that even after doing the above configuration and using the UDF that you mentioned, you will get a Fatal error when you test the mapping from the "Test" tab of your graphical mapping editor, however, this will work perfectly fine during runtime which you can easily test by running an end to end File-to-IDoc scenaro.
I hope this helps.
Regards, Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do go thru this - /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.