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.
If the addition USING KEY is not used, the addition INDEX can only be specified for index tables and determines the line to be read from the primary table index.
Table expressions
allow corresponding reads to also be performed in operand positions. Here, an index is specified as a numeric argument idx.
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 table has a sorted secondary key, this can be specified in keyname and the line to be read is then determined from its secondary table index. A secondary hash key cannot be specified.
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.
Leave us your contact details and we will call you back. Fields marked with * are mandatory.
We offer holistic SAP solutions from a single source to shape digital change and develop new business areas.
Switzerland
Schaffhausen
Germany
Mannheim, Düsseldorf, Munich
USA
Haverhill
Greece
Thessaloniki