Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  ABAP RESTful Programming Model 

CHANGING-Parameter

Other versions: 7.31 | 7.40 | 7.54

Syntax


CHANGING  failed    TYPE DATA 
          mapped    TYPE DATA
          reported  TYPE DATA.

Effect

When implementing a business object provider, the implicit output parameters failed, mapped and reported are used for errors, mapping and messages in the method signature of a handler class. Those parameters don’t have fixed data types and are assigned with derived types from the behavior definition instead.

The parameters failed, mapped and reported can be explicitly declared as CHANGING parameters, using the generic DATA type. The DATA type is replaced by the derived types that result from the specific behavior definition.

The following describes the parameters failed, mapped and reported:

  • failed
    Defined as a nested table that contains a table for every entity defined in the behavior definition. The failed tables contain information to identify the data record where an error has occurred: %CID, [%PID], ID of the relevant business object instance and %FAIL.
  • mapped
    Only relevant for the CREATE operation. Defined as a nested table that contains a table for every entity defined in the behavior definition. You receive information about which key values were assigned for certain %CID by the application. The relevant data record is identified using the components %CID, [%PID] and %KEY. Possible combinations:
  • %CID and ID: The user has not specified an ID, which is why an ID or a temporary ID is created.
  • %CID and %PID: The user has not specified an ID and no temporary numbers are available.
  • reported
    Defined as a nested table that contains a table for every entity defined in the behavior definition. The output parameter reported is used to return messages. The relevant data record for a message is identified using the following components: %CID, [%PID], ID of the relevant instance, %MSG with an instance of the message interface, %ELEMENT referring to all elements of an entity. Messages that don’t refer to a certain entity instance can be returned using the component %OTHERS.


Example

TYPES tt_f_root TYPE TABLE FOR FAILED sales_order.

The element information for the failed parameter type tt_f_root:

tt_f_root TYPE STANDARD TABLE OF
%CID      TYPE abp_behv_cid
travelid  TYPE travel_id
%FAIL     TYPE if_abap_behv=>t_failinfo


Example

TYPES tt_r_root TYPE TABLE FOR REPORTED sales_order.

The element information for the parameter type tt_r_root:

tt_r_root     TYPE STANDARD TABLE OF
%CID          TYPE abp_behv_cid
travelid      TYPE travel_id
%msg          TYPE REF TO if_abap_behv_message
%ELEMENT
  travelid   TYPE abap_behv_flag
  customerid TYPE abap_behv_flag
  agencyid   TYPE abap_behv_flag