Skip to Content
avatar image
Former Member

Rename a Database Table without loosing its data.

Hi All,

I want to rename a database table without loosing its data content.

I have searched a coulpe of blgs and could not find any thing helpful.

I have gone thru this page,

Adjusting Database Structures - Database Utility - SAP Library

and then thought there must be some way, if you read point 3,

  • By converting the table (see

Conversion Process). The database table is renamed and serves as a temporary buffer for the data. The revised version of the table is activated in the ABAP Dictionary and created in the database. The data is reloaded from the temporary buffer to the new database table (with MOVE-CORRESPONDING) and the indexes on the table are built.

I am not sure, how to achieve this.

Will be great, if some one can kindly guide me..!!

Thanking You All..!!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 08, 2015 at 10:46 AM

    Hi Ankit

    There is copy option in SE11 ,so that you can copy the table to another table,but i am not sure whether the contents will copy or not.

    If contents not copied ,do small report program select all entries from old table and move to renamed table and delete old table

    for ex :

    select * from mara into lt_mara.

    Loop at lt_mara to ls_mara.

    move correcpondin ls_mara to ls_new_table.

    append ls_new_table to lt_new_table.

    endloop.

    Thanks

    Vamsi

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Ankit,

      It is not possible as you are changing name. Database utility SE14 will work only with same table.

      May be you can search enhancement for copy option in SE11 where you can put code to copy data.

      Regards,

      Sid

  • avatar image
    Former Member
    Jan 08, 2015 at 11:17 AM

    Hi,

    Sid is right, you cannot rename the table and contain the table contents with SE14. You need to find a workaround, so copy the data to a temporary table and then insert it to your renamed table.

    Br,

    Tim

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Tim,

      Thank a lot for the reply.

      I too think that you and Siddarth are correct, but just wanted to collect expert opinion..!!

      Thanking You All..!!