Show TOC

/IWBEP/CL_MGW_ABS_MODELLocate this document in the navigation structure

Use

This is the abstract class for a model provider class (MPC). Every concrete implementation of a model provider class shall be derived from this class.

Several constants are defined for this class.

Table 1: Constants

Constant

Description

GCS_SAP_TEXT_OBJECT_TYPES

Constants can be use to address the kind of text which can be used, for example a text symbol of a class in the backend. The structure contains a list of the possible text object types. This text object should be used to create text with method SET_TEXT_KEY for a field label.

TEXT_SYMBOL_CLASS uses a text element of a class in the backend system.

CARDINALITY_FEED

Value=* for multiplicity / cardinality of an association end type, for example

CARDINALITY_ENTITY

Value=1 for multiplicity / cardinality of an association end type, for example

CARDINALITY_ENTITY_0

Value=0..1 for multiplicity / cardinality of an association end type, for example

GCS_SAP_SEMANTIC

All possible values as constants for annotation sap:semantics

GCS_FC_TARGET_PATH

Values for target path of feed customization, for example for content source and type of a media link entry

There is only one member, that is the MODEL which is the starting object to define the OData Channel data model.

Methods

Method DEFINE

This method needs to be implemented by an application to define its metadata. The entry point is the member data model.

Method GET_LAST_MODIFIED

The method calculates the time stamp of the last metadata change. The default implementation of this method derives the last modified timestamp based on the changed timestamp of the model provider class (MPC) and the time zone of the system. The time stamp is automatically converted into UTC (GMT). The application can overwrite the logic if it does not fit. The following HTTP response header fields contain this time stamp:

  • last-modified

    Header field for each metadata request.

  • x-sap-metadata-last-modified

    Header field for each service document request, GET entity request and GET entity set request.

These response header fields enable the web infrastructure to cache the metadata document.

Parameter

Description

RV_LAST_MODIFIED

Time stamp which is set as Last-Modified in the HTTP response header.

Starting with SAP Gateway 2.0 SP06 (IW_BEP and IF_FND) the result of GET_LAST_MODIFIED also controls the cache on the SAP Gateway server for service document and service metadata document requests. If the SAP Gateway metadata cache is active, then the SAP Gateway server performs a handshake with the backend, based on the GET_LAST_MODIFIED result and compares the timestamp from the cached metadata on the SAP Gateway server with the one returned by the GET_LAST_MODIFIED implementation of the model provider on the backend.

If the cache is outdated on the SAP Gateway server, then the new metadata is sent from the backend and the cache is updated with the new metadata on the SAP Gateway server. As a result, the latest changes of your metadata is always reflected when requesting a service and a service metadata document.

If the cache is not outdated on the SAP Gateway server, then the backend does not send any metadata back to the SAP Gateway server, because the cached metadata is still up-to-date.

Note

The handshake to the backend is only performed for service and service metadata document requests, not for requests to business data (for example, calling collections, single entities and function imports).

Caution

With this behavior the following setup will lead to a performance bottleneck for service and service metadata document requests, because the cache is in this case refreshed in every request for metadata:

  • Method GET_LAST_MODIFIED is overwritten with coding like GET TIME STAMP FIELD rv_last_modified.

  • The SAP Gateway metadata cache is active.

In order to always have the latest metadata present on your client applications, it is recommended to perform a request to the service metadata document as a very first call of your client application choreography (for example when starting the application) to the SAP Gateway server.

Method GET_VOCAN_TEXTS

The method is called with a table of all annotation text keys that have been defined in the corresponding model.

The framework implementation does the following:

  • It loads the corresponding texts for all referenced data elements and referenced text elements.

  • It calls method GET_VOCAN_PROVIDER_TEXTS to retrieve the provider texts in a second step.

As a rule there is no need to overwrite this method.

Parameter

Description

IV_LANGUAGE

The current language.

IT_VOCAN_TEXT_KEYS

Table of all annotation text keys that have been defined in the corresponding model.

CT_VOCAN_TEXTS_OBJ

Table containing the actual annotation texts.

Method GET_VOCAN_PROVIDER_TEXTS

The method is called with a table of annotation text keys that have been defined in the corresponding model, but only for the text type "provider text".

The framework implementation simply throws a NOT-IMPLEMENTED exception. A provider using its own text repository must overwrite this method and return the texts for all provider texts that have been defined in the model and which are also provided via import parameter IT_VOCAN_TEXT_KEYS.

Parameter

Description

IV_LANGUAGE

The current language.

IT_VOCAN_TEXT_KEYS

Table of annotation text keys, of the type "provider text".

CT_VOCAN_TEXTS_OBJ

Table containing the actual annotation texts.