SAP Tutorials Blog


 


DATA it21 TYPE SORTED TABLE OF zdemo_abap_fli

  WITH NON-UNIQUE KEY primary_key ALIAS k1 COMPONENTS carrid connid city

  WITH NON-UNIQUE SORTED KEY cities ALIAS s1 COMPONENTS cityfrom cityto

  WITH UNIQUE HASHED KEY airports ALIAS s2 COMPONENTS airpfrom airpto.


"Example for using table keys and alias names using a LOOP AT statement. 

"All of the statements below are possible.

"Note that if the secondary table key is not specified (and if the USING KEY addition is not 

"used in the example), the primary table key is respected by default.

"Further ABAP statements, such as READ or MODIFY, are available in which the key can be 

"explicitly specified to process internal tables.


LOOP AT it21 INTO DATA(wa) USING KEY primary_key.

"LOOP AT it21 INTO DATA(wa) USING KEY k1.

"LOOP AT it21 INTO DATA(wa) USING KEY cities.

"LOOP AT it21 INTO DATA(wa) USING KEY s1.

"LOOP AT it21 INTO DATA(wa) USING KEY airports.

"LOOP AT it21 INTO DATA(wa) USING KEY s2.

  ...

ENDLOOP.


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Manager

Contact : serkurumsal@yandex.com