Hi all,
we are trying to obtain this result:
- We have a source standard table itab
- We want transform this table to a hashed table
- The unique key of the hashed table must be calculated at runtime (e.g. the columns of the table used as key are known only at runtime)
- Then we want to read data from the table using the key defined above.
We are able to convert the standard table to a hashed table but we are not able to define the key at runtime.
We found this: Reading Lines of Tables (SAP Library - ABAP Programming (BC-ABA))
If you do not know the name of one of the key fields until runtime, you can specify it dynamically as the content of a field n1... nn using (n1)
= f1 (n2) = f2 If the data types of f1... fn are not compatible with the key fields, the system converts them. If the row type of the internal table is not structured, you can specify a comparison with the pseudo-component table_line.
But we cannot understand how does it work.
Could you help us?
Thank you