‎2007 Aug 16 9:18 AM
Hi Friends,
Can we select records from a database table into 2 internal tables using one select statement.
regards,
‎2007 Aug 16 9:19 AM
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
‎2007 Aug 16 9:19 AM
‎2007 Aug 16 9:20 AM
Hi,
It's not possible.
Hope this helps.
reward if helpful.
Regards,
Sipra
‎2007 Aug 16 9:20 AM
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
‎2007 Aug 16 9:21 AM
Hi Chaitanya,
I hope its possible to put records into 2 internal table with a single select statement.
‎2007 Aug 16 9:32 AM
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
‎2007 Aug 16 9:44 AM
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
‎2007 Aug 16 9:49 AM
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.