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

Former Member
0 Likes
694

Hi all,

What is the statement used to move the contents of a table into an internal table?

Regards,

Hema

8 REPLIES 8
Read only

Former Member
0 Likes
675

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

Read only

Former Member
0 Likes
675

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

Read only

Former Member
0 Likes
675

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.

Read only

Former Member
0 Likes
675

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?

Read only

gopi_narendra
Active Contributor
0 Likes
675

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

Read only

0 Likes
675

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

Read only

0 Likes
675

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

Read only

varma_narayana
Active Contributor
0 Likes
675

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>