‎2008 Oct 14 6:15 PM
I would like to create select -endselect construction and print every processed record
select HASH
from UPS_HASH
INTO table t2.
*
write t2-hash.
*
Endselect.
But the system generates the following error :
For the statement Endselect , there is no open structure introduced by select.
Can somebody help me
‎2008 Oct 14 7:19 PM
Hi Comandante,
You have not written the correct syntax. Please see the below correct syntax Table should not be used there.
select HASH
from UPS_HASH
INTO t2.
*
write t2-hash.
*
Endselect.
Instead of this why dont you try with the internal table like below.
select HASH
from UPS_HASH
INTO table t2.
loop at t2.
write t2-hash.
endloop.
This will increase the performance aswell.
Thanks,
Chidanand
‎2008 Oct 14 6:18 PM
my advise is avoid select and endselect. select all records and loop the table and write.
Below is what you want.
select HASH
from UPS_HASH
INTO t2. "remove table
*
write t2-hash.
*
Endselect.
‎2008 Oct 14 6:19 PM
select HASH
from UPS_HASH
INTO table t2.
*
write t2-hash.
*
Endselect.
--
remove your table statement from above, it is causing it to become an array fetch which doesnt need End Select.
On another note, array fetch is much better. if you use that, do a loop on your table T2, and write t2-hash within the loop.
‎2008 Oct 14 6:20 PM
Hi ,
i think there should be into table only into....
Check it out...
Regards,
bharani
‎2008 Oct 14 6:20 PM
try something like this...
data: begin of ti_ups_hash occurs 0,
hash like ups_hash-hash,
end of ti_ups_hash.
select HASH
into corresponding fields of table ti_ups_hash
from UPS_HASH.
loop at ti_ups_hash.
write ti_ups_hash-hash
endloop.
‎2008 Oct 14 7:19 PM
Hi Comandante,
You have not written the correct syntax. Please see the below correct syntax Table should not be used there.
select HASH
from UPS_HASH
INTO t2.
*
write t2-hash.
*
Endselect.
Instead of this why dont you try with the internal table like below.
select HASH
from UPS_HASH
INTO table t2.
loop at t2.
write t2-hash.
endloop.
This will increase the performance aswell.
Thanks,
Chidanand