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

Internal table to a standard database table

Former Member
0 Likes
829

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

6 REPLIES 6
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
796

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.

Read only

0 Likes
796

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

Read only

Former Member
0 Likes
796

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.

Read only

0 Likes
796

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

Read only

0 Likes
796

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.

Read only

Former Member
0 Likes
796

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