cancel
Showing results for 
Search instead for 
Did you mean: 

X Path Configuration in SAP PI

vijender_p
Active Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member190293
Active Contributor

Hi Vijender!

Try this:

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

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

Regards, Evgeniy.

vijender_p
Active Participant

Thanks a lot Evgeniy !

It is Working 🙂

Regards,

Vijender

Answers (2)

Answers (2)

vijender_p
Active Participant
0 Kudos

Hi Moritz,

Thanks a lot for reply ,

but it is still failing 😞

Please Find the attachment of my change



Regards,


Vijender

MoritzFeuerbach
Explorer
0 Kudos

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.

MoritzFeuerbach
Explorer
0 Kudos

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