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 statement

Former Member
0 Likes
904

Hi Friends,

Can we select records from a database table into 2 internal tables using one select statement.

regards,

8 REPLIES 8
Read only

Former Member
0 Likes
885

Hi!

No, you can't select into 2 internal tables.

You can select into more fields, like this:

SELECT SINGLE matnr werks

FROM marc

INTO lv_matnr, lv_werks

WHERE matnr = '100001'.

Regards

Tamás

Message was edited by:

Tamás Nyisztor

Read only

Former Member
0 Likes
885

Hi chaitanya,

it is not possible.

Regards,

Murali Krishna K

Read only

Former Member
0 Likes
885

Hi,

It's not possible.

Hope this helps.

reward if helpful.

Regards,

Sipra

Read only

Former Member
0 Likes
885

Hi,

You cannot do it with into table statement , but with a select... endselect statement you can append in as many internal tables as you like.

Alternatively you can select the entire data once using into table statement , then transfer all the records to second internal table for avoiding load on the database.

Hope this helps.

Thanks,

imtiaz Syed

Read only

Former Member
0 Likes
885

Hi Chaitanya,

I hope its possible to put records into 2 internal table with a single select statement.

Read only

0 Likes
885

Sathiya,

What kind of answer is "I hope its possible"??????

I hope I win the lottery but what are the chances of that, very slim I would imagine.

Surbjeet

Read only

Former Member
0 Likes
885

HI

YOU DON'T HAVE ACCESS TO WRITE A SELECT QUERY FOR 2 INTERNAL TABLES

YOU CAN GET DATA FROM 2 DATABASE TABLES INTO ONE INTERNAL TABLE

ONE DATABASE TO 2 INTERNAL TABLES IN ONE SELECT QUERY IS NOT POSSIBLE

IF YOU WANT DATA IN 2 INTERNAL TABLES OF DIFFRENT DATA THEN YOU NEED TO WRITE TWO SELECT QUERYS

IFYOU WANT DATA IN 2 INTERNAL TABLES OF SAME DATA THEN 1ST WRITE A SELECT QUERY FOR ONE AND MOVE THAT DATA TO 2ND INTERNAL TABLE

REWARD IF USEFULL

Read only

Former Member
0 Likes
885

Hi Chaitanya...

Try this...

Select * from <table>

into corresponding fields of table <itab1>

where..

<b>itab2[] = itab1[].</b>

<b>itab1 and itab2 must and should have same structure.</b>

Rward If Helpful.

Regards

--

Sasidhar Reddy matli.