SAP MODIFY ITAB USING KEY ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITAB - Index Access with Key
The example shows an index access to a hashed table.

ABAP_SOURCE_CODE
DEMO CL_DEMO_MODIFY_TABLE_USING_KEY

ABAP_DESCRIPTION
The table sflight_tab is a hashed table with a unique primary key and a non-unique secondary sorted key. Since a secondary sorted key is specified in the statement MODIFY after USING KEY, it is possible to access the hashed table using the associated secondary table index.
This example only demonstrates the syntax. Generally, instead of using the statement MODIFY, modifications of this type should be made using a field symbol or a data reference: LOOP AT sflight_tab ASSIGNING < sflight_wa> USING KEY plane_type
WHERE planetype = 'A310-300'.
< sflight_wa>-seatsmax = < sflight_wa>-seatsmax + 20.
ENDLOOP.