Show TOC

/IWBEP/IF_MGW_ODATA_EXPANDLocate this document in the navigation structure

Use

This interface can be used to validate whether an expand expression which can be handled by the application is applicable or not.

Moreover, this interface provides also some more methods for service providers to get the whole expand tree and also retrieve all necessary information to implement its own expand completely or just partly to optimize performance.

The following fields are provided:

  • GCS_COMPARE_RESULT-MATCH_NO

  • GCS_COMPARE_RESULT-MATCH_SUBSET

  • GCS_COMPARE_RESULT-MATCH_EQUALS

Methods

Method COMPARE_TO

This method compares a given string with the requested (sub)expand expression.

Note

Note that this method is obsolete. See method COMPARE_TO_TECH_NAMES. Instead of technical names it is required to provide the external naming to compare the expand expression. This method is not recommended.

Parameter

Description

IV_EXPAND

Expression which can be handled by the application

RV_RESULT

This has the value GCS_COMPARE_RESULT-MATCH_NO if the given expand string does not match. It has the value GCS_COMPARE_RESULT-MATCH_SUBSET if the given expand is a subset of the current expand tree. It has the value GCS_COMPARE_RESULT-MATCH_EQUALS if the given expand string matches fully.

Method COMPARE_TO_TECH_NAMES

This method compares a given string with the requested (sub)expand expression.

The expand handling of SAP Gateway allows to handle certain expand expressions by the data providers without applying the generic expand functionality. It is up to the data provider developer to check for certain expand expressions which can be handled in an efficient way on the application side. The COMPARE_TO method can be used to check for several expand expressions which shall be handled by the application logic.

In the GET_EXPANDED_ENTITY / GET_EXPANDED_ENTITYSET methods you can use the comparator to check whether the expand expression should be delegated to the framework or whether it can be handled by the application. It can lead to the following results:

  • It returns MATCH_SUBSET if you call COMPARE_TO_TECH_NAME( IV_EXPAND = 'PRODUCTS' ) - which is the indicator that you can return a table of categories in which every category entry has a 'PRODUCTS table component. The Supplier relation is in this case further expanded generically by the framework. Exporting parameter ET_EXPANDED_TECH_CLAUSES of GET_EXPANDED_ENTITY / GET_EXPANDED_ENTITYSET needs then to contain one entry 'PRODUCTS' to tell the framework that this expression has already been handled by the application.

  • It returns MATCH_EQUALS if you call COMPARE_TO_TECH_NAME( IV_EXPAND = 'PRODUCTS/SUPPLIER' ) - which is the indicator that you can return a table of categories in which every category entry has a 'PRODUCTS table component and every products entry contains another structure component 'SUPPLIER' . Exporting parameter ET_EXPANDED_TECH_CLAUSES of GET_EXPANDED_ENTITY / GET_EXPANDED_ENTITYSET needs then to contain one entry 'PRODUCTS/SUPPLIER' to tell the framework that this expression has already been handled by the application. If the $expand expression follows several navigation paths for the Category which are handled by application the ET_EXPAND_TECH_CLAUSES need to contain an additional entry besides 'PRODUCTS/SUPPLIER' for each path.

Parameter

Description

IV_EXPAND

Expression which can be handled by the application

RV_RESULT

This has the value GCS_COMPARE_RESULT-MATCH_NO if the given expand string does not match. It has the value GCS_COMPARE_RESULT-MATCH_SUBSET if the given expand is a subset of the current expand tree. It has the value GCS_COMPARE_RESULT-MATCH_EQUALS if the given expand string matches fully.

Method GET_TECH_ENTITY_SET

This method returns the technical name of an entity set.

Parameter

Description

RV_ENTITY_SET

Type /IWBEP/MGW_TECH_NAME.

Method GET_TECH_ENTITY_TYPE

This method returns the technical name of an entity type.

Parameter

Description

RV_ENTITY_TYPE

Type /IWBEP/MGW_TECH_NAME.

Method GET_MULTIPLICITY

This method returns the cardinality 0..1, 1..1, 0..n or 1..n.

Parameter

Description

RV_MULTIPLICITY

Type /IWBEP/MGW_MED_ODATA_TYPES=>TY_E_MED_CARDINALITY.

Method GET_CHILDREN

This method returns the child nodes of an entity.

Parameter

Description

RT_CHILDREN

Type IWBEP/IF_MGW_ODATA_EXPAND=>TY_T_NODE_CHILDREN.

Method GET_SELECTED_PROPERTIES

This method is similar to GET_SELECT_WITH_MANDTRY_KEYS of interface /IWBEP/IF_MGW_REQ_ENITY or /IWBEP/IF_MGW_REQ_ENITYSET and returns the selected properties including the mandatory fields (keys, etag, mime type mapping) of the current entity and also of all included expands.

Parameter

Description

RT_SELECT

Type STRING_TABLE.

Method GET_SELECT_ENTITY_PROPERTIES

This method is similar to GET_SELECT_ENTITY_PROPERTIES of interface /IWBEP/IF_MGW_REQ_ENITY or /IWBEP/IF_MGW_REQ_ENITYSET and contrary to GET_SELECT_PROPERTIES, it only returns the selected properties including the mandatory fields of the current entity.

Parameter

Description

RT_SELECT

Type STRING_TABLE.

Method IS_EXPAND_NEEDED

This method is provided to prevent unneeded expand, in order to improve processing performance.

Example: Using the request URI "...Orders(OrderId='1')?$expand=OrderDetails&$select=OrderDate" an OData consumer causes an expand from the order entity with key OrderId '1' to OrderDetail, but it only selects the property OrderDate from the order entity. That means the expand to OrderDetail is actually not needed, and the provider application can ignore the expand requirement.

Note

This method only returns the correct value if the SAP Gateway system is also on at least support package 11. Otherwise, it always returns ABAP_TRUE.

Parameter

Description

RT_VALUE

Type ABAP_BOOL.