‎2007 Aug 20 7:47 AM
Hi all,
What is the statement used to move the contents of a table into an internal table?
Regards,
Hema
‎2007 Aug 20 7:50 AM
Hi,
select query used to get the data into internal tables then u can do the following things.
If both the internal tables have the same structure the u can achive this in the following ways.
If target internal table is initial then u can use
Move itab1[] to itab2[].
If it is not initial.
Then u can use
append lines of itab1 to itab2.
Thanks,
CSR.
***please reward if helpful.
null
‎2007 Aug 20 7:50 AM
hi,
Select * from DBtable into table <internal_table> where <cond>.
The above statement is used to move contents of database table to an internal table./
If you have two internal table of same structure then
itab1[] = itab2[].
rewards if useful,
regards,
nazeer
‎2007 Aug 20 7:51 AM
Hi,
If u r going to move Contents from one Internal Table to another means use,
MOVE [itab1] TO [itab2].
If u r going to move Contents from Database Table to one Internal Table means use,
SELECT * FROM <table name> INTO CORRESPONDING FIELDS OF TABLE <itab> where <condition>.
Regards,
Padmam.
‎2007 Aug 20 7:51 AM
Hi
if u want to transfer data from database table to internal table
then use select
or if u want to move data from one table to another table with same structure use
itab2[] = itab1[].
or
loop at itab1.
itab2 = itab1.
append itab2.
clear itab1, itab2.
endloop.
is this ur req?
‎2007 Aug 20 7:53 AM
if the strucutre of both the internal tables are same you can directly move liek this
move itab1 to itab2.
or
itab2[] = itab1[].
if the structures of both the internal tables are different. you have to use
move-corresponding itab1 to itab2.Regards
Gopi
‎2007 Aug 20 7:58 AM
Hi,
I want to move all the contents of a database table idoc_contrl into an internal table t_edidc.How can i move?
Regards,
Hema
‎2007 Aug 20 8:12 AM
data : t_edidc TYPE table of idoc_contrl initial size 0.
select * from idoc_contrl " idoc_contrl is the database table
into table t_edidc " t_edidc is an internal table
where <condition>. " if any conditions applies
Regards
Gopi
‎2007 Aug 20 7:56 AM
Hi...
From DB table to Internal Table:
**To fetch the data into itab by overwriting existing records in itab
SELECT <FIELDS> from <DB TABLE> INTO TABLE <ITAB> WHERE <CON>.
**To fetch the data into itab without overwriting existing records in itab
SELECT <FIELDS> from <DB TABLE> APPENDING TABLE <ITAB> WHERE <COND>.
From ITAB to ITAB:
1. If both ITABs has same structure(fields)
ITAB2[] = ITAB1[].
2.If the Structure is diffrerent
LOOP AT ITAB1 INTO WA1.
MOVE-CORRESPONDING WA1 TO WA2.
APPEND WA2 TO ITAB2.
ENDLOOP.
<b>Reward if Helpful</b>