Skip to Content
author's profile photo Former Member
Former Member

Move

Dear All

i have 2 internal table

how will move one field one table to another table

Thanks and Regards

Suresh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:30 PM

    To move the entire table,

    itab2 = itab1.

    To move any one field from the table,

    itab2-field1 = itab1-field1.

    To move all the data in the itab1-field1 to itab2-field1,

    loop at itab1.

    itab2-field1 = itab1-field1.

    append itab2.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:31 PM

    move itab1-kunnr to itab2-kunnr.

    like wise for all the fields,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:34 PM

    Hi suresh,

    If those 2 internal tables are of same structure then you can copy as below.

    itab1[] = itab2[].

    otherwise you can move field by field as below.

    loop at itab1 . " where you have data

    itab2-field1 = itab1-1field1.

    itab2-field2 = itab1-field2.

    append itab2.

    clear itab2.

    endloop.

    otherwise you can copy data on some condition also like

    loop at itab1 . "

    if itab1-field1 GT '2'.

    itab2-field1 = itab1-1field1.

    itab2-field2 = itab1-field2.

    append itab2.

    clear itab2.

    endif.

    endloop.

    reward if useful

    Regds

    Sivaparvathi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:35 PM

    Hi,

    If your 2 internal tables has same structure then use i_tab1[] = i_tab2[], then use the below logic.

    Loop at i_tab2.

    MOVE-CORRESPONDING i_tab2 to i_tab1.

    APPEND i_tab1.

    ENDLOOP.

    Cheers,

    Bujji

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 12:36 PM

    Hi,

    loop at itab1 into wa_itab1.

    move wa_itab1-f1 to wa_itab2-f1.

    append wa_itab2 to itab2.

    endloop.

    Regards,

    Vani.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 12:37 PM

    Hi,

    Check these Example.

    Tables:Mara.

    Select-options:s_matnr for mara-matnr.

    Types:Begin of i_mara,

    matnr like mara-matnr,

    end of i_mara.

    data:it_mara type standard table of i_mara with header line.

    data:it_mara1 type standard table of i_mara with header line.

    start-of-selection.

    Select matnr from mara into table it_mara where matnr in s_matnr.

    move IT_MARA[] to it_mara1[].

    loop at IT_MARA1.

    write:/ it_mara1-matnr.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.