on 12-12-2006 3:52 PM
I just create User defined function "getfilename" and I put there:
"DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
return ourSourceFileName; ".
But In test mapping I have worning:
"Runtime exception during processing target field mapping /ns1:Z_KBFI_INPUT_FILE/IS_IFILE/FILE_NAME. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._KBFIMsgMapping_ method get_fname$[com.sap.aii.mappingtool.tf3.rt.Context@37d4662c] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns1:Z_KBFI_INPUT_FILE/IS_IFILE/FILE_NAME. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._KBFIMsgMapping_ method get_fname$[com.sap.aii.mappingtool.tf3.rt.Context@37d4662c] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:284) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:238)...."
And in RWB in Communication Channel Monitoring I can not see file name in the payload.
Maby I do something wrong, please tell me.
HI Grzegorz,
your code seems to be ok, just which SP are you running? this was allowed from SP14 onward.
Regards,
Sergio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
my source file 200610.txt is like this:
HR 0610 061030 061021
DR 03 C 0610 820114 00010111 0000015000 PLN descr...
DR 03 D 0610 403201 00010111 0000015000 PLN descr..
TR 0000000002
Then in sxmb_moni in inbound message (payload) I have:
<?xml version="1.0" encoding="utf-8" ?>
- <ns:KBFIMsgTypeSource xmlns:ns="http://p4.org/xi/KBFI/Interface">
- <FIRecordset>
- <HeaderLine>
<LineKey>HR</LineKey>
<PostingPeriod>0610</PostingPeriod>
<PostingEndDate>061030</PostingEndDate>
<PostingDate>061021</PostingDate>
</HeaderLine>
- <PostingLine>
<LineKey>DR</LineKey>
<ServerID>03</ServerID>
<DCFlag>C</DCFlag>
<PostingPeriod>0610</PostingPeriod>
<GLAccount>820114</GLAccount>
<SubAccount>00010111</SubAccount>
<NetValue>0000015000</NetValue>
<Currency>PLN</Currency>
<Description>descr...</Description>
</PostingLine>
- <PostingLine>
<LineKey>DR</LineKey>
<ServerID>03</ServerID>
<DCFlag>D</DCFlag>
<PostingPeriod>0610</PostingPeriod>
<GLAccount>403201</GLAccount>
<SubAccount>00010111</SubAccount>
<NetValue>0000015000</NetValue>
<Currency>PLN</Currency>
<Description>descr..</Description>
</PostingLine>
</FIRecordset>
</ns:KBFIMsgTypeSource>
But I don't have payload for Response (black and white flag).
In DynamicConfiguration i have:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Response
-->
- <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">141</SAP:Record>
<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">txt</SAP:Record>
<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20061212T121622Z</SAP:Record>
<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileEncoding">ISO646-US</SAP:Record>
<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">200610.txt</SAP:Record>
<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/usr/sap/PXD/put/archive</SAP:Record>
</SAP:DynamicConfiguration>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"Does the Filename node have a parent. If so check if parent node occurs.
Also return any dummy value in ur UDF and check if u get the tag and that value."
Yes hava a parent which occure.
When I try return "dummy value" i still don't have this tag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No I even don't have empty XML tag coresponding to file name. The file name apear in message header but in target message i don't have any file name tag and file name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also check that the node that is input to UDF is not optional...
Make sure that node occurs in ur input.
How to check that?? Which node is this?
Yes I getting the XML node corresponding to filename.
Message was edited by:
Grzegorz Stankiewicz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can see in Message content->SOAP Document message like this:
<sap:DynamicConfiguration>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/usr/sap/PXD/put/archive</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileEncoding">ISO646-US</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20061212T121622Z</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">txt</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">200610.TXT</sap:Record>
<sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">124</sap:Record>
</sap:DynamicConfiguration>
And I see the file name but in Message content->payload..: I still can't see even file name xml tag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just did like you advice but it still doesn't work.
Yes I set the FileName checkbox in Adapter Specific Identifiers in sender communication channel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just go to transcation SXI_MONITOR and choose ur scenario.
in that Inbound side check SOAP header and Dynamic Configuration. U should have ur file name there.
Also check that the node that is input to UDF is not optional...
Make sure that node occurs in ur input.
Are u getting the XML node corresponding to filename atleast .
Regards,
Sudharshan
Even if you test it by sending a file/message through comm. channel. it still doesn't work. I can not see the xml tag like <FileName>XXXX.txt</FileName> which I want. The channel is working without error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try the following piece of code to replace Key object
DynamicConfigurationKey key = DynamicConfigurationKey.create("http:" + "/" + "/" + "sap.com/xi/XI/System/File", "FileName");
and execute ur scenario.
Also Make sure that Adapter Specific Identifiers and FileName Checkbox is set in sender communication channel
Regards,
Sudharshan
testing using mapping tool will generate runtime exception as the Dynamic config set in Communication channel is not availbale in IR,but this will work if you test it by sending a file/message through comm. channel.
You have to disable this field in the mapping temporarly to use the Mapping test tool.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, thanks!
But how to solve the problem?? Where is an error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes my SP allowe for that solution. I asked my basis administrators.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you show me how to do that??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you took your code from here:
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Try to put the block code in Try, Catch and stamp and trace the exception.
Regards,
Sandro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.