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

itab - interview question

Former Member
0 Likes
806

itab1 type table of I occurs with header line

itab2 type table of I occurs with header line

move itab1 to itab2

what will be the content of itab1..

if im right, is it correct to say that itab1 has got only 1 row , header part

and 1 row in bodyline

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
779

Hi Rishi,

First of all you can not use ocurs with type table of.

you have to use :

itab1 type table of I with header line,

itab2 type table of I with header line,

secondly, <b>move itab1 to itab2</b> will only copy the c<b>ontents of header of itab1 to header of itab2</b>.

If you want to copy whole itab1 to itab2, Please use:

<b>move itab1[] to itab2[].</b>

Hope this helps you,

Pragya

5 REPLIES 5
Read only

Former Member
0 Likes
779

Hi ,

If you are populating the table itab1 then it will contain the data which you populated else it will be blank.

Because as i see you are not making any changes to the data in itab1.

Regards

Arun

Read only

Former Member
0 Likes
779

This code will give error because when you use <b>type table of</b>.. i think you shouldnot <b>use occurs with header line</b>..

<b>You will get occurs not expected</b>

Read only

0 Likes
779

Correct , you get that error .

Read only

Former Member
0 Likes
780

Hi Rishi,

First of all you can not use ocurs with type table of.

you have to use :

itab1 type table of I with header line,

itab2 type table of I with header line,

secondly, <b>move itab1 to itab2</b> will only copy the c<b>ontents of header of itab1 to header of itab2</b>.

If you want to copy whole itab1 to itab2, Please use:

<b>move itab1[] to itab2[].</b>

Hope this helps you,

Pragya

Read only

Former Member
0 Likes
779

Hi Rishi,

The header line would be copied from itab1 to itab2 & not the complete table. Only the work area (itab1-->itab2)corresponding to the tables would be copied.

The code move itab1[] to itab2[] will copy the complete table.

Regards,

Chetan.

PS:Reward points if this is helpful.