cancel
Showing results for 
Search instead for 
Did you mean: 

XPATH expression in receiver determination

Former Member
0 Kudos

I have an EMAIL to EMAIL scenario. I use mail package, so my input XML looks like this....

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!-- Inbound Message -->

<xim:Mail xmlns:xim="http://sap.com/xi/XI/Mail/30" encoding="base64">

<Subject>PAR Request ID#49A4EF3DF06700F4E10080000A8730FE#ID</Subject>

<From>from-email-address</From>

<To>to-email-address</To>

<Content_Type>text/plain; charset="us-ascii"</Content_Type>

<Date>2009-03-11T12:24:42Z</Date>

<Message_ID>message id</Message_ID>

<Content>blah blah blah</Content>

</xim:Mail>

In my receiver determination I need to send emails with subject = "PAR Request" to go to one business system. And emails with subject not equal "PAR Request" go to another business system.

I could easily achieve this with extended receiver determination and mapping object - but it is better to use XPATH as this can be changed without transport.

I have tried...........

/p1:Mail/Subject[http://substring(xim:Mail/Subject,1,3)]

/p1:Mail/Subject[http://substring(1,3)]

substring(xim:Mail/Subject,1,3)

And nothing works - can anyone tell me the syntax please?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey

Try using the following

/p1:Mail/Subject[substring(.,10,3) = 'anyValue']

Note:You can't specify value of substring in the condition itself,you need to specify = value and use EX in condition.

Thanx

Aamir

Former Member
0 Kudos

I managed to get it working in the end .........

(/p1:Mail/Subject[substring(.,1,14) = 'PAR Request ID'] EX)

and

(/p1:Mail/Subject[substring(.,1,14) != 'PAR Request ID'] EX)

worked perfectly.

Answers (1)

Answers (1)

Shabarish_Nair
Active Contributor
0 Kudos

base this as your reference - /people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination