cancel
Showing results for 
Search instead for 
Did you mean: 

XPATH and Receiver Determination

Shabarish_Nair
Active Contributor
0 Kudos

In Reference to forum thread :

Suppose I have MT as

MT_Pickfile

|_Header

|_Body

|_Trailer

And i need to check;

(field3 = "100" or field3 = "200" or field3 = "300" ) and(field5 = "AA" or field5 = "BB" or field5 = "CC")

field3 is in Header and field5 is in Body

I tried giving

/p1:MT_Pickfile/Header[(field3 = "100" or field3 = "200" or field3 = "300" )] and /p1:MT_Pickfile/Body[(field5 = "AA" or field5 = "BB" or field5 = "CC")] EX

It doesnt work. But then if both field3 and field5 are in Header then it works (as had been the case in the above mentioned thread which Stefan Grube replied to) i.e. to say

/p1:MT_Pickfile/Header[(field3 = "100" or field3 = "200" or field3 = "300" )] and [(field5 = "AA" or field5 = "BB" or field5 = "CC")] EX

Can anybody put in their suggestions ?

Thanx in Advance,

ShaBZ

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

Hi Shabarish,

It is not possible to have <i>and</i> or <i>or</i> outside the brackets <i>[]</i>.

Try following:

/p1:MT_Pickfile[(Header/field3 = "100" or Header/field3 = "200" or Header/field3 = "300" ) and Body/field5 = "AA" or Body/field5 = "BB" or Body/field5 = "CC")]

Another idea:

Write two lines in receiver determination (use insert expression):

1. line:

/p1:MT_Pickfile/Header[(field3 = "100" or field3 = "200" or field3 = "300" )]

2. line

/p1:MT_Pickfile/Body[(field5 = "AA" or field5 = "BB" or field5 = "CC")]

Hope that helps

Stefan

MichalKrawczyk
Active Contributor
0 Kudos

hi,

when you used " field5 is in Body"

did all field5s (all in body) had the same value?

if not maybe try deselecting multiline check

in the condition editor for field5 and check then?

did you try that?

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Shabarish_Nair
Active Contributor
0 Kudos

I did try that Mike but no help !!!

MichalKrawczyk
Active Contributor
0 Kudos

but do you want to test all of the first one for example ?

if the first one try [1] at the end of xpath

maybe this will help

Regards,

michal

Shabarish_Nair
Active Contributor
0 Kudos

/p1:MT_Pickfile/Header[(field3 != "100")] and /p1:MT_Pickfile/Body[(field5 != "AA")] i even tried with just a simple condition ... seems when it comes to two nodes things dont work out well ....

Former Member
0 Kudos

Hi Shabarish,

Have u gone through Enhanced Receiver Determination feature in SP 16.It will be helpful when you want to do complex calculations on your conditions in receiver determination.

<a href="/people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16">/people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16</a>

Regards,

Sudharshan.

Shabarish_Nair
Active Contributor
0 Kudos

Hi Stefan,

Thanx for the input ... i will try and put that to work !!!

Besides on a performance front would handling complex conditions in XPATH be a performance constraint ?

ShaBZ

Former Member
0 Kudos

Hi ShaBZ,

i have used one XPATH like

/p1:DEBMAS01/IDOC/E1KNA1M[(E1KNVVM/VKORG = "UA01" and E1KNVVM/VTWEG = "01" and E1KNVVM/SPART = "01")]

but its not working? can you please help me in this?

Thanks in advance,

-Kanth.

stefan_grube
Active Contributor
0 Kudos

Try without p1:

IDOC XML has no namespace.

Stefan

Former Member
0 Kudos

Hello Stefan,

Here the outbound IDOC can gave multiple E1KNVVM segments.

But i need to put a condition on first segment.

Should i check "Multiline" chk box?

I tried without p1, but its not working again!!

regards,

-Kanth.

stefan_grube
Active Contributor
0 Kudos

For XPATH rules check this links:

www.w3schools.com/xpath

Here you find what to do for retrieving the first occurrence of the node.

To compare the field within the same parent node, it is better to do so:

/DEBMAS01/IDOC/E1KNA1M/E1KNVVM[(VKORG = "UA01" and VTWEG = "01" and SPART = "01")]

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

Thank you very much for your reply.

Does "Multiline" play any role or have any impact in the condition validation?

Should i check it or not in this case?

Here E1KNVVM can be multiple.

But i have to put condition on the first segment.

Thanks and regards,

-Kanth

stefan_grube
Active Contributor
0 Kudos

From what is written in online help:

http://help.sap.com/saphelp_nw04/helpdata/en/ab/13bf7191e73a4fb3560e767a2525fd/frameset.htm

I would say: Yes, you have to check "multiline".