Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Read Table

Former Member
0 Likes
659

Whats the significance between the two Read Statements:

READ TABLE it_tab WITH KEY matnr = 'mat001'.

and

READ TABLE it_tab WITH TABLE KEY matnr = 'mat001'.

Are there any performance significance between the two statements.

Points will be rewarded

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
633

using 'with key' you can read based on any field of table

using 'with table key' you have to read based on key fields of table

and obvisioulsy with table key is better, because of the unique ness of record.

Thanks & Regards

Amarender Reddy B

4 REPLIES 4
Read only

Former Member
0 Likes
633

hi arman,

i think there will not be any performance diff between the two statements...

With Regards,

S.Barani

Read only

Former Member
0 Likes
634

using 'with key' you can read based on any field of table

using 'with table key' you have to read based on key fields of table

and obvisioulsy with table key is better, because of the unique ness of record.

Thanks & Regards

Amarender Reddy B

Read only

Former Member
0 Likes
633

Hi ,

For the two statements the second one will perform better

READ TABLE it_tab WITH TABLE KEY matnr = 'mat001'.

as in the first case you are not reading it into a workarea for the

search to be specific but in second case it is based on table key.

Modify the first statement as read table it_tab into wa_tab with key matnr = 'mat001'.

Asha

Read only

Former Member
0 Likes
633

hi,

READ TABLE it_tab WITH KEY matnr = 'mat001'. sincre it uses buffer tables.So whenever data has to be read it can be fetched from buffer tables.instead of every time reading from table hence having high performance than using table.

s

Reward with points if helpful.

Message was edited by:

Vinutha YV