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 statement

Former Member
0 Likes
1,361

How can i read a field from an internal table which satisfied with multiple values..

Can any1 send the syntax..

/Ram

Edited by: Ram Ram on Jan 9, 2009 8:10 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,276

then you have to go for the option "LOOP"....not read..

10 REPLIES 10
Read only

Former Member
0 Likes
1,277

then you have to go for the option "LOOP"....not read..

Read only

0 Likes
1,276

You meant to say, looping the itab with those conditions and exit the loop explicitely if my condition satisfied...

Does it consume time of program execution...

Read only

0 Likes
1,276

but it is the only way to take multiple values.....read statement works for single value always

Read only

0 Likes
1,276

Hi,

If you want to check for record exits in the internal table or not with particular condition then READ statement oK or you can loop explicitely if condition satisfied exit there will be difference in time consumption...

but if want to do the processing on all the records which satisfies the condition then you need to use the LOOP AT WHERE...ENDLOOP statement.

Read only

0 Likes
1,276

(I) LOOP AT IT_HISTORY INTO WA_HISTORY WHERE EQUNR = WA_ESN-EQUNR

AND BWART EQ '351'

AND SHKZG = 'H'.

ENDloop.

(II) LOOP AT IT_HISTORY INTO WA_HISTORY WHERE EQUNR = WA_ESN-EQUNR

AND ( BWART EQ '351' OR BWART EQ 'Z13' )

AND SHKZG = 'H'.

endloop.

My IT_HISTORY contain data only with so many BWART = '351' and bwart ='Z13' records..i want to catch the very first record which satisfies the condition BWART EQ '351' OR BWART EQ 'Z13' .

which statement take longer time of execution...

Read only

Former Member
0 Likes
1,276

hi,

use

loop ....endloop on the internal table...

hope this help you..

regards

Ritesh J

Read only

Former Member
0 Likes
1,276

hi,

You cannot use the read statement you have to use

LOOP AT <itab> WHERE <field> EQ  <field>.
*  Do the processing
ENDLOOP.

Read only

Former Member
0 Likes
1,276

Hi,

Use LOOP....ENDLOOP statement.

Loop at <itab> on <field> eq <chk field>

proccesing.

endloop.

Regards

Rajesh Kumar

Read only

Former Member
0 Likes
1,276

Hi,

Can you please be more Clear..

If you want to read a single record from the internal table then we use READ Statement.If you want to retrieve more than One record the use LOOP.ENDLOOP..

Regards

Vasavi Kotha

Read only

Former Member
0 Likes
1,276

Hi,

You can not use READ statement. You have to use LOOP and ENDLOOP.

You want to do for all records satifies the condition then you use LOOP AT ITAB where (your condition) ENDLOOP.

If you want to check for already existing records in the ITAB with parcticular condition then use READ statement.

Regards,

Jyothi CH.