Skip to Content
-1

Issue in establishing relationship in Help View!!!

Jan 16, 2017 at 09:32 AM

146

avatar image

Hello,

In Help View, I have two tables ZEMP_691611 and ZPROJ_691611.

employee table(check table) contains fields mandt, empid, empname where empid is primary key

and project table(foreign key) contains mandt, empid, projid, projname where empid is the foreign key.

I can establish relationship between project table and employee table which are foreign key and check table respectively.

But in the reverse situation i.e. when i am trying to establish a relation between employee table and project table facing an issue with unsuitable cardinality.

In a contradictory example, I have two table T416 and T416t. T416 corresponds to Employee table here and T416t to Project table. But I can join the T416 with T416t table with no issue of cardinality.

Please suggest something.

1.png (20.8 kB)
2.png (21.7 kB)
3.png (27.1 kB)
4.png (19.1 kB)
5.png (7.1 kB)
6.png (16.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Horst Keller
Jan 16, 2017 at 04:54 PM
1

From the dictionary reference documentation:

  • The secondary tables must have an N:1 dependency on the primary table or on the transitively preceding secondary table. This makes sure that no more than one dependent data record exists in each of the secondary tables for a specific data record in the primary table. An N:1 dependency exists if the secondary table is the check table in the foreign key in question.
  • If the secondary table is the foreign key table, the foreign key fields must be key fields of a table or the foreign key must have the cardinality N:1 or N:C.
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thanks for the explanation but I couldn't understand much of it as the same kind of info already available on internet.

Please be specific with the example asked in the above question.

0

In one of your screen shots I see a foreign key cardinality that contradicts the documentation. Maybe that's the reason.

0
abid ali Jan 17, 2017 at 12:45 PM
1

The cardinality (n:m) describes the foreign key relationship with regard to the number of possible dependent records (records of the foreign key table) or referenced records (records of the check table).

The left side (n) of the cardinality is defined as follows:

  • n=1

    There is exactly one record assigned to the check table for each record of the foreign key table.

  • n=C

    The foreign key table can contain records that do not correspond to any record of the check table because the foreign key field is empty. This can occur, for example, if the field of the foreign key table is optional, in which case it does not have to be filled.

The right side (m) of the cardinality is defined as follows:

  • m=1

    There is exactly one dependent record (record of the foreign key table) for each record of the check table.

  • m=C

    There is at most one dependent record for each record of the check table.

  • m=N

    There is at least one dependent record for each record of the check table.

  • m=CN

    There can be any number of dependent records for each record of the check table.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Here is the link where the above can be found in the documentation

http://help.sap.com/abapdocu_751/en/index.htm?file=abenddic_database_tables_forkey.htm

0

Cardinality is defined during foreign key relationship.

The cardinality of the foreign key relationship describes, for each value in the check table, how many rows of data are
allowed to be in the foreign key table.
Cardinality is defined as X:Y, where X refers to the check table and Y refers to the foreign key table.

X can have only values 1 or C and Y can be 1,C,N or CN.
1,C,N,CN has specific descriptions.
cardinality is not enforced by the system.It is optional. Hope you get my point.

0
Horst Keller
Jan 18, 2017 at 01:18 PM
0

cardinality is not enforced by the system.It is optional.

With the exception of maintenance and help views, where cardinality counts ...


Show 1 Share
10 |10000 characters needed characters left characters exceeded

Sorry sir i didnt get your question.....For Foreign Key relationship only Cardinalty exists.

0