cancel
Showing results for 
Search instead for 
Did you mean: 

Xpath version supported by PI7.1

Former Member
0 Kudos

Hello experts

I was using conditions in receiver determination . But I wanted some extra functionality , so I tried to use a complex Xpath expression . It seems to fail to evaluate it . So was wondering which versions of Xpath does 7.1 support.

The expression I was using was

(/HRMD_A06/IDOC/E1PLOGI/E1PITYP/E1P0001/[index-of(/HRMD_A06/IDOC/E1PLOGI/E1PITYP/E1P0001/ABKRS(), ABKRS())[last()]] = S1)

I wanted to get to the value of the element which occurs in a segment , and the segment occurs multiple times .

I want to get the value

Example  E1P0001/ABKRS  = S1

                  E1P0001/ABKRS  = S2

                E1P0001/ABKRS  = S3

               E1P0001/ABKRS  = S4

I want to get the ABKRS which is the last occurrence.

Is my XPath correct to achieve this or PI just doesn't support such complex Paths.

Thank you for your opinions .

Venkat.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Venkat,

Please check this link:

http://www.w3schools.com/xpath/xpath_functions.asp

Returns the number of items in the processed node list 

Example: //book[last()]
Result: Selects the last book element

Please try this:

/HRMD_A06/IDOC/E1PLOGI/E1PITYP/E1P0001/ABKRS[last()]

It looks like idoc message type. You need to prefix the namespace also as per xsd.

Regards,

Beena.

Former Member
0 Kudos

Thanks Beena

I had to tweak Xpath a little like this and then it worked.

/HRMD_A06/IDOC/E1PLOGI/E1PITYP/E1P0001[last()]/ABKRS

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

the xpath is wrong I believe

you should work with EX condition for multiple nodes

so it should look like:

(/HRMD_A06/IDOC/E1PLOGI/E1PITYP/E1P0001/[index-of(/HRMD_A06/IDOC/E1PLOGI/E1PITYP/E1P0001/ABKRS(), ABKRS())[last()]] = S1  EX )

Please have a look at this blog from Shabarish:

http://scn.sap.com/community/pi-and-soa-middleware/blog/2006/06/07/customise-your-xpath-expressions-...

Regards,

Michal Krawczyk