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

query statement for internal table

Former Member
0 Likes
1,103

is it possible to use a select statement to select data from an internal table? if yes, can anyone show me the codes to it? thx

1 ACCEPTED SOLUTION
Read only

former_member386202
Active Contributor
0 Likes
1,082

Hi,

No you cant use . USe READ TABLE statement to read data from internal table.

READ TABLE ITAB INDEX 10.

READ TABLE ITAB WITH KEY.....

Regards,

PRashant

10 REPLIES 10
Read only

former_member386202
Active Contributor
0 Likes
1,083

Hi,

No you cant use . USe READ TABLE statement to read data from internal table.

READ TABLE ITAB INDEX 10.

READ TABLE ITAB WITH KEY.....

Regards,

PRashant

Read only

dhruv_shah3
Active Contributor
0 Likes
1,082

Hi,

Use the Read table for reading the data from the internal table

inside the loop statement.

Regards,

DS

Read only

Former Member
0 Likes
1,082

hi,

if use read table how am i suppose to retrieve the number of records given a specific condition from a internal table.

Read only

0 Likes
1,082

hi,

use read table with key into wa...

( and then specify ur unique key)

try f1 help for read.if a record with the specified key is found then sy-subrc = 0 and wa will contain the record read.

hope this solves ur problem.

Read only

0 Likes
1,082

for that purpose use LOOP AT ... TRANSPORTING NO FIELDS WHERE ...

and increase a counter inside the loop.

Cheers

Thomas

Read only

Former Member
0 Likes
1,082

Hi,

You use SELECT statement to read data from database table but not from Internal table.

For reading data from Internal table, you have to use READ statement.

To know more information on READ statement, Place cursor on READ statement and press F1.

Thanks.

Regards,

Hari

Read only

Former Member
0 Likes
1,082

Hi,

It is not possible to write a select statement on internal table. You can use read statement on internal table.

Thanks,

Sri.

Read only

Former Member
0 Likes
1,082

Hi Daphne,

You use SELECT statement to read data from database table but not from Internal table.

For reading data from Internal table, you have to use READ statement.

Syntax:

READ TABLE itab { table_key

| free_key

| index } result.

Effect of using read statement:

This statement reads a row from internal table itab. You have to specify the row by either naming values table_key for the table key, a free condition free_key or an index index. The latter choice is possible only for index tables. The output result result determines when and where the row contents are read.

If the row to be read is not uniquely specified, the first suitable row is read. In the case of index tables, this row has the lowest table index of all matching rows.

Reward if usefull

thanks

swaroop

Read only

Former Member
0 Likes
1,082

thx all people. my qn is solved

Read only

Former Member
0 Likes
1,082

solved