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
395

Hi

i want to read a table with where condition

since reading with where condition is not possible we have to use with key

so if the fields are not primary key as to be used for where conditions. so can we use with key addition to the same

for eg

red table It_itab into wa_itam

with field1 = value1

and field2 = value 2

so if the field 1 and field 2 are not primary key so can we use with key addition and what is the impact or any other way to read the table withouth primary key

regards

Arora

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
362

Reading a table without primary key means LOOP AT.

Thomas

3 REPLIES 3
Read only

ThomasZloch
Active Contributor
0 Likes
363

Reading a table without primary key means LOOP AT.

Thomas

Read only

0 Likes
362

yes thomas that is what i mean

so if i have where condition of some value to match..the read statement and i want to read for that where conditino value but the fields are not primary key then what is the bst way to read the particular record?

Read only

Former Member
0 Likes
362

In case the two fields make the record unique in the internal table, you better do a READ TABLE.

In case you have multiple records, you do first a sort on the 2 fields ands afterwards a loop.