Skip to Content
avatar image
Former Member

How to understand "cardinality" ?

hii

I am rookie

I set the Context Node/Attibute properties in the Properties tab ,the first line is cardinality, i can choose

0..n/1..n/1..1/ and so on ,what's the mean?

can you tell me how to understand "cardinality" ?

best regards

yan

Edited by: yan li on Aug 31, 2008 11:52 AM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • avatar image
    Former Member
    Aug 31, 2008 at 11:53 AM

    HI Van li,

    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

    http://help.sap.com/erp2005_ehp_03/helpdata/EN/a9/e7fb3c56cdb742a7260bc3fa7c22a3/frameset.htm

    http://help.sap.com/erp2005_ehp_03/helpdata/EN/44/a2384162316532e10000000a1550b0/frameset.htm

    points if useful

    Thanks

    Suresh

    Edited by: Suresh Mandalapu on Aug 31, 2008 1:54 PM

    Edited by: Suresh Mandalapu on Aug 31, 2008 1:54 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 31, 2008 at 04:11 PM

    Go thru this link, Web Dynpro Context is explained here.

    http://wendtstud1.hpi.uni-potsdam.de/sysmod-seminar/SS2005/presentations/14-Web_Dynpro_dataflow.pdf

    Thanks,

    Sridhar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 01:55 AM

    Hi Yan Li

    Please refer to this [Thread|regarding-cardinality]

    Best Regards

    Chaitanya.A

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 02:03 AM

    Hi Yan,

    About Cardinality:

    Cardinality defines the number of elements in the node which means The maximum and minimum number of elements permitted in a node collection is controlled by the cardinality property.

    The important thing is the cardinality property controls the number of elements a node collection may hold at runtime.

    The Cardinality Property:

    Every context node has a property called Cardinality. This property is composed of two values that

    taken together, describe the maximum and minimum number of elements the node collection may hold

    at runtime.

    u2022 Cardinality Minimum: 0 or 1

    u2022 Cardinality Maximum: 1 or n

    u2022 Therefore, there are four possible cardinality values (specified as <Min>..<Max>)

    u2212 0..1 Zero or one elements permitted
    u2212 0..n Zero or more elements permitted
    u2212 1..1 One and only one element permitted
    u2212 1..n One or more elements permitted
    

    The Context Root Node

    The context root node always contains exactly one element (notice the cardinality is 1..1). This is known as the default element and it cannot be deleted!

    Violating the cardinality constraints

    If you attempt to perform any action on a node collection that would violate its cardinality, then you will get a runtime error from the Web Dynpro Framework. Such actions would be: trying to delete the default element from a node of cardinality 1..<something>, or trying to add a second element to a node of cardinality <something>..1.

    For more details Please go through this url:

    http://help.sap.com/saphelp_nw70/helpdata/EN/b2/fbb859c64611d295dd00a0c929b3c3/frameset.htm

    Thanks

    Krishna

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 03:20 AM

    Hi All

    I saw your answer and these link , very helpful.

    Thank you very much!!!

    Thanks & Regards,

    Yan.

    Edited by: yan li on Sep 1, 2008 5:22 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 11:44 AM

    Hi Yan,

    Here is explation regarding Cardinality as follows:

    Cardinality: The cardinality describes the foreign key relationship with regard to the number of possible dependent records or referenced records. It defines how often a node is to be instantiated at runtime, that is, how many elements of this node are available at runtime.

    Cardinality Description

    1..1 Only one element is instantiated at runtime.

    0..1 At runtime, no more than one element is instantiated, but it is also possible that no element is instantiated.

    1..n At runtime, n elements can be instantiated, but at least one element must be instantiated.

    0..n The number of instantiated elements of the context node can vary at runtime.

    Thanks

    Anup

    Add comment
    10|10000 characters needed characters exceeded