cancel
Showing results for 
Search instead for 
Did you mean: 

match function query

Former Member
0 Kudos

Hello,

Currently I am stuck in following step.

I'm using match function inside Assignment Block. My cuurent scenario is

match( "Ramesh,David,Soham_" , "Soham" )

Even though, there is no match, the return from this function is "1" (True). I understand that match func. is able to find patten Soham but I want to match exact string.

How can I achieve that? Any help in this matter will be appreciated.

Soham

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Soham,

If you are working on MII v 12.1 or any other higher version you can make the use of "List" data type.

Refer ::http://scn.sap.com/docs/DOC-30814

If you are working on 12.0, you can use simple "stringif" function to achieve the same.

Make a note that "stringif" function can be used in any version.

Regards
Shashank Shrimal

Former Member
0 Kudos

The match function will search for any occurrence of the word and it won't treat the string as a comma separated list. I assume this is what you are trying to do?

Try using the string to xml parser action using ',' as the delimiter, this will turn your csv string to xml. You can then use an xpath expression to see if the string was in the list. In your example the xml parser will return each value in the mii xml format where each row contains a column called item. So your comparison expression will look something like:

Xmlparser.Output{count(/Rowsets/Rowset/Row[item='Soham']/item)} > 0

Former Member
0 Kudos

Hi

Match will find any string pattern inside the string.

use if( "Ramesh,David,Soham_" =="Soham" ,1,0  )

Former Member
0 Kudos

Not sure but I think you need the function 'stringif' for comparing strings:

stringif( "Ramesh,David,Soham_" =="Soham" ,1,0  )

If the two strings are an exact match, the function will return 1, otherwise 0.