Avatar of NAEDI2
NAEDI2
Flag for United States of America asked on

XSLT XPath Quantified Expression Help

I am trying to use a quantified expression to check every line item in a purchase order to see if the confirmed date and quantity (E2EDP20_EDATU, E2EDP20_WMENG) match the order date and quantity (E2EDP03_DATUM, E2EDP01_MENGE) within each G03 node..  

This is an SAP ORDERS IDOC.  If the E2EDP01 ordering data matches the E2EDP02 and E2EDP20 order confirmation the order is accepted unchanged.  If the E2EDP20_WMENG quanity is different than E2EDP01_MENGE we detect a change.  If the EDP20_EDATU  is different than E2EDP01_DATUM we also detect a change.

There  may be many G03 groups each with a new line item within to be checked.

When I enter this code below I get "Xpath is Invalid".  Am I not supposed to be able to use pos$ as a variable for each //G03 and use it as part of the Xpath to the E2EDP03 and E2EDP01?

<xsl:value-of select=" if (every $pos in //G03 satisfies (pos$/E2EDP20/E2EDP20_EDATU=pos$/E2EDP03[E2EDP03_IDDAT='002']/E2EDP03_DATUM and pos$/E2EDP20/E2EDP20_WMENG=pos$/E2EDP01/E2EDP01_MENGE)) then 'NOCHANGE' else 'CHANGE' "/>



<?xml version="1.0" encoding="UTF-8"?>
<!-- Based on format description: ordrsp_sr3_ord04 --><ACTIS>
  <Ein_IDOC>
  	  <G01>
  	  	...
  	  <G02>
				...
      <G03>
         <E2EDP01>
            <E2EDP01_POSEX>000010</E2EDP01_POSEX>
            <E2EDP01_ACTION>001</E2EDP01_ACTION>
            <E2EDP01_MENGE>960.000</E2EDP01_MENGE>
            <E2EDP01_MENEE>PCE</E2EDP01_MENEE>
            <E2EDP01_PMENE>PCE</E2EDP01_PMENE>
            <E2EDP01_VPREI>608.92</E2EDP01_VPREI>
            <E2EDP01_PEINH>100</E2EDP01_PEINH>
            <E2EDP01_NETWR>5845.63</E2EDP01_NETWR>
            <E2EDP01_NTGEW>624.000</E2EDP01_NTGEW>
            <E2EDP01_GEWEI>KGM</E2EDP01_GEWEI>
            <E2EDP01_CURCY>USD</E2EDP01_CURCY>
            <E2EDP01_MATKL>M35040</E2EDP01_MATKL>
            <E2EDP01_BRGEW>624.000</E2EDP01_BRGEW>
            <E2EDP01_PSTYV>ZTAN</E2EDP01_PSTYV>
            <E2EDP01_WERKS>0082</E2EDP01_WERKS>
            <E2EDP01_ROUTE>513K04</E2EDP01_ROUTE>
            <E2EDP01_ROUTE_BEZ>CR-US, TRUCK, AVERITT (EAST)</E2EDP01_ROUTE_BEZ>
            <E2EDP01_VSTEL>0051</E2EDP01_VSTEL>
         </E2EDP01>
         <E2EDP03>
            <E2EDP03_HLEVEL>03</E2EDP03_HLEVEL>
            <E2EDP03_IDDAT>002</E2EDP03_IDDAT>
            <E2EDP03_DATUM>20180503</E2EDP03_DATUM>
         </E2EDP03>
         <E2EDP03>
            <E2EDP03_IDDAT>022</E2EDP03_IDDAT>
            <E2EDP03_DATUM>20180409</E2EDP03_DATUM>
         </E2EDP03>
         <E2EDP20>
            <E2EDP20_WMENG>960.000</E2EDP20_WMENG>
            <E2EDP20_EDATU>20180503</E2EDP20_EDATU>
         </E2EDP20>

Open in new window

* XSLT* XPathSAP* quantified expression

Avatar of undefined
Last Comment
Gertone (Geert Bormans)

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gertone (Geert Bormans)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
NAEDI2

ASKER
I was so focused on the Xpath part I couldn't see this obvious and embarrassing error.   Thank you.
Gertone (Geert Bormans)

welcome
Your help has saved me hundreds of hours of internet surfing.
fblack61