Skip to Content

X Path Configuration in SAP PI

HI All ,

I have a small doubt what to use in the Xpath configuration for my requirement !

Requirement : we have to split the file by Infotype 45 , so in the IDOC if Infotype 45 exist there should be one file name or else another should occur .

So I have used the X path Configuration :

/ZHRMD_XX01/IDOC/E1PLOGI/E1PITYP[count(Z1P0045) = 0]

/ZHRMD_XX01/IDOC/E1PLOGI/E1PITYP[count(Z1P0045) > 0]

with the Operation as EX .


But the Logic is failing :(



Please Help me where exactly am doing wrong .

Regards,

Vijender

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jul 13, 2017 at 03:02 PM

    Hi Vijender!

    Try this:

    /ZHRMD_XX01[count(IDOC/E1PLOGI/E1PITYP/Z1P0045) = 0] EX

    /ZHRMD_XX01[count(IDOC/E1PLOGI/E1PITYP/Z1P0045) > 0] EX

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 13, 2017 at 02:18 PM

    Hi Moritz,

    Thanks a lot for reply ,

    but it is still failing :(

    Please Find the attachment of my change



    Regards,


    Vijender

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I see, you have lots of occurences. Try:

      //ZHRMD_XX01/IDOC/E1PLOGI/E1PITYP[not(Z1P0045)]

      //ZHRMD_XX01/IDOC/E1PLOGI/E1PITYP/Z1P0045

      Could you please specify which output you expect and which one you get?

      EDIT: Maybe "//Z1P0045" would be enough? This way you would get true if the element exists somewhere in the document. I am not sure though about the performance if messages are really big or there are lots of them.

  • avatar image
    Former Member
    Jul 13, 2017 at 01:49 PM

    Hi Vijender,

    try using the not() operator, together with EX operator:

    /ZHRMD_XX01/IDOC/E1PLOGI/E1PITYP[not(Z1P0045)]

    /ZHRMD_XX01/IDOC/E1PLOGI/E1PITYP/Z1P0045

    Also, please provide an example, so we can analyse it further.

    Regards

    Add comment
    10|10000 characters needed characters exceeded