Show TOC

Interface /IWBEP/IF_V4_MED_ACTIONLocate this document in the navigation structure

This is the interface for actions for OData version 4 (V4). This interface provides methods to maintain an action during creation of a service model in a model provider class. Functions and actions as well are also called operations.

Actions are operations that allow side effects, such as data modification, and cannot be further composed in order to avoid non-deterministic behavior. Actions may 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_ACTION_IMPORT

This method creates the action import of an action.

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

Code Syntax
create_action_import
    IMPORTING
      iv_action_import_name  TYPE /iwbep/if_v4_med_element=>ty_e_med_internal_name
    RETURNING
      VALUE(ro_action_import) TYPE REF TO /iwbep/if_v4_med_action_imp
    RAISING
      /iwbep/cx_v4_med .
Table 2:

Parameter

Description

iv_action_import_name

Internal action import name.

ro_action_import

Action import.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method CREATE_PARAMETER

This method creates a parameter on an action.

Actions can operate on parameter values. In order to be able to pass parameter values to an action, parameters must be defined for actions.

Code Syntax
create_parameter
    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_act_param
    RAISING
      /iwbep/cx_v4_med .
Table 3:

Parameter

Description

iv_parameter_name

Internal parameter name.

ro_parameter

Action parameter.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method CREATE_RETURN

This method creates a return for an action.

Actions may return data which represents the result of the action. Use this method to create a return type for the action, for example a primitive type or an entity type.

Code Syntax
  create_return
    RETURNING
      VALUE(ro_return) TYPE REF TO /iwbep/if_v4_med_act_return
    RAISING
      /iwbep/cx_v4_med .
Table 4:

Parameter

Description

ro_return

Operation return.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_PARAMETER

This method gets the parameter of an action.

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

Code Syntax
get_parameter
    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_act_param
    RAISING
      /iwbep/cx_v4_med .
Table 5:

Parameter

Description

iv_parameter_name

Internal parameter name.

ro_parameter

Action parameter.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_PARAMETERS

This method gets all parameters of an action.

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

Code Syntax
 get_parameters
    EXPORTING
      et_parameter TYPE /iwbep/if_v4_med_element=>ty_t_action_parameter
    RAISING
      /iwbep/cx_v4_med .
Table 6:

Parameter

Description

et_parameter

Action parameter.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method GET_RETURN

This method gets the return of an action.

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

Code Syntax
get_return
    RETURNING
      VALUE(ro_return) TYPE REF TO /iwbep/if_v4_med_act_return
    RAISING
      /iwbep/cx_v4_med 
Table 7:

Parameter

Description

ro_return

Operation return.

Exceptions

The metadata exception is iwbep/cx_v4_med.

Method SET_EDM_NAME

This method sets the EDM name of an action.

The EDM name must be unique within the model.

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

Parameter

Description

iv_edm_name

EDM name.

Exceptions

The metadata exception is iwbep/cx_v4_med.