‎2006 Dec 06 9:21 AM
Hi,
Suppose I have some records in my internal table. I got all the records through FM.
Now I wanted to read the records based on following selection
read table itab with key LAND1 <> 'US'.
But I am getting error.
anybody will help me for this??
‎2006 Dec 06 9:25 AM
‎2006 Dec 06 9:25 AM
Hi Salil, Read only reads one record at a time...not multiple records.One thing which can be done here is move the data to another internal table and then use the delete the data from that internal table where land1 NE 'US'.
Regards,
Swaroop
‎2006 Dec 06 9:27 AM
Hello ,
I dont think you can use <> in read table statement.
What i would suggest is try the follwoing code.
loop at itab where land1 NE 'US'.
Do your processing and exit from this loop
ENDLOOP.
‎2006 Dec 06 9:28 AM
REad table would get the required recod into the header .
In can hold only one record at a time.
But for your condition, there may be so many records (NOT equal).
hence you have to use the following syntax instead.
loop at itab where land <> 'US'.
write your logic here.
move itab-field to <target>
exit.
endloop.
Regards,
Ravi
‎2006 Dec 06 9:30 AM
‎2006 Dec 06 9:55 AM
Hi,
Read table syntex will not support <> operator. You can use the following option:
Loop at itab into lw_itab where land1 <> 'US'.
here u may move all the records to another internal table where land1 will
*not be 'US' and then if u need u can read that new internal table with key
*fields.
Endloop.
Cheers.