OData FW Logo
Annotations

ZCL_ODATA_ANNOTATION_ODATA

SAP OData Capabilities annotation

Class for adding OData Capabilities V1 annotations to entity sets. Currently supports FilterRestrictions — marking properties as required filters or excluding them from filtering entirely.

Constants

ConstantValueDescription
mc_anno_namespaceOrg.OData.Capabilities.V1Annotation namespace
mc_vocab_id/IWBEP/VOC_CAPABILITIESVocabulary ID used to register the reference
mc_vocab_version0001Vocabulary version
mc_aliasODCapaAlias used in annotation terms (e.g. ODCapa.FilterRestrictions)

Methods

create

Static factory method. Creates a new ZCL_ODATA_ANNOTATION_ODATA instance, registers the Capabilities vocabulary reference, and sets the annotation target to the given entity set.

Parameters:

ParameterDirectionDescription
io_vocan_modelImportingVocabulary annotation model of the OData service
iv_namespaceImportingService namespace (slashes are replaced with underscores)
iv_entity_nameImportingEntity name (the annotation target becomes <container>/<entity>Set)
iv_entity_containerImportingEntity container name
ro_odata_annotationReturningNew annotation instance

add_property_to_required

Adds a property to the FilterRestrictions/RequiredProperties collection. The FilterRestrictions record is created lazily on the first call.

Parameters:

ParameterDirectionDescription
iv_property_nameImportingName of the property or navigation property to require as a filter

add_property_to_non_filterable

Adds a property to the FilterRestrictions/NonFilterableProperties collection. Use this to hide properties or navigation properties from the filter bar. The FilterRestrictions record is created lazily on the first call.

Parameters:

ParameterDirectionDescription
iv_property_nameImportingName of the property or navigation property to exclude from filtering