‎2010 May 17 8:58 AM
Hi all,
My scenario is:
There is a standard DB table 'Table1'. There are 5 fields in that in which flag and email adresses are 2 fields among the five. Now my requirement is we have to tranfer the Table1 data in to another database table 'Table2'. In additional we have fill the Email addresses and also Flag values to Table2 from table1.
Plz let me teh code for this.
Thanks,
jack
‎2010 May 17 9:07 AM
You want to copy Table1 records to table 2 or something else??
In first case, select all records from tab1 and modify tab2 with these records.
‎2010 May 17 9:26 AM
Hi Sandeep,
Yes i have to put the data from Table1 into Table2. I mean the complete Table1 data should be sent to Table2. In additional there are 2 new fields added to Table1. Those fields are now added to table2 also.
Thanks
Jack
‎2010 May 17 9:08 AM
Hi Jack,
First select records from Table1
for eg.
select field1 field2 field3 field4 field5
into table itab where cond1
cond 2 ....etc.
if not itab[] is initial.
INSERT Table2 FROM TABLE itab[].
endif.
This way you can fill the Table2 values from Table1.
Regards,
Md Ziauddin.
‎2010 May 17 9:46 AM
HI ZIAUDDIN ,
There are no conditions in the selct statement.
Just want to keep th Tbale1 to table2. every thing should come from Table1 to Table2.
Thanks
Jack
‎2010 May 17 10:17 AM
Hi Jack,
For this I am suggesting you to write a simple report. On the selection screen give the key fields of the Table1.
Then in the report write the select query as mention above. In the where condition use the selection screen values or pass the null values it will bring all the records from the table.
Regards,
Md Ziauddin.
‎2010 May 17 9:43 AM
Select records from table1 into one internal table.
Loop on tthis table and move it to work area.
modify the WA as per requirement.
Append the WA to new ITAB.
endlioop.
If ITAB2[] is not initial.
modify <DB TABLE 2> from ITAB.
Thnx