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
1,039

Please use more informative subject in future

hi,

I have a internal table as follows.

po no | item | state |

45 10 ap

45 10 sp

45 10 pp

46 10 sf

46 10 as

I am useing the read table syntax for this table .

for pono 45 and 46 i want read the records.

but read table is triggring for first record only.

can any body explain how read the record of 46 also.

thanks,

padmaja.

Edited by: Matt on Mar 18, 2009 7:46 AM

10 REPLIES 10
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,009

Hi,

Read statement will read the very first line matching the condition.

So try using:


loop at itab where po_no = '45' or po_no = '46'.
  write: / itab-po_no, itab-item, itab-state.
endloop.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
1,009

Hi,

You can LOOP statement with where clause or

Read Statement will work for each entry only when it is

inside the LOOP statement with KEY mentioned.

Regards

Mansi

Read only

Former Member
0 Likes
1,009

Hi,

Do like this.

loop at itab into wa.

read table itab into wa with key po_no = wa-po_no.

            • your logic, if any*************

endloop.

this will read every record.

Cheers,

Rudhir

Read only

Former Member
0 Likes
1,009

Hi,

Either used

At new po.

read table it into wa.

endat.

or

put loop it into wa.

endloop.

Regards,

Anagha Deshmukh

Read only

Former Member
0 Likes
1,009

Hi Padmaja

Use the Loop Statement instead of the Read statement since Read statement will give you the very first line of the matching condition.

Hope this helps.

Harsh

Read only

Former Member
0 Likes
1,009

hi,

use loop....end loop it select all th evalues in the internal table.

regards

Ritesh J

Read only

matt
Active Contributor
0 Likes
1,009

Please use more informative subject in future

Read only

Former Member
0 Likes
1,009

Hi,

Loop the internal table with where condition or llop the table and use read statement within that.

Sort the internal table before that.

Thanks.

Read only

Former Member
0 Likes
1,009

Hi,

Reading the intrenal table will only be done either by using the READ statement within the loop -endloop or using the WRITE statement again with in the loop-endloop.

As both the statement will read the table at the curretn index only, to read the other entry you need to do it in loop-endloop or in lopp that run from first index to last value(sy-dbcnt).

Pooja

Read only

Former Member
0 Likes
1,009

answerd