Validation Engine Tests

Parent Previous Next

Overview


One or more Validation Tests can be created for each mapped field.   For each Validation Test, you must specify certain properties:


Property

Property Comments

Active

Only tests that are marked Active are executed.

Test

Choose a Test from the drop down list.

Test Parameters

Some tests accept parameters.  These are inputs or options that may be supplied to a Test.


The definition and usage of all Tests, including use of Test Parameters, is found here: Validation Engine Tests


When more than one parameter is accepted to a test, then the parameters are separated by a vertical pipe character ( | ).

Test Failure Message

This is the message that will appear in a tool tip or report when the test fails.


The test failure message can be a simple text, such as:


Mandatory Entry; 10 Digits.


A test failure message can also include values, including values dynamically included from other SEGMENTS and FIELDS.


For example, consider a mapping project for Customer Master and fields in the Company Code segment of the project (segment E1KNB1M). Tolerance Group (TOGRU) is an example of a field that may be validated with a Database Lookup test, but the lookup depends on the value supplied for Company Code.  It would be helpful to include the value of the company code in the test failure message.


Here's an example test failure message with the syntax to include the Company Code value:


Value Not Found In Table T043G, Field TOGRU for Company Code [[E1KNB1M-BUKRS]].


Notice the SEGMENT-FIELD name enclosed in double square brackets.  When this part of the test failure message is included in a tool tip or report, the SEGMENT-FIELD name enclosed in double square brackets will be replaced by the last value found in that SEGMENT-FIELD.   Thus, if the last Company Code supplied in segment E1KNB1M-BUKRS was 1000, the displayed test failure message would be:  

Value Not Found In Table T043G, Field TOGRU for Company Code 1000.




Summary of Tests


Test

Test Description

ValueBegins

Tests a string VALUE to determine if it begins with any one of a list of characters. The test is a non-case-sensitive string comparison.  If the VALUE begins with any one of the characters in the list then the test is True.

ValueBetween

Compares a numeric VALUE against a LOW and HIGH value.   If the VALUE is >= the Low Value and <= the High Value, then the test is True

ValueContains

Tests a string VALUE to determine if it contains any one of a list of characters. The test is a non-case-sensitive string comparison.  If the VALUE contains any one of the characters in the list then the test is True.

ValueEnds

Tests a string VALUE to determine if it ends with any one of a list of values. The test is a non-case-sensitive string comparison.  If the VALUE ends with any one of the values in the list then the test is True.

ValueGreaterThan

Compares a numeric VALUE with a MIN parameter.  If the VALUE > MIN then the test is True.

ValueInPickList

Tests a string VALUE to determine if it is a member of a list of values derived from a database. The test is a non-case-sensitive string comparison.  If the VALUE is found in the list of values returned from the database then the test is True.

ValueIs

Tests a string VALUE to determine if it is a match for any of the supplied parameters. The test is a non-case-sensitive string comparison.  If the VALUE is the same as any one of the supplied parameters then the test is True.

ValueIsDate

Tests a string VALUE to determine if it is a date value.  If the value is a date value then the test is True.

ValueIsEmpty

Tests a string VALUE to determine if it is null or zero length.  If the VALUE is found empty or null then the test is True.  Use this test to ensure that field is left blank.

ValueIsGTIN

If a value is supplied then the test checks whether the supplied VALUE is numeric, is not all zeros, and whether the last character is a valid MOD 10 check digit.

ValueIsLength

Tests the length of a VALUE.  If the length of the VALUE = LENGTH then the test is True.

ValueIsNot

Tests a string VALUE to determine if it is not a match for any of the supplied parameters. The test is a non-case-sensitive string comparison.  If the VALUE is not the same as all of the supplied parameters then the test is True.

ValueIsNotEmpty

Tests a string VALUE to determine if it is null or zero length.  If the VALUE is found empty or null then the test is False.  Use this test to ensure that field is not left blank.

ValueIsNumeric

Tests a value to determine if it is numeric.  If the VALUE is numeric then the test is True.

ValueIsNumericOrEmpty

Tests a value to determine if it is numeric or empty.  If the VALUE is numeric or empty then the test is True.

ValueIsPattern

Using regular expressions, tests if a value matches a pattern of characters.  

