Skip to Content
0

X Path Configuration in SAP PI

Jul 13, 2017 at 01:16 PM

60

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Evgeniy Kolmakov Jul 13, 2017 at 03:02 PM
1

Hi Vijender!

Try this:

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

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

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks a lot Evgeniy !

It is Working :)

Regards,

Vijender

1
Vijender Gouda Jul 13, 2017 at 02:18 PM
0

Hi Moritz,

Thanks a lot for reply ,

but it is still failing :(

Please Find the attachment of my change



Regards,


Vijender


pcnmy.png (5.0 kB)
pj1q3.png (43.3 kB)
Show 1 Share
10 |10000 characters needed characters left 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.

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

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

Share
10 |10000 characters needed characters left characters exceeded