Skip to Content
avatar image
Former Member

please any one answer

. What is the fastest way to move one internal table to another internal table (assuming two tables of similar structure)?

a) append lines of table1 to table2.

b) loop at table1.

Move: table1-field1 to table2-field1,

table1-field2 to table2-field2.

Append table2.

Endloop.

c) table2[] = table1[].

d) loop at table1.

Move-corresponding table1 to table2.

Endloop.

e) move table1 to table2.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

13 Answers

  • avatar image
    Former Member
    Oct 05, 2007 at 01:48 PM

    Hi Srinivasa,

    The Fastest options are:

    c) table2[] = table1[].

    e) move table1 to table2.

    YOu should only loop the table if you are going to do some other operations on the field level.

    You can test yourself using Run time analysis.

    Reward points if this helps,

    Manish

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 05, 2007 at 01:49 PM

    E options is good.

    Please give me reward points

    Thanks

    Murali Poli

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 05, 2007 at 01:50 PM

    Hi,

    The Option C & E are same.

    Both is Faster.

    Regards,

    Padmam.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 05, 2007 at 01:52 PM

    hi

    good

    the option c is suitable and good in performance wise.

    thanks

    mrutyun^

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 05, 2007 at 01:54 PM

    Only C.

    E only moves the header record.

    Rob

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      C would be the better option. If you want to use E you have to loop at both the internal tables and loop within a loop is normally not a good practice.

      So my suggestion would be to use option<b> C</b>.

      Regards

      Aneesh.

  • avatar image
    Former Member
    Oct 05, 2007 at 02:03 PM

    C is the best way of doing it.

    Cheers

    Shakir

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 05, 2007 at 02:25 PM

    It depends on if there is already data in the table that you are moving the data to, and whether you want to keep that data. If you have data in table B and you want to add the data from table A to it, then you should use

    append lines of tableA to tableB.

    That way you don't lose the existing data. But if you want to only have the data from table A in table B, then use

    tableB[] = tableA[].

    - April King

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 05, 2007 at 02:25 PM

    C is the best one. As a matter of fact, SAP recommends it. To prove that, Goto SE30, click tips and tricks. In the internal table section, look for copying internal table. There you will see the comparison by clicking the measure time and SAP's explanation. Play with SE30 tips and trick and you will find more useful information.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 05, 2007 at 04:38 PM

    Hi,

    Go with C and then A.

    Thanks,

    Sriram Ponna.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 06, 2007 at 04:23 AM

    Hi,

    Srini better to use option A.

    Regards,

    Natchi.

    Add comment
    10|10000 characters needed characters exceeded