cancel
Showing results for 
Search instead for 
Did you mean: 

Handling multiple occurrences of a segment E1EDKA1 in INVOIC02 using XPATH

Former Member

Dear All,

We are facing in an issue with defining a condition using XPATH.

The IDOC INVOIC02 has a segment E1EDKA1 which may repeat over multiple times in an IDoc instance, an example is shown below.

<E1EDKA1 SEGMENT="1">

<PARVW>WE</PARVW>

<PARTN>0000135257</PARTN>

<NAME1>SRI BALAJI AGENCIES (PONDY-SKO</NAME1>

<NAME2>IOC DEALERS,LAWSPET MAIN ROAD,</NAME2>

<NAME3>NEXT TO VENUS THEATRE,C -171705</NAME3>

<NAME4>KARUVADIKUPPAM,PONDY-605 008</NAME4>

<PFACH>605008</PFACH>

<ORT01>PONDICHERRY</ORT01>

<PSTLZ>605008</PSTLZ>

<LAND1>IN</LAND1>

<SPRAS>E</SPRAS>

<ANRED>M/S</ANRED>

<REGIO>PY</REGIO>

<PFORT>0042300002348246300001155100</PFORT>

<SPRAS_ISO>EN</SPRAS_ISO>

</E1EDKA1>

- <E1EDKA1 SEGMENT="1">

<PARVW>BK</PARVW>

<LIFNR>4100</LIFNR>

<NAME1>INDIAN OIL CORPORATION LIMITED</NAME1>

<NAME2>TAMIL NADU STATE OFFICE</NAME2>

<ORT01>CHENNAI</ORT01>

<COUNC>TN</COUNC>

<LAND1>IN</LAND1>

<REGIO>TN</REGIO>

</E1EDKA1>

The condition that we want to check is as follows:

If in the segment E1EDKA1, PARVW= WE and in the same occurrence of the segment, field REGIO=TN then process the message.

For this I have created the XPATH expression as shown below:

(/INVOIC02/IDOC/E1EDKA1/PARVW = WE AND /INVOIC02/IDOC/E1EDKA1/REGIO = TN)

So as per the rules, the message above should not be processed because it has REGIO=PY for the segment where PARVW=WE.

But since in the other occurrence of segment E1EDKA1, REGIO=TN exists and even though PARVW=BK for that segment, the system accepts this as a positive event and processes the message.

Is there anyway we can tell XI that it should look for REGIO field of the same occurrence and not in any other occurrence of the segment E1EDKA1. Or is there any better way of processing this condition?

Any help will be highly appreciated.

Regards,

Praveen Kumar

Accepted Solutions (1)

Accepted Solutions (1)

RKothari
Contributor

Hello,

Please try the Xpath expression, as

(/INVOIC02/IDOC/E1EDKA1[(PARVW = 'WE' and REGIO = 'TN')])

Br,

Rahul

Former Member
0 Kudos

Thanks Rahul. It works.

Praveen

Answers (0)