cancel
Showing results for 
Search instead for 
Did you mean: 

How to Calculate and fetch File size in mapping ?

Former Member
0 Kudos

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 ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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,

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Trisha,

few details;

Thanks,

Bhupesh