I need some help on validation.

I need some help on validation.
I have 3 fields in main table Field1, Field2 and Field3. All lookups in some table.

If a user enter data let say in Field1 is 001 and Field2 is 002 from dropdown.
In filed3 which is also lookup into flat table Tab1. That flat table contains two fields both are display.
Mean to say while selecting data from drop down we will see like 001,002... 001,003.. 003,005 etc
So user after entering data in field1 and field2 will check that in feild3 that 001,002 exists or not.

Like in this eg. user selected 001 in field 1 and 002 in field2 so in field3 three user will select 001,002 from dropdown.
If he slects different link ..like 001,003 then validaton should fire and say that u have entered wrong link.

In short we need to verify from filed3 that we entered correct link from dropdown which is same as in field1 and field2

Field1 - 001
Field2 - 002
Field3 - 001,002 ( must be)

if Filed3 is 001,003 or say 001,004 or any other combo not in sync with filed1 and field2 there shud be a validation fire..

Need to know how i can do this in validation..


Ans:
Please use this expression - HAS_ALL_VALUES((Field3.Name1&Field3.Name2),(Field1.Name&Field2.Name))

Where,
Field1 is a field with its lookup field as 'Name'
Field2 is a field with its lookup field as 'Name'
Field3 is a field with its lookup fields as 'Name1' and 'Name2'

SAP Developer Network Latest Updates