cancel
Showing results for 
Search instead for 
Did you mean: 

Information Steward Rule to validate if a value exists

james_starbuck95
Explorer
0 Kudos
1,180

We have a business requirement to check all Customer Records to validate that a particular Relationship Type is on each account. How do we do a rule to validate that ZBUR008 exists in the RELTYP field of the custom record no matter what other values are in the table?

View Entire Topic
MarcusZwirner
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi James,

if
  • the connection for the lookup table (the table where the relationships are stored) is "CONN1" and
  • the lookup table is called CUSTOMER_RELATIONSHIPS and
  • the column for the customer number on the lookup table is CUSTOMER_NO and
  • the column for the relationship type is RELTYPE and
  • the rule parameter is $cust_number
then the rule syntax would be:
IF ( lookup('CONN1', 'CUSTOMER_RELATIONSHIPS','CUSTOMER_NO', $cust_number, 'RELTYPE', 'ZBUR008', 'CUSTOMER_NO', 'null') is null )
RETURN FALSE;
ELSE
RETURN TRUE;
The lookup function would return the column CUSTOMER_NO from the lookup table if there is a row with CUSTOMER_NO=$cust_number and RELTYPE='ZBUR008'.
If there is no such row, the lookup function would return null.
And with that the rule would return false (if no such row exists) or true (if a row exists).
For more details please refer to https://help.sap.com/docs/SAP_INFORMATION_STEWARD/f0171f9321f243838f94a0032f829065/57a909786d6d1014b....

Another option could be the exists function, which is quite similar (details: https://help.sap.com/docs/SAP_INFORMATION_STEWARD/f0171f9321f243838f94a0032f829065/57a8b3c86d6d1014b...).
For the example above the rule syntax would be:
RETURN exists('CONN1', 'CUSTOMER_RELATIONSHIPS','CUSTOMER_NO', $cust_number, 'RELTYPE', 'ZBUR008');
Best regards
Marcus
0 Kudos

Hi Marcus,

I have one question regarding the exists function. Is it also possible to perform the exists check with a like operator in front of the parameter?
Here this is what I am trying to develop

Whenever the value for Source Value 1 and Shortdescription is exactly the same/matching then the rule works fine. But entries should also be found if the source value 1 is only part of a string in the parameter

Here is some background information:
I give the business an Excel sheet in which they can enter various material desc. values which if they are included in the source data, will leads to the fact that these entries are considered as incorrect.

For example, the material description could say: "Unusable". If this exact same value is also entered in my Excel or here a view then I find a match via "exists" check. However, if the source data contains "Unusable123", the logic does not work.

With pattern, regex etc. I could not find a solution.


Hope you can help me on that 🙂
Thanks in advance!

KR

Lukas