Show TOC

Interface /IWBEP/IF_V4_MED_FUNCTIONLocate this document in the navigation structure

This is the interface for functions for OData version 4 (V4). This interface provides methods to maintain a function during the creation of a service model in a model provider class.

Functions and also actions are so called operations. Functions are operations that do not have side effects and may support further composition, for example, with additional filter operations. Functions always have to return data.

This interface includes interface /iwbep/if_v4_med_element.

Table 1: Aliases

Visibility and Level

Alias

Component

public

get_edm_name //IWBEP/IF_V4_MED_ELEMENT~GET_EDM_NAME

public

get_internal_name

/IWBEP/IF_V4_MED_ELEMENT~GET_INTERNAL_NAME

Methods
Method CREATE_FUNCTION_IMPORT

This method creates the function import for a function.

Function imports enable unbound actions to be called from the service root.

Code Syntax
    IMPORTING
      iv_function_import_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_function_import) TYPE REF TO /iwbep/if_v4_med_func_imp
    RAISING
      /iwbep/cx_v4_med .
Table 2:

Parameter

Description

iv_function_import_name

Internal function import name.

ro_function_import

Function import.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method CREATE_RETURN

This method creates a return for a function.

Functions always have to return data which represents the result of the function. Use this method to create a return type for the function, for example a primitive type or an entity type.

Code Syntax
    RETURNING
      VALUE(ro_return) TYPE REF TO /iwbep/if_v4_med_func_return
    RAISING
      /iwbep/cx_v4_med .
Table 3:

Parameter

Description

ro_return

Function name.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_PARAMETER

This method gets a parameter of a function.

After retrieving the parameter, the characteristics of the parameter can be enhanced or changed.

Code Syntax
    IMPORTING
      iv_parameter_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_parameter) TYPE REF TO /iwbep/if_v4_med_func_param
    RAISING
      /iwbep/cx_v4_med .
Table 4:

Parameter

Description

iv_parameter_name

Internal parameter name.

ro_parameter

Function parameter.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_PARAMETERS

This method gets all parameters of a function.

After retrieving the parameters, the characteristics of the parameters can be enhanced or changed.

Code Syntax
    EXPORTING
      et_parameter TYPE /iwbep/if_v4_med_element=>ty_t_function_parameter
    RAISING
      /iwbep/cx_v4_med .
Table 5:

Parameter

Description

et_parameter

Function parameter.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_RETURN

This method gets the return of an function.

After retrieving the return, the characteristics of the return can be enhanced or changed.

Code Syntax
    RETURNING
      VALUE(ro_return) TYPE REF TO /iwbep/if_v4_med_func_return
    RAISING
      /iwbep/cx_v4_med .
Table 6:

Parameter

Description

ro_return

Function return.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method SET_EDM_NAME

This method sets the EDM name of a function.

The EDM name must be unique within the model.

Code Syntax
    IMPORTING
      iv_edm_name TYPE /iwbep/if_v4_med_element=>ty_e_med_edm_name
    RAISING
      /iwbep/cx_v4_med .
Table 7:

Parameter

Description

iv_edm_name

EDM name.

Exceptions

The metadata exception is iwbep/cx_v4_med.