cancel
Showing results for 
Search instead for 
Did you mean: 

Qualified Tables - Loop with Expression

Former Member
0 Kudos

Hi Experts,

Is there any way to setup a validation to loop over qualified links and check if a specific field has a value (not being NULL)?

For example I have the following qualified links of qualified table Location Data for a Main Table Record (Material), with two fields Plant and Purchasing Group. Plant is Non-Qualifier and Purchasing Group is Qualifier and a lookup field into the table Purchasing Group.

Plant: 3100

Purchasing Group: NULL

Plant: 2100

Purchasing Group: 12

..

I want to set up a validation to loop over all qualified links and check wether Purchasing Group is set. If one of them is not set I want to display a warning on record save.

Anybody know if this is supported?

Thanks,

Ingo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ingo,

I am assuming the following requirement:

You want to throw a validation error when your qualifier(Purchasing Group) is NULL.

If this the case then we can have a validation as described below for the qualified link.

Step1. In Data Manager select Main Table as Current table and go to Validations Tab.

Step2. Create a validation expression by Using Function IS_NOT_NULL() and then Go to Fields drop down and select the Qualified Table --> Qualifier (Purchasing Group).

Suppose if your Qualified table is "Test" and Qualifier is "Purchasing Group" then the expression will look like IS_NOT_NULL(Test.Purchasing Group).

The other properties like "Error Message", "Automatic Execution" will vary as per your requirement

Try this out and let me know.

Thanks and Regards,

Sagar Sonje

Mark Helpful Answers

Former Member
0 Kudos

Hi Sagar,

Thanks for your suggestion!

I'm creating a validation with the expression

IS_NOT_NULL(Location.Purchasing Groups.[Record]) (it's a lookup table)

Assume you have two qualified links for the material. When you are validating with the expression above it just checks if the Purchasing Group of the first link is NOT NULL.

What I want to do is to check whether in any of all the qualified links Purchasing Group is not set.

Try it out.

Ingo

Former Member
0 Kudos

The solution that Sagar gave works only for versions PRIOR to MDM SP06 Patch 0. Here is a brief extract from the MDM SP06 Release notes.

Starting with MDM 5.5 SP6 Patch 0, the IS_NOT_NULL() function requires that all the

qualifier values for a qualified field have NULL values in order to return the value FALSE.

In the past, the value FALSE was returned if any of the qualifier values for a field had

NULL values. This change in behavior means that users can now use IS_NULL() to test

whether some of the qualifier values of a qualified field are NULL. They can also use

IS_NOT_NULL() to test whether all the qualifier values of a qualified field are NULL.

This document is available on [marketplace|https://websmp106.sap-ag.de/~sapidb/011000358700001124542007E]

Thanks

Former Member
0 Kudos

Hi,

I'm on SP05 and the solution Sagar gave is not working. It just checks if the first link has the value to be validated, not the entire set of links.

As the extract you quoted states it seems to work as expected from SP06 onwards. Did somebody try this out on SP06, does it work?

Thanks,

Ingo

Answers (0)