Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  ABAP RESTful Programming Model →  Entity Manipulation Language 

ABAP EML - MODIFY ENTITIES

Other versions: 7.31 | 7.40 | 7.54

Syntax


MODIFY ENTITIES OF root_name 
  ENTITY entity_1_name
    CREATE FROM it_instance
    CREATE BY \assoc_name FROM it_instance_cba
    UPDATE FROM it_instance_u
    DELETE FROM it_instance_d
    EXECUTE action_name FROM it_instance_a
      [RESULT it_result_a | DATA(it_result_a)]
  ENTITY entity_2_name
    ...
  [FAILED   it_failed | DATA(it_failed)]
  [MAPPED   it_mapped | DATA(it_mapped)]
  [REPORTED it_reported | DATA(it_reported)].

Effect

The EML statement MODIFY ENTITIES enables change operations to be made to the CDS entities. It can have a long, short, or dynamic form.

  • The long form, MODIFY ENTITIES, makes it possible to group multiple operations in multiple entities of a business object.
  • The short form MODIFY ENTITY is intended for the special case where only a single entity is operated on.
  • The dynamic form MODIFY ENTITIES OPERATIONS makes it possible to merge operations in multiple business objects in one MODIFY statement. There is no dynamic short form.

The following points apply for the syntax of the statement MODIFY ENTITIES:

  • The name of the business object (the same as the name of the root entity) root_name is specified after OF. This is followed by a list of the operations, grouped by the entity (the schema):
    ENTITY entity_name operation [operation ...]
  • Grouping operations by entity is not mandatory, since ENTITY entity_name can be repeated. The same combination of entity_name and operation, however, cannot occur more than once.
  • The alias of the entity should be used as entity_name, if one is defined in the behavior definition . The original name of the entity can also be used instead of the alias, but this produces a warning.
  • The input of each operation is a table of instances (or a table from %CID in the case of static actions) specified after FROM.
  • For actions that produce a result (in accordance with the behavior definition), RESULT ... can be used to specify a target variable it_result_a or declare it inline (for example, RESULT DATA(it_result_a)).

The following applies for the response variables:

  • The response variables are structures with n components (one component per entity in the business object) that are specified for the derived type of the output parameter.
  • They must either have the matching type (for example, FAILED it_failed) or be declared inline (for example, FAILED DATA(it_failed)).
  • Up to three response variables can be specified to hold response information: FAILED, MAPPED, and REPORTED.
  • These are the early response types (without the addition LATE). The instances are identified using the keys valid in the modifying phase.

Continue

ABAP EML - MODIFY ENTITY

ABAP EML - MODIFY ENTITIES OPERATIONS