cancel
Showing results for 
Search instead for 
Did you mean: 

How to Get the Source File Path in the Receiver Side

Former Member
0 Kudos
418

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You have to enable "Directory" check box in the adapter specific attributes ( both in Sender CC and Receiver CC)

regards

krishna

Former Member
0 Kudos

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

MichalKrawczyk
Active Contributor
0 Kudos

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>

Former Member
0 Kudos

Khanna

I already answered your question. See above..

You have to enable "Directory" check box

regards

krishna

justin_santhanam
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

justin_santhanam
Active Contributor
0 Kudos

Khanna,

The above code will give u the info where the file from and the path. The code won't create the target filename. Please have a look at the code, It doesn't have conf.put, it has only conf.get.

Best regards.

raj.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

Ans

Former Member
0 Kudos

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:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c89607-e4d9-2910-7280-f6746e96...

[reward if helpful]

regards,

latika.