cancel
Showing results for 
Search instead for 
Did you mean: 

receiver determination using substring in filename in file adapter

Former Member
0 Kudos

Hi

In PI 7.11 I would like to determine the receiver based on a substring in the filename in a file receiver adapter. I am planning on using a context object but am having trouble entering the correct code in the "Right Operand" field.

I have tried selecting Context Object = Filename http://sap.com/xi/XI/System/File and entering this code in the Right Operand: "contains(substring('_4000_'))" and an "=" in the as I am looking for a filename, that contains the substring "_4000_".

I would like to avoid using an extra map and using Dynamic Configuration, as I thing this would be the most elegant way of fixing it

Is there a way of referencing the context object if I chose xpath in stead of context object?

MIkael

Accepted Solutions (0)

Answers (1)

Answers (1)

Shabarish_Nair
Active Contributor
0 Kudos

could you try as specified? /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

Former Member
0 Kudos

Thanks for your answer, but this blog does not mention how context objects are reached in an xpath expression or how "meta data" like the file name is collected.

Maybe this xpath expression will work (I specify the namespace as prefix = p1 namespace = http://sap.com/xi/XI/System/File)

(Main/FileName[contains('_4000_')] EX )

Or is the xpath expression to pick up the filename different than this?

MIkael

Former Member
0 Kudos

Please note, that I use square brackets around contains('_4000_')

Former Member
0 Kudos

Hi Mikael,

I have the same scenario like you , could you please tell me about the condition how to you use XPath for Context Object

I need to check the file name and according to that I have to put the file in the different directory.

Source File: XXXX_IN_xxxx

XXXX_PH_xxxx

I have to check the 7th and 8th Char of the file and according to that I have to place the file in the folder

Target: DGE008\IN\Inbound

DGE008PH\Inbound

I don't know how to used the XPATH for file and specially how to use the substring in that.

Could you please help.

Thanks,