cancel
Showing results for 
Search instead for 
Did you mean: 

receiver determination condition: combine substring with contains (XPATH?)

Former Member
0 Kudos

Hi everybody,

how can I combine substring with contains?

The following does not work

/ns1:MYINTERFACE[contains(substring(/ns1:MYINTERFACE,1,90),'STRINGTOSEARCH')]

Thanks, Regards

Mario

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

sorry, got no time to test it

Regards

Mario

Former Member
0 Kudos

Hi Mario,

I feel that u have requirement that if a specified character or substring exist in your field then you have to determine the Receiver.

In stead of contains same functionality u can achieve by writng whole XPATH expression in one line and use the EX operator for this purpose

/ns1:MYINTERFACE[contains(substring(/ns1:MYINTERFACE,1,90)] and then use the EX operator

You can go through this link which will give u detail insight

/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination

Regards,

Saurabh

Former Member
0 Kudos

Hi all,,

thanks for the replies.

But both suggestions do not work.

I also need a negation like this:

/ns1:MYINTERFACE[not(contains(substring(/ns1:MYINTERFACE,1,90),'STRINGTOSEARCH'))]

And I need to examine the substring not the whole string.

Regards Mario

Former Member
0 Kudos

Hi Murali,

As per my undrstanding you have a segment MYINTERFACE . In which there is a field name say X

Now you want to check that the first 90 character of the value of X does not contains a particular Straing say 'STRINGTOSEARCH' then you have to determine the receiver .

If my understanding is right

then you can use this in XPATH

/ns1:MYINTERFACE[ not(contains(substring(X,1,90),'STRINGTOSEARCH'))]

come out of XPATH

and then use the EX operator you can also check for = operator and put value false in right operand of conditon editor

Regards,

Saurabh

Former Member
0 Kudos

Hi Saurabh,

your are almost rigth.

But the Interface has no child nodes:

<?xml version="1.0" encoding="utf-8"?>

<ns1:VV2_SIMPLE xmlns:ns1="http://sap.com/xi/ISU-IDEX-GE/VV2">UNA:.? &apos;UNBUNOC:39900ssss005:500990sssssss07:500091221:1336000002204809+VL&apos;UNH000002204809MSCONS:D:04B:UN:2.1a&apos;BGM7::50000022048099&apos;DTM137:200912211336:203&apos;NAD</ns1:VV2_SIMPLE>

But your XPATH gives a String back, not a boolean. So it is not working with EX

Regards Mario

Former Member
0 Kudos

Have you tried :

/ns1:VV2_SIMPLE\[not(contains(substring(node(),1,90),'YOUR_STRING'))\] EX ?

Chris

Edited by: Christophe PFERTZEL on Jan 14, 2010 5:59 PM

former_member200962
Active Contributor
0 Kudos

Why not include the STRINGTOSEARCH as the right operand in the condition editor and the middle operand will be equalto sign.

I think I got your question wrong

/ns1:MYINTERFACE[contains(substring(/ns1:MYINTERFACE,1,90),'STRINGTOSEARCH')]

The above should not work because you have used MYINTERFACE at both the places.....the first occurence is fine (MYINTERFACE seems to be the root node of source message) but the second occurence should be the name of the node on which you want to apply the substring.....can you paste the source structure?

Regards,

Abhishek.

Edited by: abhishek salvi on Jan 14, 2010 7:34 PM