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

Diff between it_tab1 = it_tab2 and it_tab1[] = it_tab2[]

Former Member
0 Likes
1,410

what is the difference between it_tab1 = it_tab2 and it_tab1[] = it_tab2[].

Will it_tab1 = it_tab2 mean only the header line contents are assigned to it_tab1?

regards,

balaji

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,172

it_tab1 = it_tab2 only header data will get assigned

it_tab1[] = it_tab2[] taable contents will get assigned

9 REPLIES 9
Read only

Former Member
0 Likes
1,173

it_tab1 = it_tab2 only header data will get assigned

it_tab1[] = it_tab2[] taable contents will get assigned

Read only

Former Member
0 Likes
1,172

Hi,

it_tab1[] = it_tab2[] :

This is like copying the body of it_itab1 to it_itab2.

Hope this helps u,

Arunsri

Read only

Former Member
0 Likes
1,172

hi....

itab1 = itab2 is just for header data of the internal table whereas itab1[] = itab2[] is ued for bosy of the internal table i.e. all the contents of internal table itab1 will be passed on to internal table 2.

whereas in the first statement only the contenets in the header line will be passed on.

Read only

Former Member
0 Likes
1,172

Hi Balaji!

u r right in saying that widout [] symbol only header lines are copied.

Wid [] symbol the complete body i.e contents are copied.

rewrd if helpful.

Read only

Former Member
0 Likes
1,172

If you created an internal table with optional header line means WITH HEADER LINE statement....

then it_tab1 = it-tab2 refers only header lines are copied

it-tab1[] = it_tab2[] refers body of the itab are copied.

Regards,

Dara.

Read only

Former Member
0 Likes
1,172

if it_tab1 and it_tab2 both of them are declared with header line then

it_tab1 = it_tab2. >> means transferring header line contents from it_tab2 to it_tab1.

And

it_tab1[] = it_tab2[]. >> means transferring contents of table body from it_tab2 to it_tab1.

if it_tab1 and it_tab2 both of them are declared without header line then

it_tab1 = it_tab2. >> means transferring contents of table body from it_tab2 to it_tab1.

And

it_tab1[] = it_tab2[]. >> means transferring contents of table body from it_tab2 to it_tab1.

i.e. there is no diff. between these 2 statements.

Regards,

Joy.

Read only

MarcinPciak
Active Contributor
0 Likes
1,172

Hi,

Writing itab_tab1 you address only header line, whereas itab_tab1[] you address its content.

Therefore statement:

it_tab1 = it_tab2 - will copy header line of it_tab2 to it_tab1

it_tab1[ ] = it_tab2[ ] - will copy content of it_tab2 to it_tab1

Note!

Both tables must be defined with header lines.

Regards,

Marcin

Read only

0 Likes
1,172

Hi balaji,

it_tab1 = it_tab2 will assing only header from it_tab2 to it_tab1.

where as it_tab[] stands for table content so

it_tab1[] = it_tab2[] will copy entire data from it_tab2 to it_tab1 . (if both are compatibility)

Please reward if useful.

Regards ,

Naveen

Read only

Former Member
0 Likes
1,172

Hi,

If you created an internal table with header line means WITH HEADER LINE statement....

1. it_tab1 = it-tab2 : only header lines are copied from it-itab2 to it-itab1.

it-tab1[] = it_tab2[] : body of the itab are copied from it-itab2 to it-itab1.

Plz reward if useful.

thanks,

dhanashri.