Creating Object Relationship Models

Prerequisites

The object type of an object involved with a relationship must be created in a repository (business object repository or class library).

Procedure

  1. Start transaction SOBL_MODEL.

  2. If you are not in change mode, choose .

Create Role Types

  1. In the dialog structure, execute the role types entry by double-clicking.

  2. To create a new role type, choose New Entries. To change a role type, select it from the list by double-clicking.

  3. Make the following settings:

    • Name and desciption of the role type (the name of a role type serves as a key and can no longer be changed)

    • Indicator stating whether the role type should be non-persistent or persistent (also see Persistent Roles).

    • If necessary, the corresponding role type from a relationship model that was used before SAP Technology Release 6.10.

  4. Choose and .

Assign Object Types to Role Types

  1. In the list of role types, select the entry to which you want to assign object types.

  2. In the dialog structure, execute the object types to role types entry by double-clicking.

  3. To assign new object types, choose New Entries. To change an assignment, select it from the list by double-clicking.

  4. Make the following settings:

    • The role type that you selected.

    • The object type with objects that can take this role type in a relationship.

    • The repository in which the object type was created.

    • If necessary, the corresponding object type from a relationship model that was created before SAP Technology Release 6.10.

  5. Choose and .

Create Relationship Types

  1. In the dialog structure, execute the relationship types entry by double-clicking.

  2. To create a new relationship type, choose New Entries. To change a relationship type, select it from the list by double-clicking.

  3. Make the following settings:

    • Name of the relationship type

    • Both role types that are to be related (A and B)

    • The cardinality with which the relationships can occur (that is, how many object instances in the relevant role can be related with the object instances in the related role).

    • Table in which the relationship records should be saved at runtime

    • Name of the person who is responsible for relationships of this type

    • Description of the significance of the relationship (there you can differentiate the direction in which the relationship is seen)

    • If necessary, the corresponding relationship type from a relationship model that was used before SAP Technology Release 6.10.

  4. Choose and .

Assign Application-Specific Attributes

  1. If you additionally use application-specific attributes for relationships of a type, proceed as follows:

  2. In the list of relationship types, select the entry to which you want to assign relationship types.

  3. In the dialog structure, execute the relationship attributes entry by double-clicking.

  4. To create a new relationship attribute, choose New Entries. To change a relationship attribute, select it from the list by double-clicking.

  5. Make the following settings:

    • Name of the attribute

    • Class in which the attribute is encapsulated (the class must be persistent and have implemented the IF_BINREL_PROP_CA interface). For more information, see Application-Specific Attributes for Relationships.

    • Name of the person who is responsible for relationships of this type.

  6. Choose and .

Model Parameter

Value

Role type

TRANSIT, CONNECT, non-persistent role types

Object type for role type

SFLIGHT (for TRANSIT and CONNECT)

Relationship type

FLIGHTCONN,

Application table SFLIBREL,

Attributes available

Semantics: Has connecting flight, is connecting flight of

Relationship attributes

TRANSPASS, table type attribute, which is included in the CL_OBL_EXMPL_TRANSPASS class

VIAPROP, flat attribute, which is included in the CL_OBL_EXMPL_PVIA class

Archiving object

SOBL_SFLIG