Skip to Content
0
Sep 11, 2007 at 09:35 PM

Xpath expression substring or contains

409 Views

Hi ,

I have this inbound source message

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

- <rfc:Z_RFC xmlns:rfc="urn:sap-com:document:sap:rfc:functions">

- <TO_DATA>

- <item>

<LINE>000012E3 ABCD 3I 20070911164941</LINE>

</item>

</TO_DATA>

</rfc:Z_RFC>

and two inbound interfaces

condition is , if "ABCD" exists in the LINE field(type string) then the corresponding Interface mapping should execute.

I know the exact location of "ABCD occurence so I can use either contains or substring functions.

I tried /P1:Z_RFC/TO_DATA/item[substring(LINE,X,Y)="ABCD"] EX no right operand

/P1:Z_RFC/TO_DATA/item[substring(LINE,X,Y)]= "ABCD" with right operand

substring((/P1:Z_RFC/TO_DATA/item/LINE),X,Y) = "ABCD"

similarly I tried around with <b>"contains"</b> function too.

but not able to apply exactly, I tried with different options looking at different blogs in SDN.

so how should be the Xpath expression ?

thank you.

Babu