‎2008 Dec 13 5:23 AM
Hi
I have created 2 tables zposition, zwork.
The fields in zposition is department and position.
The fields in zwork is empid, department, position, firstname and lastname.
I wanted to create a validation that when i insert the data into the zwork, the system will automatically check against the zposition tables for the department and position that was store inside it. How do i do it?
‎2008 Dec 13 5:44 AM
Hi,
Go to SE11 in Edit mode and select field department and click on the foreign keys button, It will give you a popup for creating aforeugn keys with a table name,
If this proposed table name is zposition , click on yes
Else this is not zposition, click on No and specify the table zposition in the field for check table in the following popup.
If you enter a value in zwork, the system will automatically go and check if any entry being entered is present in zposition.
Thanks and regards,
Dev.
‎2008 Dec 13 5:43 AM
in ur zwork table where u find the fields department and position..
in the table fields of zwork just put the cursor on this field say department and click the key button(on the top) it will propose for a check table and in there give the zposition table relavant field department.
the answer is there in ur question itself ...
// check against the zposition tables for the department and position--> u need to propose the check table on that field .
so all in ur are validating the zwork department entry with zposition department field..
‎2008 Dec 13 5:43 AM
hi,
you must be having an idea about the foreign key relationship.
Assign your zposition table as a check table to zwork table .
For your deparment and position fields in zwork table ,assign zposition table as a check table.
User will be able to create only those records with department and position in table zwork which are already present in zposition.
otherwise system wont allow user to create another records which do not exist in zposition table.
hope this will help u.
‎2008 Dec 13 5:44 AM
Hi,
Go to SE11 in Edit mode and select field department and click on the foreign keys button, It will give you a popup for creating aforeugn keys with a table name,
If this proposed table name is zposition , click on yes
Else this is not zposition, click on No and specify the table zposition in the field for check table in the following popup.
If you enter a value in zwork, the system will automatically go and check if any entry being entered is present in zposition.
Thanks and regards,
Dev.
‎2008 Dec 13 5:46 AM
Try using the check tables for this purpose,
http://help.sap.com/saphelp_nw04/helpdata/en/63/1b70bcc32111d1950600a0c929b3c3/content.htm
look into value tables as well,
http://help.sap.com/saphelp_nw70/helpdata/EN/e2/667092730811d2959500a0c929b3c3/content.htm
‎2008 Dec 13 5:54 AM
Hi,
Consider this example,
for Kunnr(customer),KNA1 is the check table
from table:t001W.
KUNNR KUNNR_WK CHAR KNA1 Input help implemented with check table
similarly do it for zposition & zwork.
Hope it clears your doubt.
With Regards,
Jaheer.
‎2008 Dec 15 3:18 PM
Thanks guys for answering my question, i have successfully created the validation.
Edited by: wenjie chye on Dec 16, 2008 4:55 AM