Application Development 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: 

Foreign key

Former Member
0 Kudos

Hi everyone,

I ahve defined one custom table.

whose key is referring to some other tabl.

Tha cardinality i set is 1:N >

the table is gettinmg modified only through the program.

even if the check table filed don't have that value then also the record is getting inserted into table through the program? how to overcome this problem? what is required to do?

4 REPLIES 4

Former Member
0 Kudos

Hi

The checktable is triggered only in selection-screen or in the dynpro, if you have to update by a program you should insert a control:

SELECT SINGLE * FROM <ZCHECKTABLE> WHERE .....

IF SY-SUBRC = 0.

INSERT ...

ENDIF.

Max

0 Kudos

I have to apply constraint on DDIC table itself.

I don't have to write the select statement.

0 Kudos

Hi

You can't do it in the dictionary, you can only set a checktable for a field there, but you can't avoid that a program insert a record there isn't in the check table.

For example:

Z1 is check table of Z2

If the record A isn't in check table Z1, but however I can insert it if I run a program like this

Z2 = A

INSERT Z2.

No controls can be triggered automatically by dictionary.

Max

0 Kudos

I agree with Max.