ValueMaxLength

Tests a string VALUE to determine if it is more than MaxValue characters long.  The test ignores trailing spaces.

ValueMinLength

Tests a string VALUE to determine if it is at least MinValue characters long.  The test ignores trailing spaces.

ValueNotCr

Tests a string VALUE to determine if it contains a carriage return (ASCII 10).  If the VALUE does not contain a carriage return then the test is True.  

ValueNotZero

Tests a string VALUE to determine if it is zero.  If the VALUE is numeric and not zero then the test is true.  Use this test to ensure that field is not 0.

ValueZero

Tests a string VALUE to determine if it is zero.  If the VALUE is numeric and is zero then the test is True.  Use this test to ensure that a field has a value of 0.




Detail of Tests


TEST:  ValueBegins

Description

Tests a string VALUE to determine if it begins with any one of a list of values. The test is a non-case-sensitive string comparison.  If the VALUE begins with any one of the values in the list then the test is True.

Parameter 1

List:  A pipe delimited list of values.

Example

Example: To check that a VALUE begins with CAT or MERCH, use TEST_PARAMS:  CAT|MERCH



TEST:  ValueBetween

Description

Compares a numeric value against a LOW and HIGH value.   If the VALUE is >= the Low Value and <= the High Value, then the test is True.

Value

The value must evaluate as data type Double.

Parameter 1

Low Value:  A numeric value.  Data type: Double

Parameter 2

High Value:  A numeric value.  Data type: Double

Example

Example: To check that a VALUE is between 1 and 10, use TEST_PARAMS:  1|10



TEST:  ValueContains

Description

Tests a string VALUE to determine if it contains any one of a list of characters. The test is a non-case-sensitive string comparison.  If the VALUE contains any one of the characters in the list then the test is True.

Parameter 1

List:  A pipe delimited list of single character values.

Example

Example: To ensure that a VALUE contains either an A or a Z, use TEST_PARAMS:  A|Z



TEST:  ValueEnds

Description

Tests a string VALUE to determine if it ends with any one of a list of values. The test is a non-case-sensitive string comparison.  If the VALUE ends with any one of the values in the list then the test is True.

Parameter 1

List:  A pipe delimited list of values.

Example

Example: To check that a VALUE ends with CAT or MERCH, use TEST_PARAMS:  CAT|MERCH



TEST:  ValueGreaterThan

Description

Compares a numeric VALUE with a MIN parameter.  If the VALUE > MIN then the test is True.

Parameter 1

MIN Value:  A numeric value.  Data type: Double

Example

Example: To ensure that a VALUE is greater than 0, use TEST_PARAMS:  0



TEST:  ValueInPickList

Description

Tests a string VALUE to determine if it is a member of a list of values derived from a database. The test is a non-case-sensitive string comparison.  If the VALUE is found in the list of values returned from the database then the test is True.


There are 4 scenarios for using ValueInPickList.


Scenario 1:  Simple Lookup


Parameter 1


Scenario 2:  Simple Lookup, with Options, such as VALUE is Optional


Parameter 1 and Parameter 2


Scenario 3:  Dependent Lookup


Parameter 1 and Parameter 2 and Parameter 3 and Parameter 4


Scenario 4:  Dependent Lookup, with Options, such as VALUE is Optional


Parameter 1 and Parameter 2 and Parameter 3 and Parameter 4

Parameter 1

SQL Statement:  A SQL statement that returns a single column of values.


or


TABLE-FIELD:  (e.g. LFA1-LIFNR).

Parameter 2

OPTIONS


A comma delimited list of OPTIONS may be supplied as Parameter 2.


For example, to Retain in Memory and make the tested value Optional, supply R,O as the Parameter.


The options are as follows:


R = Retain in Memory


Option R indicates that the list of values should be retained in memory after the first database lookup. This reduces database access and network traffic.


For performance reasons, the option to Retain in Memory should be used whenever possible, and especially if the database table used for the lookup contains less than a few thousand rows of data.


O = Optional


Option O indicates that the VALUE is optional.  If the VALUE is a zero-length string then the test is True without the database lookup being performed.


Pxx = Pad value with leading zeros for database comparison


