‎2006 Aug 30 12:43 PM
Hi,
i want to insert the result of query to a table,
all the fields are corresponding except one field.
is there a way to this or i need to do
insert ( f1 , f2 ....)
----
i did this way
INTO CORRESPONDING FIELDS OF TABLE It_Return_Date
but i have another field which i want to insert to table.
is it possible??
10X
‎2006 Aug 30 12:48 PM
yo may do that way.
Select f1 ft f3 f4 from TABLE_NAME into table it_table.
Bu order of the fields in your it_table declatation must match order of the fields in select query.
BR< JAcek
‎2006 Aug 30 12:47 PM
if the field names are not the same, you will have to use like you said/ >> i need to do
insert ( f1 , f2 ....)
~Suresh
‎2006 Aug 30 12:48 PM
yo may do that way.
Select f1 ft f3 f4 from TABLE_NAME into table it_table.
Bu order of the fields in your it_table declatation must match order of the fields in select query.
BR< JAcek
‎2006 Aug 30 12:54 PM
Hi,
You need to use the SELECT field1 field2...fieldn
INTO inttab
FROM table1.
make sure that the fields in the internal table are in the same order as you have defined in your select query
regards,
sangram
‎2006 Aug 30 1:01 PM
‎2006 Aug 30 12:49 PM
Hi,
Check this :
select fld1 fld2 fld3
from ztable into table i_tab.suppose your table contains one more field fld4, you want update that field with internal table i_tab,
then do like this :
loop at i_tab.
i_tab-fld4 = <value>
modify i_tab.
endloop.
insert ztable from table i_tab.Regards
Appana
‎2006 Aug 30 12:53 PM
lets say you are getting values from a table
select & into X_TAB1 from TAB1.
data : x_tab2 type table2.
x_tab2-newfield = 'new value'. "Populate that new field value
move corresponding X_TAB1 TO X_TAB2. "all other will copy here
then use X_TAB2 to insert to your TABLE2.
INSERT TABLE2 FROM X_TAB2.
it would be a good practice to use same structure of the table while you use Insert/modify etc.. commands.
else you can declare TABLES ZTABLE2.
MOVE CORRESPONDING ZTABLE1 TO ZTABLE2.
ZTABLE2-NEW_FIELD = <NEW VALUE>.
then use INSERT.
INSERT ZTABLE2.Regards
srikanth
Message was edited by: Srikanth Kidambi