Show TOC

Interface /IWBEP/IF_V4_ANNO_MODELLocate this document in the navigation structure

This is the interface which can be used to define annotations for OData version 4 (V4).

Methods
Method CREATE_ANNOTATIONS_TARGET

This method creates an annotations target.

Code Syntax
    importing
      IV_TARGET_NAMESPACE type STRING default /IWBEP/IF_V4_MED_TYPES=>GCS_MED_ALIASES-SCHEMA
      IV_TARGET type STRING
      IV_QUALIFIER type STRING optional
    returning
      value(RO_ANNOTATIONS_TARGET) type ref to /IWBEP/IF_V4_ANNO_ANN_TARGET
    raising
      /IWBEP/CX_V4_ANNOTATION .
Table 1:

Parameter

Description

iv_target_namespace

Target namespace.

iv_target

Target, that is, the element an annotation points to.

iv_qualifier

Qualifier.

ro_annotations_target

Annotations target.

Exceptions

The annotation exception is /iwbep/cx_v4_annotation.

Method CREATE_TERM

This method creates an annotations term.

Code Syntax
    importing
      IV_NAME type STRING
      IV_TYPE_NAMESPACE type STRING
      IV_TYPE type STRING
      IV_BASE_TERM_NAMESPACE type STRING
      IV_BASE_TERM type STRING optional
      IV_NULLABLE type ABAP_BOOL optional
      IV_DEFAULT_VALUE type STRING optional
      IV_APPLIES_TO type STRING optional
      IV_FACETS type /IWBEP/IF_V4_ANNO_TYPES=>TY_S_ANNO_FACETS optional
    returning
      value(RO_TERM) type ref to /IWBEP/IF_V4_ANNO_TERM
    raising
      /IWBEP/CX_V4_ANNOTATION .
Table 2:

Parameter

Description

iv_name

Name.

iv_type_namespace

Type namespace.

iv_type

Type.

iv_base_term_namespace

Base term namespace.

iv_base_term

Base term.

iv_nullable

Is nullable.

iv_default_value

Default value.

iv_applies_to

Applies to.

iv_facets

Facets.

ro_term

Annotation term.

Exceptions

The annotation exception is /iwbep/cx_v4_annotation.

Method CREATE_VOCABULARY_REFERENCE

This method adds a reference to a vocabulary namespace.

Sample Code
   DATA lo_annotation_model TYPE REF TO /iwbep/if_v4_anno_model. 

    DATA lo_reference TYPE REF TO /iwbep/if_v4_anno_reference. 

    lo_annotation_model = io_model->get_annotation_model( ). 

    lo_reference = lo_annotation_model->create_vocabulary_reference( iv_vocab_id = '/IWBEP/VOC_XJG' iv_vocab_version = '0001' ). 

    lo_reference->create_include( iv_namespace = 'com.sap.vocabularies.Capabilities.v1' iv_alias = 'XJG' ). 
Code Syntax
  methods CREATE_VOCABULARY_REFERENCE
    importing
      IV_VOCAB_ID type /IWBEP/V4_ANNO_VOCAB_ID
      IV_VOCAB_VERSION type /IWBEP/V4_ANNO_VOCAB_VERSION
    returning
      value(RO_REFERENCE) type ref to /IWBEP/IF_V4_ANNO_REFERENCE
    raising
      /IWBEP/CX_V4_ANNOTATION .
Table 3:

Parameter

Description

iv_vocab_id

Vocabulary repository ID.

iv_vocab_version

Vocabulary version.

ro_reference

Annotations reference.

Exceptions

The annotation exception is /iwbep/cx_v4_annotation.