on 06-29-2007 11:28 AM
Hi Experts,
Here We are Trying to Do How to Get the Sender Information ( File Name & Path ) on the Receiver Side .
According to the Michal Blog
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Here we Are Able to Get only the File Name.
But If I Want to get the Total File Path Also means What Should I Do Here ????
Please Let Me Know
Regards
Khanna
Hi
You have to enable "Directory" check box in the adapter specific attributes ( both in Sender CC and Receiver CC)
regards
krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna,
Here this Blog is for How to Get the target File Name As Like Source File Name.
But My Requirement is I want to Display the Source File name And the Directory Path ( Complete Source File Information ) in the Receiver Side. So that The Receiver Knows that This So And So File Came From this Path with this Name.
So How Can I Achieve this??????
Please Let Me Know
Regards
Khanna
hi,
use <b>Directory</b> instead of <b>FileName</b> value
the rest of the coding is the same as in my blog
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
Khanna,
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey fkey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
DynamicConfigurationKey dkey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
String fname = conf.get(fkey);
Sring path = conf.get(dkey);
String final=fname""path;
return ""final"";
Best regards,
raj.
Hi Raj,
Here the Goal is We Have to Get the Target File Name With Reference to Source File Name.
But Here I Dont Want to Create the Target File Name With the Source File Name.
Here I want to Get the Information About the Sender Like What is the File Name of the Sender And From where that File Has Come to Here.
i Want This type of Solution Can Any one Give me Point to Do This.
Regards
Khanna
hi rajesh,
as i mentioned earlier...take the file name and directoty path from sender (by setting filename and directory in sender CC) and concat them in the message mapping.
in the link i gave u earlier, i am concatinating filename with a field in scr structure. Similarly u can take filename and directory and concat them and use whever u want to.
does this solve ur problem?
[reward if helpful]
regards,
latika.
Hi Rajesh,
you can use this approach: in UDF, you have 2 variables for source filename and source file directory..........apply your logic to create a string varible for target filename - you can take some substring from source filename and source file directory, add your some target filename, concat these in target filename variable.........in UDF then you will have to use conf.put(targetfilename) to set this as the target filename.
Thanks,
Rajeev Gupta
Ans
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi rajesh,
u r on rite track. as u can retrieve filename, u can also retrieve directory.
so in ur mapping u can concat both and get the total path.
for step by step process refer:
[reward if helpful]
regards,
latika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
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.