Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9190

Re: Use of (primary) key in internal tables

$
0
0

Hi Matthew,

 

thank you for the support regarding my initial post.

 

Well, I tried to get the answer from the documentation.

 

My question is about a table declared as SORTED TABLE WITH UNIQUE KEY table_line.

 

What about a LOOP ... WHERE <field> = <value>?

 

For the database, we know that an index is used, when then first field is (all fields are) first part of the primary index (or another index). Using index field n without giving index field n-1 results in sequential read.

 

In my internal table, this would be the field MANDT because it is declared TYPE <ddic table>. For database, implicitly SY-MANDT will be used. To be sure I specified mandt = sy-mandt in the WHERE clause and the the following but not all fields.

 

The first n fields (say field1 ..fieldn) I know and I can specify as <field> = <value>. The last fields (field n+1 ... field n+x) are the attributes I am interested in. They are also part of the key table_line.

 

The only thing I found is about a table of references of the table structure using table_line-><component> for the access. That will probably result in code some of my colleagues would not fully understand.

 

So my question is not really answered. I could not find information about using the key named table_line. Will the compiler know that my fields used in the WHERE clause are part of the key table_line and optimize accordingly?

 

Actually it would cost me some time to setup a measure routine to check. So I still hope for some experts guidance. Of course, everyone who feels he can add more to the solution than posting links it invited to help. Raymond: Thank you for the links. I coudn't find the string 'table_line', please help.

 

Thanks and regards

 

Clemens


Viewing all articles
Browse latest Browse all 9190

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>