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

Select * from itab.

muhammad_sohail
Participant
0 Likes
1,146

Dear All,

Can i select the data from itab.

e.g; Select * from itab into another_itab.

is it possible?

Thanks and Regards,

Muhammad Sohail

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,084

Hi,

No, it is not possible.

aonother_itab[] = itab[].

will be the right statement.

Regards,

Pankaj

10 REPLIES 10
Read only

Former Member
0 Likes
1,084

You cannot perform Select operation on Internal tables. You need to do loop / read operations.

Hope this will help.

Read only

Former Member
0 Likes
1,085

Hi,

No, it is not possible.

aonother_itab[] = itab[].

will be the right statement.

Regards,

Pankaj

Read only

Former Member
0 Likes
1,084

No, you cannot use SELECT * from internal table. SELECT is used only for Database Table.

You can read a single records from Internal Table usong READ TABLE

Else you can loop through the records , using LOOP..ENDLOOP

Read only

Former Member
0 Likes
1,084

Hi,

its not possible ,compulsary you have to mention database table.

Regards,

Madhu

Read only

Former Member
0 Likes
1,084

Dear Muhammad Sohail,

you cannot apply select statement on internal table. Still you can do any operation like Loop, read table on internal table.

Hope this will help you to resolve your query.

Regards,

Vijay

Read only

Former Member
0 Likes
1,084

Hi,

SELECT clause is purely database oriented.

If you want to read data from one internal table into another, try using the MOVE statement or as the others rightly put it, use a READ statement on the internal table or LOOP...ENDLOOP on it.

Read only

Former Member
0 Likes
1,084

Hi,

Select is only for database fetch. If you already have data in the internal table and if you wish to move the data to another internal table, Inside, loop at itab1, you can use the MOVE statment, MOVE CORRESPONDING statement etc. and append it to the second internal table.

Else you can read the internal table 1 and can move the values to the internal table 2.

Regards

Ramesh Sundaram

Read only

Former Member
0 Likes
1,084

Hi,

If we can achieve something in a simple fashion then why should we go for a complicated one..

To copy the contents of an one internal table to the other, just copy the bodies like this.



itab_2[] = itab_1[]

P.S : Use of select statements have performance issues as it increases the number of database hits.

From the above statements it should be quite clear that select is used for database tables only.

No we can't copy the contents of one internal table to other using select statement.

Regards

Abhinab Mishra

Read only

Former Member
0 Likes
1,084

hi select statement is only for database query

you can use read table( for single line read) or loop at (for multi line read )

can u be more specific about your operation on itab.

Read only

Former Member
0 Likes
1,084

hi,

You can select data from itab using Read / loop

Synatx :

read table itab with key

or

loop at itab where