Ansicht
Dokumentation

ABAPDERIVED_TYPES_TKY - DERIVED TYPES TKY

ABAPDERIVED_TYPES_TKY - DERIVED TYPES TKY

General Material Data   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

%tky

%tky is a component group in BDEF derived types. It contains %key and the draft indicator %is_draft as components. Hence, it is predominantly used in draft scenarios for referring to the primary key because the draft indicator is already included.

Since %tky includes %key, %tky can also be used in non-draft scenarios for referring to the primary keys. Its use in non-draft scenarios is even recommended as a preparation for a later switch to a draft scenario. In doing so, lots of adaptations to the code regarding the keys and the inclusion of %is_draft can be avoided.

Moving %tky between two distinct types (for example, ...-%tky = ...-%tky) must be avoided to prevent errors. Instead, an expression with the component operator CORRESPONDING should be used, for example, ...-%tky = CORRESPONDING #(...-%tky).

Use of keys and RAP BO instance identifiers in a nutshell

  • Wherever %key can be specified within statements during the RAP interaction phase except for RAP create operations, %tky can be specified, too.

Note

As outlined in the topic Use of keys and RAP BO instance identifiers in a nutshell, the use of %tky is generally preferable in whatever context. However, there are special cases in which %tky is not available and %pky can be used instead, for example, implementations with draft actions or save actions.

Example

The following source code section taken from DEMO_RAP_DERIVED_TYPES_TKY demonstrates the component %tky.

The example Using %tky demonstrates the use of %tky with a managed RAP BO in a draft and non-draft scenario.






BAL_S_LOG - Application Log: Log header data   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 3023 Date: 20240616 Time: 120448     sap01-206 ( 52 ms )