Option P indicates that the VALUE should be padded with leading zeros before making the database comparison, up to the number of digits indicated by xx.  


Parameter 3

WHERE FIELD


For scenarios with Dependent Lookup, this is the name of the dependent field.  

Parameter 4

WHERE VALUE


For scenarios with Dependent Lookup, this is the value to be found in the dependent field.


To dynamically refer to the value of a previously tested field, supply the relevant SEGMENT-FIELD name surrounded by double square brackets.


For example: [[E1BPE1MATHEAD-MATL_GROUP]]

Example 1

Scenario 1:  Simple Lookup using SQL Statement


Example 1:  To test that a VALUE is one of a list of values found in a database in a database table named MST_COLOR and column COLOR, use TEST_PARAMS:  SELECT COLOR FROM MST_COLOR


Example 2:  To test that VALUES exist across three columns in a database table named /AFS/THEME, use TEST_PARAMS:  

SELECT [/AFS/THEME]
FROM J_3ASEAN
WHERE [J_3ASEAN] = '[[/AFS/DPRG_KOND2-I_SEASON]]'

AND [/AFS/COLLECTION] = '[[/AFS/DPRG_KOND2-I_COLLECTION]]'

AND [/AFS/THEME] = '[[/AFS/DPRG_KOND2-I_THEME]]'

Example 2

Scenario 1:  Simple Lookup using TABLE-FIELD


Example:  To test that a VALUE is one of a list of values found in a database in a database table named T023 and column MATKL, use TEST_PARAMS:  T023-MATKL

Example 3

Scenario 2:  Simple Lookup using TABLE-FIELD, and VALUE is Optional.


Example:  To test that a VALUE is one of a list of values found in a database in a database table named T023 and column MATKL, use TEST_PARAMS:  T023-MATKL|R,O

Example 4

Scenario 3:  Dependent Lookup


Example:  To test that a VALUE is one of a list of values found in a database in a database table named T023 and column MATKL = the Merchandise Category of the article, use TEST_PARAMS:  T023-WWGDA|R|MATKL|[[E1BPE1MATHEAD-MATL_GROUP]]

Example 5

Scenario 4:  Dependent Lookup, VALUE is Optional


Example:  To test that a VALUE is one of a list of values found in a database in a database table named T023 and column MATKL = the Merchandise Category of the article, use TEST_PARAMS:  T023-WWGDA|R,O|MATKL|[[E1BPE1MATHEAD-MATL_GROUP]]



TEST:  ValueIs

Description

Tests a string VALUE to determine if it is a match for any of the supplied parameters. The test is a non-case-sensitive string comparison.  If the VALUE is the same as any one of the supplied parameters then the test is True.

Parameter 1

List:  A pipe delimited list of values

Example

Example: To check that a VALUE is either Red, Green, or Blue, use TEST_PARAMS:  Red|Green|Blue



TEST:  ValueIsDate

Description

Tests a string VALUE to determine if it is a date value.  If the value is a date value then the test is True.

Example

n/a  - This test does not accept a parameter.



TEST:  ValueIsEmpty

Description

Tests a string VALUE to determine if it is null or zero length.  If the VALUE is found empty or null then the test is True.  Use this test to ensure that field is left blank.

Example

n/a  - This test does not accept a parameter.



TEST:  ValueIsGTIN

Description

The test checks whether the supplied VALUE is numeric, is not all zeros, and whether the last character is a valid MOD 10 check digit according to these steps:


1. Consider the right-most digit as an "odd" position, and assign odd and even alternately to each character moving from right to left.

2. Add up the digits in all odd positions, and multiply the result by 3.

3. Sum the digits in all even positions.

4. Plus together the totals calculated in steps 2 and 3.

5. The check digit is the number which, when added to the result calculated in step 4, getting a number evenly divisible by 10.

6. If the sum calculated in step 4 is evenly divisible by 10, the check digit is "0" (not 10).


If the supplied value is empty then the test returns True.

Example

n/a  - This test does not accept a parameter.



TEST:  ValueIsLength

Description

Tests the length of a VALUE.  If the length of the VALUE = LENGTH then the test is True.

Parameter 1

List:  A pipe delimited list of lengths.

Example

