Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

ABAPEMLCOMMIT_ENTITIES_LATE - EMLCOMMIT ENTITIES LATE

ABAPEMLCOMMIT_ENTITIES_LATE - EMLCOMMIT ENTITIES LATE

BAL Application Log Documentation   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

COMMIT ENTITIES BEGIN, END

COMMIT ENTITIES BEGIN $[IN SIMULATION MODE$] $[${RESPONSE OF ... $| RESPONSES OF ... $} $[response_param$]$].
  ...
  $[CONVERT KEY OF bdef
    FROM $[TEMPORARY$] pre_key
    TO final_key.$]
  ...
COMMIT ENTITIES END.

Effect

This variant is relevant for modify operations on entities for which late numbering has been enabled. It is used to get the final keys from the preliminary keys.

The context of this COMMIT statement is the adjust numbers phase that is triggered as part of the save sequence. For modify operations on entities for which late numbering has been enabled, only preliminary identifiers have been assigned, for example %pid or temporary keys. Those preliminary identifiers are converted to final keys with a successful save. If, for example, the keys of newly created instances are to be transferred to http responses, it must be the final keys and not the preliminary ones from the modify operations.

For this purpose, this COMMIT variant defines a scope in which the EML statement CONVERT KEY OF can be used to retrieve the final keys from preliminary keys:

Syntax Part Details
COMMIT ENTITIES BEGIN ... Opens the commit scope.
RESPONSE OF .../RESPONSES OF ... For the reponse information. The long and dynamic syntax version can be used. The use is optional.
response Both FAILED and REPORTED responses or just one of them can be specified.
CONVERT KEY OF bdef. Specifies the RAP BO (bdef) for which the keys should be converted. In contrast to other EML statements, the CONVERT KEY OF statement does not operate on mass data, i. e. internal tables, but on single values (pre_key, final_key). The CONVERT KEY statement is only possible in this context.
FROM [TEMPORARY] pre_key Specifies the value of the preliminary key (pre_key). The type of pre_key must be compatible with the types of %pid, i. e. abp_behv_pid, the key or ...-%pre. The keyword TEMPORARY is relevant if the variant in place is used in the context of late numbering. Here, the regular %key fields (with the preliminary key values) - instead of %pid - are used for pre_key for which the final key is retrieved via CONVERT KEY OF.
TO final_key. final_key specifies the final key value. The type of final_key must be compatible with the primary key's type.
COMMIT ENTITIES END. Closes the commit scope. With the closing, all information on keys that are relevant for operations performed beforehand are lost.

Example

The following source code section taken from DEMO_RAP_EML_COMMIT_3 demonstrates the COMMIT ENTITIES BEGIN ... END variant and CONVERT KEY OF.






PERFORM Short Reference   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 4732 Date: 20221203 Time: 173531     sap01-206 ( 74 ms )