Skip to Content
avatar image
Former Member

Xpath expression not working in Interface Determination


Hi,

I have a scenario where 1 source file will be containing multiple IDocs and based on certain conditions 5 different files should be created. I am using xpath to define these conditions in Interface Determination. Xpath is working for 4 files but it is not working for one particular file. It is creating this particular file even when the condition is not satisfied.

Xpath expression:

/ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL[STAT = "I0002" and (STAT != "I0009" or STAT != "I0010" or STAT != "I0012" or STAT != "I0074" or STAT != "I0076")]

File should be created if STAT has "I0002" and should not have any of "I0009", "I0010", "I0012", "I0074", "I0076".

Idoc segment structure is like:

<E1JSTKL SEGMENT="1">

            <STAT>E0001</STAT>

            <STSMA>Z0000006</STSMA>

         </E1JSTKL>

         <E1JSTKL SEGMENT="1">

            <STAT>I0002</STAT>

         </E1JSTKL>

         <E1JSTKL SEGMENT="1">

            <STAT>I0004</STAT>

         </E1JSTKL>

         <E1JSTKL SEGMENT="1">

            <STAT>I0010</STAT>

         </E1JSTKL>

         <E1JSTKL SEGMENT="1">

            <STAT>I0016</STAT>

         </E1JSTKL>

         <E1JSTKL SEGMENT="1">

            <STAT>I0028</STAT>

         </E1JSTKL>

         <E1JSTKL SEGMENT="1">

            <STAT>I0215</STAT>

         </E1JSTKL>

         <E1JSTKL SEGMENT="1">

            <STAT>I0291</STAT>

         </E1JSTKL>

         <E1JSTKL SEGMENT="1">

            <STAT>I0361</STAT>

         </E1JSTKL>

Each IDoc in the file would have similar segment occurrence.

Would appreciate any help on this.

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    Jul 23, 2014 at 12:42 PM

    >>>STAT != "I0009" or STAT != "I0010" or STAT != "I0012" or STAT != "I0074" or STAT != "I0076")

    Change the or to and as it should not have any of the above values.(-ve condition)

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Hareesh Gampa

      Hi Haressh,

      Tested for below condition but still same issue.

      /ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL[(STAT = "I0002") and (STAT != "I0009") and (STAT != "I0010") and (STAT != "I0012")and (STAT != "I0074") and (STAT != "I0076")]EX

      Thanks!

  • Jul 24, 2014 at 03:57 AM

    Hi Vandita,

    I think for your requirement you need to use enhanced receiver determination since you need to check every content of the STAT field.

    Regards,

    Mark

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member


      Hi Mark,

      Sorry for late reply. But i tried with Extended Receiver Determination along with multimapping and it worked in my case.

      Thanks!

  • avatar image
    Former Member
    Jul 23, 2014 at 02:50 PM

    Hi.

    Just to check. Are the namespace and prefix correct defined in the Expression Editor?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 23, 2014 at 03:50 PM

    Hi,

    Did you check the checkbox "Multiline"? I hope you might have done it. Or please try to create the expression like below

    (STAT = A AND STAT != B) or (STAT = A AND STAT != C) .....

    Regards,

    Naresh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Naresh,

      Multiline option is checked. Also tested with the condtion you suggested (mentioned below), but file is still created whn condition is not satisfied.

      /ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL[(STAT = "I0002" and STAT != "I0009") or (STAT = "I0002" and STAT != "I0010") or (STAT = "I0002" and STAT != "I0012") or (STAT = "I0002" and STAT != "I0074") or (STAT = "I0002" and STAT != "I0076")] EX

      Thanks!

  • Jul 23, 2014 at 09:11 PM

    Hi

    Instead of using an EXpression please try putting them directly as separate conditions.

    /ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL/STAT = I0002  AND

    /ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL/STAT != I0009   AND

    /ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL/STAT != I0010   AND

    and so on...



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Karanam Trivikram

      Hi Karanam,

      PFB the condition which i have tested.

      (/ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL/STAT = I0002 AND /ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL/STAT ≠ I0009 AND /ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL/STAT ≠ I0010 AND /ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL/STAT ≠ I0012 AND /ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL/STAT ≠ I0074 AND /ZLOIPRO03EXT/IDOC/E1AFKOL/E1JSTKL/STAT ≠ I0076)

      For scenario where file should not be created, it is working fine. But for scenario where file should be created it is not working. PFB snapshot of the inputfile for which condition is failing.

        <E1JSTKL SEGMENT="1">

                  <STAT>I0002</STAT>

               </E1JSTKL>

               <E1JSTKL SEGMENT="1">

                  <STAT>I0016</STAT>

               </E1JSTKL>

               <E1JSTKL SEGMENT="1">

                  <STAT>I0028</STAT>

               </E1JSTKL>

               <E1JSTKL SEGMENT="1">

                  <STAT>I0215</STAT>

               </E1JSTKL>

               <E1JSTKL SEGMENT="1">

                  <STAT>I0236</STAT>

               </E1JSTKL>

               <E1JSTKL SEGMENT="1">

                  <STAT>I0291</STAT>

               </E1JSTKL>

               <E1JSTKL SEGMENT="1">

                  <STAT>I0321</STAT>

               </E1JSTKL>

               <E1JSTKL SEGMENT="1">

                  <STAT>I0361</STAT>

               </E1JSTKL>

               <E1JSTKL SEGMENT="1">

                  <STAT>I0485</STAT>

               </E1JSTKL>

      Thanks!

  • avatar image
    Former Member
    Jul 24, 2014 at 10:54 AM

    Hi Vanditha

    Instead of (STAT != "I0009") and (STAT != "I0010").........

    can you try with !(STAT = "I0009") and !(STAT = "I0010")..........

    and see if it is working



    Regards

    Osman

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Ryan Crosby

      Hi Ryan,

      Tested this condition but it is not creating file for scenarios where condition is satisfied and file should be created.

      Thanks!