Example: To check that a VALUE is 10 character / spaces long, use TEST_PARAMS:  10



TEST:  ValueIsNot

Description

Tests a string VALUE to determine if it is not a match for any of the supplied parameters. The test is a non-case-sensitive string comparison.  If the VALUE is not the same as all of the supplied parameters then the test is True.

Parameter 1

List:  A pipe delimited list of values

Example

Example: To check that a VALUE is not Red, Green, or Blue, use TEST_PARAMS:  Red|Green|Blue



TEST:  ValueIsNotEmpty

Description

Tests a string VALUE to determine if it is null or zero length.  If the VALUE is found empty or null then the test is False.  Use this test to ensure that field is not left blank.

Example

n/a  - This test does not accept a parameter.



TEST:  ValueIsNumeric

Description

Tests a value to determine if it is numeric.  If the VALUE is numeric then the test is True.

Example

n/a  - This test does not accept a parameter.



TEST:  ValueIsNumericOrEmpty

Description

Tests a value to determine if it is numeric or empty.  If the VALUE is numeric or empty then the test is True.

Example

n/a  - This test does not accept a parameter.



TEST:  ValueIsPattern

Description

Using regular expressions, tests if a value matches a pattern of characters.  

Parameter 1

Pattern:  A string value

Example

To check that a VALUE contains 3 consecutive numeric characters, use TEST_PARAMS:  \d{3}

To check that a VALUE begins with 3 numeric characters, use TEST_PARAMS:  ^\d{3}

To check that a VALUE ends with 3 numeric characters, use TEST_PARAMS:  d{3}$


To check that a VALUE consists of only 3 numeric characters, use TEST_PARAMS:  ^\d{3}$

To check that a VALUE consists of only 3 non-numeric characters, use TEST_PARAMS:  ^\D{3}$


To check that a VALUE consists of only 3 characters, use TEST_PARAMS:  ^\w{3}$

To check that a VALUE consists of at least 3 characters, use TEST_PARAMS:  ^\w{3,}$

To check that a VALUE consists of only 3 to 5 characters, use TEST_PARAMS:  ^\w{3,5}$

To check that a VALUE consists of not more than 5 characters, use TEST_PARAMS:  ^\w{,5}$


^\d\d\d-\d\d\d-\d\d\d\d$ or ^\d{3}-\d{3}-\d{4}$ would be a telephone # such as 207-123-1234


To check that a VALUE is either Red or Green, use TEST_PARAMS:   ^\b(Red|Green)\b$


To check that a VALUE is either 5 digits or empty, use TEST_PARAMS:   ^\d{5}$|^$


To check that a date has a first character of 0 or 1, use TEST_PARAMS: ^[0|1]\d{1}/\d{2}/\d{4}$|^$


This is an extremely powerful and flexible test that is equally difficult to understand :-)

Reference:  Regular Expression Language Elements (.NET Framework 3.0)

http://msdn.microsoft.com/en-us/library/az24scfc(v=VS.85).aspx



TEST:  ValueMaxLength

Description

Tests a string VALUE to determine if it is more than MaxValue characters long.  The test ignores trailing spaces.

Parameter 1

MaxValue:  A numeric value

Example

To check that a VALUE is not more than 10 character/spaces long, use TEST_PARAMS:  10



TEST:  ValueMinLength

Description

Tests a string VALUE to determine if it is at least MinValue characters long.  The test ignores trailing spaces.

Parameter 1

MinValue:  A numeric value

Example

To check that a VALUE is at least 5 character/spaces long, use TEST_PARAMS:  5



TEST:  ValueNotCR

Description

Tests a string VALUE to determine if it contains a carriage return (ASCII 10).  If the VALUE does not contain a carriage return then the test is True.  

Example

n/a  - This test does not accept a parameter.



TEST:  ValueNotZero

Description

Tests a string VALUE to determine if it is zero.  If the VALUE is numeric and not zero then the test is true.  Use this test to ensure that field is not 0.

Example

n/a  - This test does not accept a parameter.



TEST:  ValueIsZero

Description

Tests a string VALUE to determine if it is zero.  If the VALUE is numeric and is zero then the test is True.  Use this test to ensure that a field has a value of 0.

Example

n/a  - This test does not accept a parameter.