Show TOC

Interface /IWBEP/IF_V4_MED_ENTITY_TYPELocate this document in the navigation structure

This is the interface for an entity type for OData version 4 (V4).

You can use the methods of this interface to maintain an entity type during creation of a service model in a model provider class.

To access entity type information at runtime refer to interface /IWBEP/IF_V4_MED_ENTITY_TYPE_R.

This interface includes interface /iwbep/if_v4_med_element.

Table 1: Aliases

Visibility and Level

Alias

Component

public

get_edm_name //IWBEP/IF_V4_MED_ELEMENT~GET_EDM_NAME

public

get_internal_name

/IWBEP/IF_V4_MED_ELEMENT~GET_INTERNAL_NAME

Methods
Method CREATE_COMPLEX_PROPERTY

This method creates a complex property.

This method appends a complex property with internal name IV_PROPERTY_NAME to the list of properties of the entity type. You can specify certain attributes of this complex property, its type for example, through interface /IWBEP/IF_V4_MED_CPLX_PROP at the instance provided in RO_PROPERTY.

Code Syntax
    IMPORTING
      iv_property_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_property) TYPE REF TO /iwbep/if_v4_med_cplx_prop
    RAISING
      /iwbep/cx_v4_med .
Table 2:

Parameter

Description

iv_property_name

Internal property name.

ro_property

Complex property.

Exceptions

The metadata exception is iwbep/cx_v4_med.

The system will raise an exception if IV_PROPERTY_NAME does not comply with ABAP naming conventions or if an entity set with the given internal name exists already.

Method CREATE_ENTITY_SET

This method creates an entity set for an entity type.

The system will create an entity set with internal name IV_ENTITY_SET_NAME that references the entity type.

Code Syntax
    IMPORTING
      iv_entity_set_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_entity_set) TYPE REF TO /iwbep/if_v4_med_entity_set
    RAISING
      /iwbep/cx_v4_med .
Table 3:

Parameter

Description

iv_entity_set_name

Internal entity set name.

ro_entity_set

Entity set object.

Exceptions

The metadata exception is iwbep/cx_v4_med.

The system will raise an exception if IV_ENTITY_SET_NAME does not comply with ABAP naming conventions or if an entity set with the given internal name exists already.

Method CREATE_NAVIGATION_PROPERTY

This method creates a navigation property with the name IV_PROPERTY_NAME.

Code Syntax
    IMPORTING
      iv_property_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_property) TYPE REF TO /iwbep/if_v4_med_nav_prop
    RAISING
      /iwbep/cx_v4_med .
Table 4:

Parameter

Description

iv_property_name

Internal navigation property name.

ro_property

Navigation property.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Throw an exception if the navigation with the name IV_PROPERTY_NAME is already defined.

Method CREATE_PRIM_PROPERTY

This method creates a primitive property. This method adds a primitive property to the entity type with the name IV_PROPERTY_NAME.

Code Syntax
    IMPORTING
      iv_property_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_property) TYPE REF TO /iwbep/if_v4_med_prim_prop
    RAISING
      /iwbep/cx_v4_med .
Table 5:

Parameter

Description

iv_property_name

Internal property name.

ro_property

Property.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Throw an exception if the navigation with the name IV_PROPERTY_NAME is already defined.

Method CREATE_PRIM_PROPERTY_BY_ELEM

This method creates a primitive property using ABAP Dictionary information.

This method adds a primitive property to the entity type with the name IV_PROPERTY_NAME. The property information is received from the ABAP Dictionary element IV_ELEMENT_NAME.

Code Syntax
    IMPORTING
      iv_property_name        TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
      iv_element_name         TYPE string
    RETURNING
      VALUE(ro_property)       TYPE REF TO /iwbep/if_v4_med_prim_prop
    RAISING
      /iwbep/cx_v4_med .
Table 6:

Parameter

Description

iv_property_name

Internal property name.

iv_element_name

ABAP Dictionary element name.

ro_property

Property.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Throw an exception if the property with the name IV_PROPERTY_NAME is already defined.

Method GET_COMPLEX_PROPERTIES

This method gets complex properties.

The system returns a list of complex properties of the entity type. The list may be empty.

Code Syntax
    EXPORTING
      et_property TYPE /iwbep/if_v4_med_element=>ty_t_med_cplx_property
    RAISING
      /iwbep/cx_v4_med .
Table 7:

Parameter

Description

et_property

Complex properties of entity type.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_COMPLEX_PROPERTY

This method gets a complex property.

The system returns a complex property of the entity type.

Code Syntax
    IMPORTING
      iv_property_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_property) TYPE REF TO /iwbep/if_v4_med_cplx_prop
    RAISING
      /iwbep/cx_v4_med .
Table 8:

Parameter

Description

iv_property_name

Internal property name.

ro_property

Complex property.

Exceptions

The metadata exception is iwbep/cx_v4_med.

If no property was found an exception is raised.

Method GET_ETAG_PROPERTY

This method gets an ETag property.

