‎2009 Jan 09 7:09 AM
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
‎2009 Jan 09 7:13 AM
‎2009 Jan 09 7:13 AM
‎2009 Jan 09 7:16 AM
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...
‎2009 Jan 09 7:18 AM
but it is the only way to take multiple values.....read statement works for single value always
‎2009 Jan 09 7:22 AM
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.
‎2009 Jan 09 7:31 AM
(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...
‎2009 Jan 09 7:15 AM
hi,
use
loop ....endloop on the internal table...
hope this help you..
regards
Ritesh J
‎2009 Jan 09 7:15 AM
hi,
You cannot use the read statement you have to use
LOOP AT <itab> WHERE <field> EQ <field>.
* Do the processing
ENDLOOP.
‎2009 Jan 09 7:18 AM
Hi,
Use LOOP....ENDLOOP statement.
Loop at <itab> on <field> eq <chk field>
proccesing.
endloop.
Regards
Rajesh Kumar
‎2009 Jan 09 7:23 AM
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
‎2009 Jan 09 7:38 AM
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.