cancel
Showing results for 
Search instead for 
Did you mean: 

Access file in file directory during mapping

Former Member
0 Kudos

Hi,

is there any way, how I can access during the mapping a file in the file directory of the XI server. I know how to access files in imported Archives, but this will not help in our use case. We need this file to read additional information for our mapping.

Thanks in advance,

Peter

Accepted Solutions (1)

Accepted Solutions (1)

former_member206604
Active Contributor
0 Kudos

Hi,

You can try using java.io api's to access the files in the XI server or even any of the shared folders from the network. I have'nt done before but you can try doing this.

Regards,

Prakash

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

sure it is possible you can just use java to access it like you do from any other

java program

or you can use something like this:

/people/sundararamaprasad.subbaraman/blog/2005/12/09/making-csv-file-lookup-possible-in-sap-xi

but remember about the error handling

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>

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

it sure is possible to use the java IO classes to do a file look up. But, there are few factors that you need to keep in picture,

1. The File path would need to be hardcoded. When you move from one environment to another, yopu would need to ensure that the same file path is available.

2. No STATEFUL Message processing should be done. In the sense, you should read data from a file, but do not attempt to wruite data into a file using the IO classes as if the message fails or someother issue arises, there maybe inconsistencies.

/people/sap.user72/blog/2006/06/07/property-file-a-smart-use-in-xi-context

Regards,

Bhavesh

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>>1. The File path would need to be hardcoded. When you move from one environment to another, yopu would need to ensure that the same file path is available.

only the path to the configuration file

>>>>2. No STATEFUL Message processing should be done. In the sense, you should read data from a file, but do not attempt to wruite data into a file using the IO classes as if the message fails or someother issue arises, there maybe inconsistencies.

sure but he only wants to read the data I believe

Regards,

michal

Former Member
0 Kudos

Thanks to all answers

bhavesh_kantilal
Active Contributor
0 Kudos

Mike,

><i>only the path to the configuration file </i>

I agree. We had used this approach once for a properties file look up but we faced the issue that as we moved into the production environments it became really difficult to get through the maze of approvals required for this path and folder access to be set up.

What I think would ( have been ) be a better thing to do on hind sight would be to use value Mapping and maintain the KEY VALUE pairs in the Integration Directory. ( if you are looking at Properties file lookup to maintain environment specific data).

Would like to hear your views on this too

Regards,

Bhavesh

MichalKrawczyk
Active Contributor
0 Kudos

hi,

value mapping is the certainly way to go:)

but you need to ask youself a few questions:

1. how will you fill the value table - for updates

2. how will you do the deletions of value mapping table

and remember that value mapping only works with pairs

what if you have one key in the file made from 2-3 values ?

>>>>really difficult to get through the maze of approvals required for this path and folder access to be set up.

agree

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>

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

><i>and remember that value mapping only works with pairs

what if you have one key in the file made from 2-3 values ?</i>

hmm.. this I guess I can add some delimiters to the Value and then split the value on the basis of the delimiters and so on. Where there is a will , there is always a way.

Thanks for the confirmation

Regards,

Bhavesh