on 03-18-2011 5:12 AM
I have a scenario in which the flat file is sent to XI. From this file i need to create a log file which has three parameters.
File Name
File Size
Number of records
The File Name and Number of records is okay however can any one tell me how to calculate and fetch file size in mapping ?
Hi Trisha,
To fetch the size of the file, you need to write an UDF and map it in the message mapping.
Here is the sample code
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","SourceFileSize");
fileSize = conf.get(key);
For this you need to enable the filesize option in Adapter specific message attributes in the Advanced tab of the file adapter.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.