OData vocabulary annotation interface and methods.
A record can be created for an annotation, property, labeled element or collection. The following example shows how a record is created from an annotation. This example includes the creation of a property for the record.
DATA: lo_ann_target TYPE REF TO /iwbep/if_mgw_vocan_ann_target, " Vocabulary Annotation Target lo_annotation TYPE REF TO /iwbep/if_mgw_vocan_annotation, " Vocabulary Annotation lo_record TYPE REF TO /iwbep/if_mgw_vocan_record, " Vocabulary Annotation Record lo_property TYPE REF TO /iwbep/if_mgw_vocan_property. " Vocabulary Annotation Property lo_ann_target = vocab_anno_model->create_annotations_target( 'Products' ). lo_annotation = lo_ann_target->create_annotation( iv_term = 'Org.OData.Core.V1.OptimisticConcurrencyControl' ). lo_record = lo_annotation->create_record( iv_record_type = 'Some Record Type' ). lo_property = lo_record->create_property( iv_property_name = 'My Property').
In the metadata document, this is reflected as follows:
<Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm" Target="Products"> <Annotation Term="Org.OData.Core.V1.OptimisticConcurrencyControl"> <Record Type="Some Record Type"> <PropertyValue Property="My Property"/> </Record> </Annotation> </Annotations>
Methods available for /IWBEP/IF_MGW_VOCAN_RECORD
Method |
Function |
CREATE_ANNOTATION |
Creates an annotation |
CREATE_PROPERTY |
Creates a property (PropertyValue) |