cancel
Showing results for 
Search instead for 
Did you mean: 

combine search filed with a OR condition / code of search

Former Member
0 Kudos

Hi,

is there a way to combine two or more fields in a search (freeform, named or mask) with a OR condition instead of the standard AND condition ?

What I I am looking for is something like this sample as code:

- (Supplier = 'ABC' ) OR (produktid = 123)

- (Supplier = 'ABC' and fieldA=1) OR (produktid = 123)

Is it also possible to have a code for a search like in sql ? Look like we have a field code in a namedsearch but not sure if it is interpreted in a way like thiis.

Kind Regarads

Bernd

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bernd,

is there a way to combine two or more fields in a search (freeform, named or mask) with a OR condition instead of the standard AND condition ?

What I I am looking for is something like this sample as code:

- (Supplier = 'ABC' ) OR (produktid = 123)

- (Supplier = 'ABC' and fieldA=1) OR (produktid = 123)

Yes you can combine filtering criteria in MDM too.

You can use nested IF condition for this and also OR and AND functional gates are available which can serve your purpose.

Another way this can be achieved by defining a Validation group consisting of multiple validations,this Group can help where you have requirement of AND gate.

e.g.Using nested IF

IF(Cond1,IF(Cond2,TRUE),FALSE)

This can serve you when you want to combine 2 conditions in AND gate.

For cases where you need OR,you have OR in the Message editor which you can use to get OR gate condition.

Hope this helps!

Thanks,

Ravi

Former Member
0 Kudos

Hi Ravi,

thanks for your answer. Is there a How_to available ?

I've to use a namedSearch and it would be great if I can use a nested IF like in your description.

Bernd

Former Member
0 Kudos

Hi Bernd,

Nested if give simple and give consistent results.

The flow goes like -

2 If's with 2 segments each make 4 cases.

They are:

If condition one is true and 2nd is false,its False.

If condition 1 is true and condition 2 is true,its True.

If condition one is False,False.

If both are false its like the same condition as above for the loop.

The following links can be useful to you:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b025fab3-b3e9-2910-d999-a27b7a075...

and the best one :

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/102dc4e5-07c9-2910-93b3-f49c8ed52...

Thanks,

Ravi

Former Member
0 Kudos

Hi Ravi,

thanks for you info but who can I bind a nested IF condition or validation to a NamedSearch ?

Bernd

Former Member
0 Kudos

Hi Bernd,

thanks for the update.

You cannot combine validations with Namedsearches.

Can you please detail what exactly you want to achieve?

Do you want to have namedsearches in combination to some more filters?

What are those filters like?

Thanks,

Ravi

Former Member
0 Kudos

Hi Ravi,

we are using the SRMMDM repository and have Services (Product with contract) and materials. (products with contract) in teh repository. Actually we are using NamedSearch when the SRM or SUS is using the repository. The request is to have a a couple of NamedSearch who list combination of Services and Materials based on contracts and other information in the repository. Problem is that these combination can only be create by having a OR-condition.

My idea was to use something like a validation (nested IFs as code) in the NamedSearch and therefor to get this OR condition as nested IFs or something like this.

But It lokks like this is not possible

Bernd

Former Member
0 Kudos

Hi Bernd,

Try using Expressions editor in Free Form Search,here you can define your complex search criteria and then save this.

Data Manager guide has detailed syntax of each of the functions.

This should solve the problem in hand.

Thanks,

Ravi

Former Member
0 Kudos

Hi Bernd,

But It lokks like this is not possible

You can do it. For this, you can write this expression in expression column under free-form search and then can save this search criteria in your Named Search which should solve your problem.

Kindly revert with result.

Regards,

Mandeep Saini

Former Member
0 Kudos

HI Mandeep,

yes I've seen the expression editor for a search but I can't select field from the main table to build a expression like in expression for validations. Also a codeblock from an validation expression is not work like

fieldA = "test"

Any idea who to get access to fields of the main table in expression for free form search.

Bernd

Former Member
0 Kudos

Hi Bernd,

This is not true. In free form search Expression when you double click on Value, a search expression comes. Here, you have field tab which shows the fields of the main table.

Kindly let me know if you still dont able to get main table fields, i give you alternative.

Regards,

Mandeep Saini

Former Member
0 Kudos

Hi Bernd,

It works in the same way as Validation expression does.

Please revert with your findings.

Thanks,

Ravi