on 05-30-2008 11:04 AM
Hi EveryBody,
I need to capture only the the FileName in to the outbound xml that is present in the filepath of XI server.
I checked:
Adapter Specific Message Attributes:
Checked box on --> 1)Set Adapter Specific Message Attributes
2) File Name
And my dt IS OF TYPE :
<?xml version="1.0" encoding="UTF-8"?>
<MT_DMS_FINAL>
<Header>
<FileName/>
</Header>
</MT_DMS_FINAL>
Now i put the File into the path , i donot need any content of file in XML , only needed the file name.
i tried above config and it says mapping error, but i test it"s running good with the test tab.
i guess file picked up by Sender file Adapter is not matching witj the outbound interface ?? is it so ?
advice. i see in the sxmb_moni that only the content not in xml structure is displayed.
srini
Hi,
To get the file name in a field of ur target u need a UDF. Refer the following blog. Use the UDF provided in the blog and map it to the target field(whichever u wish to) in the message mapping. This will solve the problem.
Hope it helps.
Regards,
Sanjeev.
Edited by: Sanjeev Shekhar Singh on May 30, 2008 1:15 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U have to use variable substitution to get the fie name by mapping it to a target field and also use dynamic configuration for that
pls heck this blog by
/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
Reward points if u found it useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well this is used when we want the Receiver Adapter to have the same file name by setting up the variable,
well here my target in terface is different and not same ,
my requirment and question is , how could i get the "FileName" element in the outbound xml document,
Since i have made a check mark on the Adapter Specific config / and FileName --> How to get it done.
With regards
Srini
Exactly , i can see that in "Dynamic Configuration tab " in SXMB_MONI.
Well here my Sender File Adapter picks up file of any format , then i just need to get the filename , this filename is split and mapped further to my target in terface.
That is my requirment , so i need to get that filename present in the "Dynamic Configuration tab " to be in the interface not the content of File once picked up by file.
if you say i should use the UDF , well what could be the source map ?? confused
Source Interface -
(My UDF to split Filename) -
Target Interface
Above thing would give a clear picture,, hope so
srini
Hi Venkateswarlu,
I got your prob now. The solutin can be as follows:
Lets say you have 5 files. Make different message types/interfaces for each of them. Now in the mapping you go to the messages tab. There in the Source side you provide all the message types created and there occurence as 0...1. On the target side you provide the target message type as you want. Then in the mapping you can directly create the UDF. It has no input parameters. So you map directly to the target fiels, wherever required.
Hope it helps.
Regards,
Sanjeev.
Hi Sanjeev,
So in my case ,
Source Interface would be kind of Dummy right , since i donot need to map anything ,
As my requirment demands or my target interface demands only the filename input in split format.
So now i create the UDF to get the "file name" and map it to target interface.
am i clear in ?? now
srini
Ya exactly.
But it should have all the files embedded in the Source tab of the message mapping. Rest all you got it correct.
And ya one more thing, the output of the UDF will provide the filename. This you can split using the standard functions in the message mapping and the result you can map to the target field.
Try it and let me know.
Regards,
Sanjeev.
Reward points if it was helpful.
Refer to the blog that i asked you to go thru. It has no input fields. It accesses the file name through the Dynamic Configuration. Provides the same as output. Its just a java function without any input parameter. Create an UDF and deleted all the arguments(even "a").
Code:-
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;
Oops sorry, i guess i forgot to provide the blog link. Anyway its here:
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Regadrs,
Sanjeev.
Edited by: Sanjeev Shekhar Singh on May 30, 2008 2:12 PM
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.