Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
vicky20691
Active Contributor

Making world a little easier with Dynamic Configurations UDF in one place in one place.


Being a techie we can easily find the Shabarish's love for Star Wars Blog , but someone in SAP Process Integration and SAP Process Orchestration will also love the usage of dynamic configuration presented by Shabarish in the mentioned blog. Not to mention as shabarish.vijayakumar has mentioned the "Jedi Master"-Michal krawczyk's blog has made our work so much easier to handle file and it's attributes in mapping.

Well, believing in quote "No contribution is small", here I is my " Not a small Contribution", placing the Dynamic Configurations in one place.

Prerequisites:


Enable the "Set Adapter-Specific Message Attributes" and select what feature you want to use in the mapping



1. File Name- Mapping the source file name to one target node


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);

return  SourceFileName;

2. Directory


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");

String sourceDirectoryName = conf.get(key);

return  sourceDirectoryName;

3. File Type


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileType");

String sourceFileType = conf.get(key);

return  sourceFileType;

4. Source File Size


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","SourceFileSize");

String sourceFileSize = conf.get(key);

return  sourceFileSize;

5. Source File Stamp


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","SourceFileTimestamp");

String sourceFileTimestamp = conf.get(key);

return  sourceFileTimestamp;

###  the Time Stamp will be in format- YYYYMMDDTHHmmssZ, you can use the magical DateTrans function to transform it in the way you want.

5. Source FTp Host


#This is applicable only for FTP protocol File channel


DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","SourceFTPHost");

String sourceFTPHost = conf.get(key);

return  sourceFTPHost;

You can see all the Dynamic Configuration in your monitoring- michal.krawczyk2 has shown it for ABAP stack. Here it is for the Java stack

The file-

I hope it will be useful for any future searches on Dynamic Configuration regarding File attributes. I had to refer multiple links and searches to figure out all this, and it is my small attempt to make the "Jedis" put less effort next time. :smile:

2 Comments
Labels in this area