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: 

wd cardinality qustion

Former Member
0 Kudos

hallow

can some one explain to me in simple way what is cardinality

with sample of use in diffrent structre or table .

regards

1 ACCEPTED SOLUTION

former_member189059
Active Contributor
0 Kudos

<b>The cardinality </b>(n : m) describes the foreign key relationship with

regard to the number of possible dependent records involved (records of

the foreign key table) or referred records (records of the check table).

The left side of the cardinality has the following significance:

o n = 1

For each dependent record there is exactly one record of the check

table.

o n = C

There can be records in the foreign key talbe which do not reference

any record of the check table.

The definition of a generic foreign key means that the cardinalities (1 :

m) and (C : m) actually become (CN : m). There can be several records of

the check table for each dependent record. The value n = CN cannot

however be specified explicitly in maintenance because a CN : m

relationship is equal to a foreign key.

Diff bn TYPE N LIKE.

Go through the link.

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm

TYPE - Type is used to tell the system what is the type of data object(variable) you want to create .

LIKE: If there is already a data object declared and you want to declare a similar data object you can just refer to the previous data object using like.

Check this thread.

https://forums.sdn.sap.com/click.jspa?searchID=711746&messageID=2270752

https://forums.sdn.sap.com/click.jspa?searchID=711746&messageID=512214

Pool table

A database table defined in the ABAP Dictionary whose database instance is assigned to more than one table defined in the ABAP Dictionary. Multiple pool tables are assigned to a table pool in the database. The key fields of a pool table have to be character-type fields. The table pool's primary key consists of two fields: TABNAME for the name of a pool table, and VARKEY for the interdependent contents of the key fields in the corresponding pool table. The non-key fields of the pool table are stored in compressed format in their own column, called VARDATA, of the table pool. The only way to access pool tables is by using Open SQL. Joins are not allowed.

Table Pool

Database table in the database that contains the data of several pool tables.

Cluster Table

Database table defined in the ABAP Dictionary, whose version on the database is not only assigned to one table defined in the ABAP Dictionary. Several cluster tables are assigned to a table cluster in the database. The intersection of the key fields of the cluster tables forms the primary key of the table cluster. The other columns of the cluster tables are stored in compressed form in a single column VARDATA of the table cluster. You can access cluster tables only via Open SQL, and only without using joins.

Table Cluster

Database table in the database that contains the data of several cluster tables.

Note: Never mix up with a database table that has the necessary structure for storing data clusters in database tables and in the shared memory. Those are called INDX-type, with reference to the database table INDX supplied by SAP. Data clusters are groupings of data objects for transient and persistent storage in a selectable storage medium. A data cluster can be processed using the statements IMPORT, EXPORT, and DELETE FROM

This link also helps you...

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm

Check out these threads

EXAMPLES

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm

3 REPLIES 3

former_member189059
Active Contributor
0 Kudos

<b>The cardinality </b>(n : m) describes the foreign key relationship with

regard to the number of possible dependent records involved (records of

the foreign key table) or referred records (records of the check table).

The left side of the cardinality has the following significance:

o n = 1

For each dependent record there is exactly one record of the check

table.

o n = C

There can be records in the foreign key talbe which do not reference

any record of the check table.

The definition of a generic foreign key means that the cardinalities (1 :

m) and (C : m) actually become (CN : m). There can be several records of

the check table for each dependent record. The value n = CN cannot

however be specified explicitly in maintenance because a CN : m

relationship is equal to a foreign key.

Diff bn TYPE N LIKE.

Go through the link.

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm

TYPE - Type is used to tell the system what is the type of data object(variable) you want to create .

LIKE: If there is already a data object declared and you want to declare a similar data object you can just refer to the previous data object using like.

Check this thread.

https://forums.sdn.sap.com/click.jspa?searchID=711746&messageID=2270752

https://forums.sdn.sap.com/click.jspa?searchID=711746&messageID=512214

Pool table

A database table defined in the ABAP Dictionary whose database instance is assigned to more than one table defined in the ABAP Dictionary. Multiple pool tables are assigned to a table pool in the database. The key fields of a pool table have to be character-type fields. The table pool's primary key consists of two fields: TABNAME for the name of a pool table, and VARKEY for the interdependent contents of the key fields in the corresponding pool table. The non-key fields of the pool table are stored in compressed format in their own column, called VARDATA, of the table pool. The only way to access pool tables is by using Open SQL. Joins are not allowed.

