cancel
Showing results for 
Search instead for 
Did you mean: 

Predicates for XPath in Condition Editor of NWDS for PI AEX 7.4 (SP 7)

JaySchwendemann
Active Contributor
0 Kudos

Dear all,

we are in the middle of migrating from our old Dual Stack PI 7.0 to our new PI 7.4 AEX.

We have a fairly largen receiver determination on the old system that makes heavy use of predictes. One expression for example looks like this


(SHPMNT05/IDOC/E1EDT20/E1EDL20/E1EDL37/E1EDL49/E1EDL50[XSIQUALF='EEIVERF']/VLABDATA = 01)

However, when I'm trying to insert this in NWDS' condition editor there's an error stating "Predicates are only allowed with EXISTS operator"

1. Is this a limitation of the condition editor in NWDS?

2. Is there a way to configure the above XPath so it is working in NWDS?

3. Would it be safe / wise to configure the mappig in ICO in Swing Tool or would this be overwritten by NWDS configuraiton?

Many thanks

Jens

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi Jens

From SAP library, the example shows that the usage of predicate is with the EX operator, so maybe it is a limitation.

Integration Directory - SAP Library

Maybe you can try to combine your two conditions in the predicate and use it with the EX operator

(SHPMNT05/IDOC/E1EDT20/E1EDL20/E1EDL37/E1EDL49/E1EDL50[XSIQUALF='EEIVERF' and VLABDATA = '01'] EX)

Rgds

Eng Swee

JaySchwendemann
Active Contributor
0 Kudos

Hi Eng Swee,

thanks, that actually might work.

@Eng Swee / All: How would you deal with such an XPath (leaving for searching my XML / XPath book )


/SHPMNT05/IDOC/E1EDT20/E1EDL20[1]/E1EDL37[1]/E1EDL49[1]/XSITD[1] = "DSV"

so only the first occurences of the nodes should be considered.

Many thanks

Cheers

Jens

engswee
Active Contributor
0 Kudos

Hi Jens

How about this? There is only one XSITD under segment E1EDL49, so you just need to check on the first occurrence of E1EDL49.

/SHPMNT05/IDOC/E1EDT20/E1EDL20[1]/E1EDL37[1]/E1EDL49[position() = 1 and XSITD = 'DSV'] EX

Rgds

Eng Swee

JaySchwendemann
Active Contributor
0 Kudos

Hi Eng Swee,

unfortunately NWDS Condition Editor doesn't allow that very expression. I could write something like this:


EXISTS(Xpath./SHPMNT05/IDOC/E1EDT20/E1EDL20/E1EDL37/E1EDL49[position() = 1 and XSITD = "DSV"])

But that would allow "DSV" to be in any parent node for example the second E1EDL37 node instead the first one.

Any further suggestions are welcome

Cheers

Jens

JaySchwendemann
Active Contributor

Dear all,

I resolved this by a little hack, i suppose:

1. Create an expression with a forced whitespace in it

2. Note that the string "Create Xpath containing whitespaces becomes available

3. Enter a Name for your Xpath expression and the actual expression in the popup

4. Note that you can use predicates and the like in the expression editor

5. Use your expression accordingly in the main editor window

See below for an example

HTH

Cheers

Jens

Answers (0)