ABAP EML - CONVERT KEY
COMMIT ENTITIES BEGIN
CONVERT KEY OF entity_name
COMMIT ENTITIES END.
For entities with late numbering, the statement MODIFY provides only temporary keys. For these temporary keys, a successful save method draws finalized keys. If, for example, the keys of new instances are passed to a HTTP response, they must be the finalized values and not the temporary values from the MODIFY phase. The statement CONVERT KEY is used for this.
The statement CONVERT KEY may only be used in the context of a block-constructing variant of the statement COMMIT ENTITIES to determine the finalized value of a temporary key. In the context of the statement COMMIT ENTITIES, the runtime of the ABAP RESTful programming model holds its key registry to respond to queries from the statement CONVERT KEY. In the statement COMMIT ENTITIES END, this information is then deleted.
In its dynamic form, the statement CONVERT KEY is passed the name of the entity and does not perform a static type check.
- Unlike the other EML statements, CONVERT KEY does not operate on tables. This is because the consumer typically iterates across the consumer’s own data and needs to fill specific columns. The preceding extraction of all pre_keys, following by a mass conversion and insertion of keys in the target table would be more time-consuming and use more resources than repeating the direct individual operation.