on 08-23-2012 11:22 AM
Hi I have a file adapter that can pick up to 20 files up so it is looking for *.csv
Files cane be called something like
NON_R1.csv
EMP_R1.csv
NON_R2.csv
TEST_R3.csv
etc
However when I drop off them off using a file adapter, after processing them, the recieving system needs the same file name but a different extension so they require
NON_R1.xml
EMP_R1.xml
NON_R2.xml
TEST_R3.xml
Is there an easy way in the adapter to keep the file name but change the extension rather than having to build multiple recieving Adapter channels with the .xml name defined ? I could always put a function in the mapping to do it too but wondering if there was a way to keep coding out of it
Thanks
Easiest way I see is to take the file name in your mapping from the Adapter Specific Message Attributes and change the extension. You can do this in an UDF:
DynamicConfigurationKey fileName = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
DynamicConfiguration conf = getConfig(container);
if (conf != null)
conf.put(fileName, name);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adapter Specific Message Attributes(ASMA) + UDF to change the extension is the way to go. I do not think if there is any way to change just the extension without an UDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brian,
I dont think this is possible without mapping, as the receiver adapter has no ways to know the original filename (without the extension). I may be wrong, Please wait for experts oinion.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brian, you can keep the source filename with DynamicConfiguration, but changing the extension of the target filename would require some coding.
- Either change the filename extension in an UDF in message mapping
- or you set the target filename with DynamicConfiguration and use an OS command to change the filename extension.
You find plenty of examples on SCN.
Regards, Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
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.