The system returns an ETag property of the entity type.

Code Syntax
    RETURNING
      VALUE(ro_property) TYPE REF TO /iwbep/if_v4_med_prim_prop
    RAISING
      /iwbep/cx_v4_med .
Table 9:

Parameter

Description

ro_property

Primitive ETag property.

Exceptions

The metadata exception is iwbep/cx_v4_med.

An exception is raised if the property could not be found.

Method GET_KEY_PROPERTIES

This method gets key properties.

The system returns the key properties of the entity type.

Code Syntax
    EXPORTING
      et_property TYPE /iwbep/if_v4_med_element=>ty_t_med_prim_property
    RAISING
      /iwbep/cx_v4_med .
Table 10:

Parameter

Description

et_property

Key properties.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_KEY_PROPERTY_NAMES

This method gets key property names.

The system returns the names of the key properties in ET_INTERNAL_NAME.

Code Syntax
    EXPORTING
      et_interal_name TYPE /iwbep/if_v4_med_element=>ty_t_med_internal_name
    RAISING
      /iwbep/cx_v4_med .
Table 11:

Parameter

Description

et_interal_name

Internal names of key properties.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_NAVIGTION_PROPERTIES

This method gets navigation properties.

The system returns the navigation properties in ET_PROPERTY.

Code Syntax
    EXPORTING
      et_property TYPE /iwbep/if_v4_med_element=>ty_t_med_nav_property
    RAISING
      /iwbep/cx_v4_med .
Table 12:

Parameter

Description

et_property

Navigation properties.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_NAVIGTION_PROPERTY

This method gets the navigation property.

The system return the navigation property with the name IV_PROPERTY_NAME.

Code Syntax
    IMPORTING
      iv_property_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_property) TYPE REF TO /iwbep/if_v4_med_nav_prop
    RAISING
      /iwbep/cx_v4_med .
Table 13:

Parameter

Description

iv_property_name

Internal property name.

ro_property

Navigation property.

Exceptions

The metadata exception is iwbep/cx_v4_med.

An exception is raised if no navigation property could be found.

Method GET_PRIMITIVE_PROPERTIES

This method gets primitive properties.

The system returns the primitive properties in ET_PROPERTY.

Code Syntax
    EXPORTING
      et_property TYPE /iwbep/if_v4_med_element=>ty_t_med_prim_property
    RAISING
      /iwbep/cx_v4_med .
Table 14:

Parameter

Description

et_property

Primitive properties.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_PRIMITIVE_PROPERTY

This method gets the primitive property.

The system returns the primitive property with the internal name specified in IV_PROPERTY_NAME.

Code Syntax
    IMPORTING
      iv_property_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_property) TYPE REF TO /iwbep/if_v4_med_prim_prop
    RAISING
      /iwbep/cx_v4_med .
Table 15:

Parameter

Description

iv_property_name

Internal property name.

ro_property

Primitive property.

Exceptions

The metadata exception is iwbep/cx_v4_med.

The system will raise an exception if no primitive property with the given internal name exists at the entity type.

Method GET_PROPERTIES

This method gets properties.

The system returns the properties of the entity type.

Code Syntax
    EXPORTING
      et_property TYPE /iwbep/if_v4_med_element=>ty_t_med_property
    RAISING
      /iwbep/cx_v4_med .
Table 16:

Parameter

Description

et_property

Properties.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_PROPERTY

This method gets the property by the internal name.

The system returns the property of the entity type.

Code Syntax
    IMPORTING
      iv_property_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_property) TYPE REF TO /iwbep/if_v4_med_element
    RAISING
      /iwbep/cx_v4_med .
Table 17:

Parameter

Description

iv_property_name

Internal property name.

ro_property

Property element.

Exceptions

The metadata exception is iwbep/cx_v4_med.

The system will raise an exception if no property with the given internal name exists at the entity type.

Method GET_STRUCT_ASSIGN

This method gets the name of the assigned structure.

The value could be empty.

Code Syntax
    RETURNING
      VALUE(rv_struct_name) TYPE string
    RAISING
      /iwbep/cx_v4_med .
Table 18:

Parameter

Description

rv_struct_name

Structure name.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method HAS_STRUCT_ASSIGN

This method checks if a structure assignment exists.

Code Syntax
    RETURNING
      VALUE(rv_has_struct_assign) TYPE abap_bool
    RAISING
      /iwbep/cx_v4_med .
Table 19:

Parameter

Description

rv_has_struct_assign

Structure name.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method SET_EDM_NAME

This method sets an EDM/OData name.

Code Syntax
    RETURNING
    IMPORTING
      iv_edm_name TYPE /iwbep/if_v4_med_element=>ty_e_med_edm_name
    RAISING
      /iwbep/cx_v4_med .
Table 20:

Parameter

Description

iv_edm_name

EDM name.

Exceptions

The metadata exception is iwbep/cx_v4_med.

The system will raise an exception if the EDM name for an entity type is already in use. Or if the EDM name is invalid.