cancel
Showing results for 
Search instead for 
Did you mean: 

Conditions in Xpath (Receiver determination)

Former Member
0 Kudos

Hi,

I have to check for a condition which looks like

(MAT_NO = 00 OR MAT_NO = 01 OR MAT_NO = 02) AND ( MAT_TYPE = GS OR MAT_TYPE = GP OR MAT_TYPE = GD)

I tried checking this condition in the condition editor in receiver determination. But what happens is when i specify the AND condition it encapsulates it with only the previous condition i.e. (MAT_NO = 00 OR MAT_NO = 01 OR (MAT_NO = 02 AND MAT_TYPE =GS).

Is there any way i can achieve this condition. Is there any Xpath function that i can use in the expression editor to do OR conditions on the same field.

with Regards

VasS

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

Write a whole XPATH expression in one line. You can put your brackets the way you need it. Use operator EX for this purpose.

Assume the parent node of MAT_NO and MAT_TYPE is PARENT, the you can write:

PARENT[(MAT_NO ="00" or MAT_NO ="01" or MAT_NO = "02") and ( MAT_TYPE = "GS" or MAT_TYPE = "GP" or MAT_TYPE = "GD")]

Regards

Stefan

Message was edited by: Stefan Grube

Former Member
0 Kudos

Hi Stefan,

Have you tried this solution? I have tried this earlier. It doesn't work.

My condition in the condition editor looks as follows

(/p1:MT_INPUT/ITEM[(SAP_ID = "00" OR SAP_ID = "01")] EX )

ITEM is my parent node and SAP_ID is the field the value of which i wanted to check.

with Regards

VasS

stefan_grube
Active Contributor
0 Kudos

My mistake: operators in capitals are not allowed.

http://www.w3schools.com/xpath/xpath_operators.asp

Write <i>or</i> instead of <i>OR</i>.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

That's the final touch.It works.

Thanks for your reply.

with Regards

VasS

Shabarish_Nair
Active Contributor
0 Kudos

Hi Stefan,

Could you look into this thread. I would appreciate your help on this.

Regards,

Shabarish

Former Member
0 Kudos

Hi Vasagam,

I believe you can acheive this functionality using <a href="http://help.sap.com/saphelp_nw04/helpdata/en/43/a5f2066340332de10000000a11466f/content.htm">Enhanced receiver determination</a>.

The idea is in your Message Mapping have a condition u specified in your post and based on that populate the RECEIVER Name in the <Receivers> structure of (The message interface ReceiverDetermination is in the Integration Repository in the software component SAP BASIS (namespace http://sap.com/xi/XI/System)

This facility is available from SP 16 onwards.

Hope this helps.

Regards,

Ananth

Former Member
0 Kudos

Hi Ananth,

Thanks for your reply. But i think you got me wrong. You are talking about Dynamic receiver determination where in the name of the receivers can be determined dynamically at runtime. But my Question is on Conditions to be given in Condition editor to determine the receivers.

Hi vijaya,

Even i thought of that approach in the beginning. But you know the conversion of OR AND logic to AND OR logic yields more number of conditions...

say if the condition is ( MAT1 = 00 Or MAT1 = 01 OR MAT1 = 02) AND ( MAT1 = 00 Or MAT1 = 01 OR MAT1 = 02) then i have to specify 9 conditons for this . Since my condition involves more fields it would become very complex.

Hi shabs,

I have done it by flag setting now. What i was trying is to stop the execution of the interface so that it doesn't enters the BPM.

Regads

VasS

Former Member
0 Kudos

Hi

for your refernce abt XPATh jus chk out this link

http://www.w3schools.com/xpath/default.asp

regards

jithesh

Former Member
0 Kudos

Hi,

just check out this blog wher they have given two conditons in the condition editor with the same field with differnt values

/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers

regards

jithesh

Shabarish_Nair
Active Contributor
0 Kudos

hi vass,

I tried some workarounds but dint help much ...

Maybe u sud handle it in your mapping itself and set a field and finally check that in your Recv. Detr. !!

Former Member
0 Kudos

Hi Jithesh,

The condition is a big conditon(it has got more fields to come in the same sequence) . i have just shown the format of that. And for the entire condition

(MAT_NO = 00 OR MAT_NO = 01 OR MAT_NO = 02 ) ANd (...) AND(...)...

i have to select only one receiver. If this conditon fails i should stop the execution of the interface.

Is it possible in Xpath to check the OR conditions directly?

regards

VasS

Former Member
0 Kudos

Hi,

Please can you try

(MAT_NO = 00 and MAT_TYPE = GS )or (MAT_NO = 01 and MAT_TYPE = GS ) or (MAT_NO = 02 and MAT_TYPE = GS ) and then the rest of it.

Regards

Vijaya

Former Member
0 Kudos

Hi

If you want to stop the interface execution if the condition fails, you have write conditions on the root level context.If you write condition on the lower level of the context only that perticular level will not be executed. In this situations i guess you have to go to BPM.

Thanks

Gowri K