Table Pool

Database table in the database that contains the data of several pool tables.

Cluster Table

Database table defined in the ABAP Dictionary, whose version on the database is not only assigned to one table defined in the ABAP Dictionary. Several cluster tables are assigned to a table cluster in the database. The intersection of the key fields of the cluster tables forms the primary key of the table cluster. The other columns of the cluster tables are stored in compressed form in a single column VARDATA of the table cluster. You can access cluster tables only via Open SQL, and only without using joins.

Table Cluster

Database table in the database that contains the data of several cluster tables.

Note: Never mix up with a database table that has the necessary structure for storing data clusters in database tables and in the shared memory. Those are called INDX-type, with reference to the database table INDX supplied by SAP. Data clusters are groupings of data objects for transient and persistent storage in a selectable storage medium. A data cluster can be processed using the statements IMPORT, EXPORT, and DELETE FROM

This link also helps you...

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm

Check out these threads

EXAMPLES

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm

0 Kudos

Hi,

<b>The cardinality (n : m) describes the foreign key relationship with regard to the number of possible dependent records involved (records of the foreign key table) or referred records (records of the check table).</b>

<b>The left side of the cardinality has the following significance:</b>

n = 1

For each dependent record there is exactly one record of the check table.

n = C

There can be records in the foreign key talbe which do not reference any record of the check table.

Note:

The definition of a generic foreign key means that the cardinalties (1 : m) and (C : m) actually become (CN : m). There can be several records of the check table for each dependent record. The value n = CN cannot however be specified explicitly in maintenance because a CN : m relationship is equal to a foreign key.

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

<b>The right side of the cardinality has the following significance:</b>

m = 1

For each record of the check table there is exactly one dependent record.

m = C

For each record of the check table there is at most one dependent record.

m = N

For each record of the check table there is at least one dependent record.

m = CN

For each record of the check table there are any number of dependent records.

<b>Definitions:</b>

<b>Check table</b>

Table whose key fields are used to check the foreign key fields (see Foreign Keys). Only entries that are contained in the key fields of the check table can be contained in the foreign key fields.

The check table is used to check whether the input values are valid and for the input help (F4 help).

<b>Foreign key table:</b>

The foreign key table contains the fields that are to be checked against a check table.

In the context of the Enterprise Data Model, foreign key tables are also referred to as dependent tables.

Regards,

Sesh

Former Member
0 Kudos

It defines the foreign key relationship. for ex in table.

for example: fields mandt and matnr in marc are foreign keys referencing mandt and matnr in table mara. and the cordinality ration is 1:CN that means 1 entry (key fields in this case mandt and matnr) in table mara can have any number of entries in table MARC.

Read the SAP help Documentation:

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

The right side of the cardinality has the following significance:

m = 1

For each record of the check table there is exactly one dependent record.

m = C

For each record of the check table there is at most one dependent record.

m = N

For each record of the check table there is at least one dependent record.

m = CN

For each record of the check table there are any number of dependent records.

Cardinality indicates the primary and foriegn key ratio.

Cardinallity defines in what way the indexes are goign to be made on the dimenasion for which you define it.

Basically if you define a dimension as high cardinallity then B tree index used during the drill downns and data access for the faster access of data.

If this option si not used then they are trated as normal dimesions and no new index are created.

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 may contain records which 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 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 may be any number of dependent records for each record of the check table.

A foreign key describes a relationship between two tables. You can define this relationship more precisely by specifying the cardinality and type of foreign key fields.

The following types of foreign key field can be defined:

1.No key fields/candidates: The foreign key fields are neither primary key fields of the foreign key table nor do they uniquely identify a record of the foreign key table (key candidates). For this reason, the foreign key fields do not (partially) identify the foreign key table.

2.Key fields/candidates: The foreign key fields are either primary key fields of the foreign key table or they already uniquely identify a record of the foreign key table (key candidates). The foreign key fields therefore (partially) identify the foreign key table.

3.Key fields of a text table: The foreign key table is a text table for the check table, that is the key of the foreign key table only differs from the key of the check table in that it has an additional language key field. This is a special case of the type Key fields/candidates.

Here is the example with screen shots

http://help.sap.com/saphelp_nw04/helpdata/en/b2/fbb859c64611d295dd00a0c929b3c3/frameset.htm