on 02-28-2006 12:04 PM
Blog : /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
My Problem:
The thing works for me and i am able to get my input files name as my output file name. But one thing i noticed is that in my target message, the field where i have mapped the code it always returns the value "null" but finally when the file is created i get the required result.
My input file name is input.txt and i get the same name in my output file too.
In sxmb_moni if i check DynamicConfiguration link i see the following
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Response
-->
- <sap:DynamicConfiguration xmlns:sap="http://sap.com/xi/XI/Message/30">
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFTPHost">10.25.116.98:21</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/input/test</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20060228T112200Z</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">bin</sap:Record>
<b><sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">input.txt</sap:Record></b>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">770</sap:Record>
</sap:DynamicConfiguration>
But when i check my mapped field i see
....
....
<field3>BodyC</field3>
<keyfield>02</keyfield>
<field5>BodyE</field5>
<field6>BodyF</field6>
</Body>
- <Trailer>
<keyfield>03</keyfield>
<b><field2>null</field2> -> Null value instead of input.txt</b>
</Trailer>
</ns0:MT_Putfile>
The code i have used to map the field2 of the trailer is the following ....
<i>DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileType");
String valueOld = conf.get(key);
return valueOld; </i>
Any clues ?
Mike, i had already tried all combinations like Directory,Filetype,FileName etc but all return null ... I wonder why ?
But the interesting thing is that finally i do get input.txt as my output file name !!!
PS: FileType is what i tried last (in vain) , hence the code i have put up shows that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shabarish,
The "conf" object(or the transformation parameters map from which the conf is obtained)that you have in the mapping, pls put it in output message by using conf.toString()/map.toString() or put the conf.toString()/map.toString() in the trace...
this is to verify that all the parameters are actually there....the conf is nothing but a map....when converted to a string it should show all the key value pairs...
Thanks,
Renjith.
Hi Renjith,
i tried with the following code now ...
<i>DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String valueOld = conf.toString();
return valueOld; </i>
and the result is
.......
.......
<field6>BodyF</field6>
</Body>
- <Trailer>
<keyfield>03</keyfield>
<b><field2><DynamicConfiguration></DynamicConfiguration></field2></b>
</Trailer>
</ns0:MT_Putfile>
Why is that DynamicConfiguration doesnt have any value ?
Hi Shabz,
You should have got something like this..i got this for an IDOC..
<DynamicConfiguration><Record><namespace>urn:sap-com:document:sap:idoc:messages</namespace><name>RCVPFC</name><value>LS</value></Record><Record><namespace>urn:sap-com:document:sap:idoc:messages</namespace><name>SNDPRT</name><value>LS</value></Record><Record><namespace>urn:sap-com:document:sap:idoc:messages</namespace><name>MESTYP</name><value>ORDERS</value></Record>
....
</DynamicConfiguration>
btw..what SP version are you on ?
It would be good if you parallely open an OSS message on this...
Thanks,
Renjith.
Renjith,
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Response
-->
- <sap:DynamicConfiguration xmlns:sap="http://sap.com/xi/XI/Message/30">
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFTPHost">10.25.116.98:21</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/input/test</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20060228T112200Z</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">bin</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">input.txt</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">770</sap:Record>
</sap:DynamicConfiguration>
this is what i get in the Dynamic configuration under XML Message in SXBM_MONI ... and i am on SP14.
We are also at SP14...So beats me as to why it is not working....
One last wild try...can you get the Transformation parameters from the Global container instead of the container...
DynamicConfiguration conf = (DynamicConfiguration) <b>container.getGlobalContainer().</b>getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
Thanks,
Renjith
Gosh this is spooky
Anyway i tried with that line of code but it throws me an error during activation ...
Activation of the change list canceled Check result for Message Mapping mm_IS | http://t-systems.com/Shabarish: Starting compilation Source code has syntax error: /usr/sap/TXT/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map387c7300a9ac11da9d280011256afae8/source/com/sap/xi/tf/_mm_IS_.java:104: cannot resolve symbol symbol : method getTransformationParameters () location: interface com.sap.aii.mappingtool.tf3.rt.GlobalContainer DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); ^ 1 error
The code is :
DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
//String valueOld = conf.get(key);
String valueOld = conf.toString();
return valueOld;
Thanx Renjith so far .. but i hope this gets resolved (else i will loose my sleep thinkin abt the situation)
Hi,
>>>>DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileType");
try with "FileName" instead
(as per my weblog)
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>
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.