on 02-22-2007 5:01 PM
Hi,
I'm using a file adapter for process a flat file and convert it into an XML. Does anybody knows how to include the file name into an XML field.
Ex.
I process the file named <b>XXIMN21022007.txt</b> and I need an XML like:
<MT_FILE>
<field1></field1>
<field2></field2>
<field3></field3>
<filename><b>XXIMN21022007.txt</b></filename>
</MT_FILE>
Regards
Gonzalo
Hi Gonzalo,
I think from SP14 you are able to get the file name from the dynamic configuration.
If your issue is to have the same name in source system and in the target system, you can follow the Michal Krawczyk blog.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
I hope this help, if not, let me know I will suggest you other ways to sort it out.
Saludos.
Eduardo M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just go for dynamic configuration.
Check the sender file adapter to write the filename in the header (as explained in Michal's blog) and then read that header in some mapping.
U can use that even in simple message mappings.
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
Your code for the filename tag would be something like:
<i>DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(
http://sap.com/xi/XI/System/File,
FileName);
return conf.get(key);</i>
Regards,
Henrique.
It worked as you said, thank you both.
Regards
Gonzalo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
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.