SAP CONVERT KEY ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID CONVERT-KEY
• CONVERT KEY OF ABAP_STATEMENT_EML

CONVERT KEY

ABAP_SYNTAX
CONVERT KEY OF bdef
FROM $[TEMPORARY$] pre_key
TO final_key.

What does it do?
Used to retrieve the final keys (final_key) from preliminary keys (pre_key) in the context of RAP late numbering . It is only possible between a COMMIT ENTITIES BEGIN... and COMMIT ENTITIES END. statement.
Details on the syntax elements: Syntax ElementsDetails
CONVERT KEY OF bdef ... Specifies the RAP BO entity 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).
... FROM [TEMPORARY] pre_key ... Specifies the value of the preliminary key pre_key. The type of pre_key must be compatible with %pid or %pre in case of using the addition TEMPORARY. lbr lbr The optional addition TEMPORARY is only relevant in late numbering scenarios in which %pre is used to contain the preliminary keys during the RAP interaction phase - instead of %pid. lbr lbr For more information on the use of %pid, %pre and %key in the context of late numbering scenarios, see the topic Using Keys and Identifying RAP BO Instances in a Nutshell.
... TO final_key.final_key specifies the final key value. The type of final_key must be compatible with the primary key's type.

ABAP_EXAMPLE_VX5
The following source code section taken from CL_DEMO_RAP_EML_COMMIT_3 demonstrates the COMMIT ENTITIES BEGIN ... END variant and CONVERT KEY OF.
ABEXA 01556
ABAP_EXAMPLE_END

ABAP_EXAMPLE_VX5
The following source code section taken from CL_DEMO_RAP_DRVD_TYPES_LATENU2 demonstrates the COMMIT ENTITIES BEGIN ... END variant and CONVERT KEY OF with the addition TEMPORARY.
ABEXA 01625
ABAP_EXAMPLE_END

ABAP_EXAMPLES_ABEXA
The example COMMIT ENTITIES BEGIN, END with CONVERT KEY OF demonstrates the use of this COMMIT ENTITIES statement including CONVERT KEY OF .
The example Using %pre / %tmp demonstrates the use of %pre and %tmp with an unmanaged RAP BO in a late numbering scenario. In this context, a COMMIT ENTITIES statement including CONVERT KEY OF with the addition TEMPORARY is used.
ABAP_EXAMPLE_END

Return to menu