We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!
... INDEX idx $[USING KEY keyname$] ...
Using the INDEX addition, the READ statement reads the line in the line number specified in idx in a table index. idx is a numeric expression position with the operand type i. If the value of idx is less than or equal to 0 or greater than the number of table lines, no line is read and sy-subrc is set to 4. After a successful read, the system field sy-tabix contains the line number specified in idx in the primary or secondary table index used.
Reading of the first ten lines of the internal table sflight_tab using the primary table index.
Instead of the DO loop, a LOOP
or a corresponding iteration expression with FOR is used for this purpose.
... USING KEY keyname
The addition USING KEY can be used to specify a table key in keyname to specify the table index to be used explicitly.
If the primary table key is specified using its name primary_key, the table must be an index table, and the behavior is the same as if USING KEY was not specified.
Reading of the first ten lines of the internal table sflight_tab using a secondary table index. Instead of the DO loop, a LOOP or a corresponding iteration expression with FOR is used for this purpose.