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

Check Table

former_member734916
Participant
0 Likes
1,579

Hi Friends,

I am working on IDES.

I want to establish a relation between two ztables using foreign key. I have created zemp and zdept database tables.

zemp contains these three fields.

1. empno

2. empname

3. deptno this field is created using a domain.

zdept contains these two fields.

1. deptno -> this is created using same domain which is used in zemp table for deptno field and is primary key to this table.

2. deptname

then I created this deptno as foreign key in zemp table.

If I am trying to enter data into zemp table for deptno field it is accepting data which is not there in zdept table deptno field. Actually it should not accept right ? , but it is accepting can anyone help me in this regard. Am i doing any mistake here.

Thanks and regards.

Krishna

1 ACCEPTED SOLUTION
Read only

shishupalreddy
Active Contributor
0 Likes
1,429

HI,

Can you please generate table maintenance generator for Zemp table so that you will get the required solution.

i mean the relationship will work corectly

for that goto SE11.

GETINTO TABLE.

SELECT utilities MANU.

sELECT table MG.

createit.

regards,

9 REPLIES 9
Read only

Former Member
0 Likes
1,429

Hi Krishna,

have you tried to modify the domain and enter ZDEPT as value table of the domain?

I hope it helps. BR,

Alvaro

Read only

0 Likes
1,429

Hi Rao,

Thanks for reply,

I am not getting what u r trying tell. Can u explain in detail.

Krishna.

Read only

Former Member
0 Likes
1,429

Hi

If zdept is check table for field zemp-deptno, you should explain how you insert the record.

I you enter the record dirctly by ABAP, you should consider the control can't be triggered, so you can write:

ZEMP-DEPTNO = 'AAA'.

INSERT ZEMP.

This comand works fine, although the value 'AAA' doesn't exist in ZDEPT.

The control of check table is triggered only in the selection-screen.

Max

Read only

0 Likes
1,429

Rao,

I am inserting entries directly to the zemp table using \

utilities

|

table contents

|

create entries

where should i write that code.

Krishna.

Read only

0 Likes
1,429

Hi

You haven't to write that code.

I only want to say you the control of check table can be triggered only in the selection-screen and not in ABAP code.

So if you're using trx SE16 to insert the data you should check the defination of check table is correct, because there you control should be triggered and the system should prevent to insert values aren't in check table.

Max

Read only

shishupalreddy
Active Contributor
0 Likes
1,430

HI,

Can you please generate table maintenance generator for Zemp table so that you will get the required solution.

i mean the relationship will work corectly

for that goto SE11.

GETINTO TABLE.

SELECT utilities MANU.

sELECT table MG.

createit.

regards,

Read only

0 Likes
1,429

Hi Reddy,

I tried this problem in my development server it is working fine without creating table maintenance generator.

It is not accepting entries which are not there in zdept table.

But in IDES it is giving problem.

Krishna.

Read only

rajeshkumar_kaveti
Participant
0 Likes
1,429

Hi Krishna,

I guess you haven't assigned check table for zemp-deptno.

Give check table as zdept and check.

Regards,

Rajesh

Read only

Former Member
0 Likes
1,429

in ZEMP TABLE ENABLE THE CHECK TABLE AS ZDEPT TABLE FOR THAT FIELD ...

TABLE ZEMP -


FIELD ---DEPTNO

ULL FIND AN OPTION AS CHECK TABLE FOR THAT deptno FIELD before short text ,

here give the check table as zdept and activate ..

this will allow only entries of zdept table ..

hope this helps ,

Regards,

Vijay

may be if u trying this in IDES it is prone to give error

i agree with this ..

Message was edited by: Vijay