ABAPDATA_SECONDARY_KEY - DATA SECONDARY KEY

ABAP Short Reference   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

DATA - secondary_key

Short Reference


Syntax

... {UNIQUE HASHED}|{UNIQUE SORTED}|{NON-UNIQUE SORTED}
    KEY key_name COMPONENTS comp1 comp2 ... .

Effect

Defines a secondary table key of an internal table (as of Release 7.1). The syntax and semantics of the additionsare the same as those for the TYPES statement for standalone table types.

Notes

  • When internal tables are accessed with the statements READTABLE itab, LOOPAT itab, MODIFYitab, and DELETEitab, a secondary key can be used to determine the rows to be processed or the processing order.To do this, the additions WITH [TABLE] KEY ... COMPONENTS or USING KEY must be specified. A secondary key is never used implicitly.
  • The INSERT itabstatement determines the insert position using the primary key and primary index only. A secondary keycan be specified only for the source table from which multiple rows are copied. The latter also applies to the APPEND statement.
  • If a secondary key is defined, the addition WITH HEADER LINE can no longer be specified, even outside classes.
  • For more information, see TYPES.

Example

The DEMO_SECONDARY_KEYS program demonstrates the declaration and use of a secondary table key and the resulting performance gains.


PERFORM Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.


Length: 2776 Date: 20120522 Time: 044642     triton ( 98 ms )