Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

table validation question

Former Member
0 Likes
709

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?

1 ACCEPTED SOLUTION
Read only

dev_parbutteea
Active Contributor
0 Likes
663

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.

6 REPLIES 6
Read only

Former Member
0 Likes
663

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..

Read only

Former Member
0 Likes
663

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.

Read only

dev_parbutteea
Active Contributor
0 Likes
664

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.

Read only

Former Member
Read only

jaheer_hussain
Active Contributor
0 Likes
663

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.

Read only

Former Member
0 Likes
663

Thanks guys for answering my question, i have successfully created the validation.

Edited by: wenjie chye on Dec 16, 2008 4:55 AM