Copy contents of one internal table to another

Hi,
I have one internal table IT1 which has following fields HKONT, DMBTR and DESC. Here DESC row is empty and rest of the fields are filled.
Now there is another IT2 which has DESC field and this is filled.
I have to copy the IT2-DESC into IT1-desc.
How to do that?

Hi Anurodh,
if u want to collate data from 2 tables, there should be atleast one common field.
As from ur query i can see that the field in ques id Description of some other field, say F1.
If i am right, then fetch F1 field in both the tables and then using Loop and Read statements you can add DESC to IT1 table.
Hope it helps.
Reward points if useful.
Regards,
Preeti

Similar Messages

  • Moving few contents of one internal table to another internal table

    Hi
    I want to move some contents of one internal table to another internal table, which records match our condition
    (without loop)
    Example:
    1  aa
    2  aa
    3  aa
    4  bb 
    5  cc
    6  aa
    7  cc
    8  dd
    now i want to move records which contain aa to one internal table  without using loop.
    is there any statemnt to achieve this
    Reagrds
    Srinivasu

    Hi Srinivasu,
    Just create an another internal table say itab2 having the same structure.
    Then use the following code:
    itab2[] = itab1[]
    delete itab2 where field2 <> 'aa'.
    Hope this will help.
    Regards,
    Nitin.
    Edited by: Nitin Karamchandani on Nov 21, 2008 8:51 AM

  • How  to copy data from one internal table to another

    i am using some function module to get some data for my function module
    and the retrieved data is not getting populated in mu fumctional module
    i am sucessful in getting the data to an internal table in my function module but dont know how to pass it to my table parameter
    thanks in advance

    Hi Naval,
    Declare an internal table of type table parameter structure and pass it the table parameters of the Function module.
    Check the code for this function module.
    DATA IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
    SELECT * FROM MARA UP TO 10 ROWS INTO TABLE IT_MARA.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                = 'C:\TEST.TXT'.      FILETYPE                = 'ASC'
          WRITE_FIELD_SEPARATOR   = 'X'
    <b>    TABLES
          DATA_TAB                = IT_MARA</b>
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          OTHERS                  = 22.
      IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Thanks,
    Vinay

  • How to scan data from one internal table to another

    Hi All,
    let me know how to scan all from one internal table to another internal table. Pls provide me the syntax and code.
    i am very thankful to you all in advance.
    Thanks & Regards,
    Nagarjuna.

    if u want to copy data from itab1 to itab2  then use
    itab2[] = itab1[].
    if u want to compare whether both itab1 and itab2 are same or not,use
    if itab1[] = itab2[].
    *--same
    else.
    *--not same
    endif.
    if u want to compare itabs based on primary key....
    loop at itab1.
    read table itab2 with key f1 = itab1-f1.
    if sy-subrc <> 0.
    *--not same....
    endif.
    endloop.
    if u want to copy only few lines(say from 1 to 3) of itab1 to itab2 then use...
    append lines of itab1 from 1 to 3 to itab2.
    if internal tables don't have same structure,
    say only fields f1 and f2 are common,then
    loop at itab1.
    itab2-f1 = itab1-f1.
    itab2-f2 = itab1-f2.
    append itab2.
    clear itab2.
    endloop.
    if there are many common fields then...
    loop at itab1.
    move-corresponding itab1 to itab2.
    append itab2.
    clear itab2.
    endloop.
    Please don't forget to reward points....!!!
    Regards
    vasu

  • How to insert select columns from one internal table to another

    Hi,
    How to insert select columns from one internal table to another based on condition as we do from a standart table to internal table.
    regards,
    Sriram

    Hi,
    If your question is for copying data from 1 int table to other ;
    we can use
    APPEND LINES OF it_1 TO it_2.
    or if they have different columns then:
    loop at it_1 into wa_it1.
    move wa_it1-data to wa_it2-d1.
    apped wa_it2 to it_2.
    clear wa_it2.
    endloop.
    thnxz

  • How do i copy content from one hard rive to another through my macbook air? the copy and paste option doesn't work

    How do i copy content from one hard rive to another through my macbook air? the copy and paste option doesn't work

    It's because of the extension of the hard drive is a Windows extension ( most likely MSDOS or Ex-FAT), meaning you can only read but not write. If there are no important files (or you can copy the whole thing to your computer/mac) you can just reformat the hard drive and change the extension to NTFS (readable and writable on both windows and mac) or Mac OS Extended (readable and writable on Mac, readable on windows).
    Go to DISK UTILITY
    Choose the Hard Disk you intended
    ERASE
    You can choose either
              (I personally prefer this one, you know just in case)

  • Moving data from one internal table to another

    Hi,
    I have one internal table populated with a list of material codes and another with all the material numbers.
    ITAB1: MCODE KSCHL KNUMH MATNR
    ITAB2:  MCODE MATNR
    The matnr field in itab1 is blank initially. It needs to be populated with all the material numbers from itab2. How can I achieve this?
    Thanks,
    ap

    Hi
    Lets say that there is only one record in itab1 and for that there is correspondingly 10 records in itab2.
    that means that the one record in itab1 should be changed to the first material number in itab2 and there should be nine more records created in itab1 according to the values in itab2.
    Hope this is what you mean.
    If this is the logic then the following code should work
    then lets have a third internal table the same type as itab1
    Loop at itab1 into wa_itab1
    *readt table itab2 into wa_itab2 with key mcode = wa_itab1-mcode.
    *IF sy-subrc eq 0.
    loop at itab2 into wa_itab2 where mcode = wa_itab1-mcode.
    wa_itab1-matnr = wa_itab2-matnr
    append wa_itab1 to itab3.
    endloop.
    *ENDIF.
    *modify itab1 from wa_itab1.
    endloop.
    itab3 will contain all the values that you require

  • How to populate one internal table from another using field symbols

    Hi Gurus,
      I have a problem. I have to populate one internal table (sructure t_otput) from another internal table (sructure t_from) using field symbol.
    Structure for from table.
    types: begin of t_from,
             year(4) type c,
             ww(2) type c,
             site type marc-werks,
             demand type i,
           end of t_from.
    Structure for output table.
    types: begin of t_display,
             title(30),
             WW1(10),
             WW2(10),
             WW3(10),
           end of t_display.
    The from table looks like this:
    Year | WW | Site | Demand
    2005 | 1  | OR1  | 12.00
    2005 | 2  | OR1  | 13.00
    2005 | 3  | OR1  | 14.00
    The display table which has to be populated should look like this:
    Title  | WW1   | WW2   | WW3
    OR1    |       |       |
    Demand | 12.00 | 13.00 | 14.00
    How to populate display table using field symbol?
    Please give code snippets
    Thanks,
    Gopal

    Gopal,
    Here is the code, however I am not vary clear about the ORG1 and Demand display that you have shown in the display. I am sure with this code it should not be a big deal to tweak in whatever manner you want.
    TABLES : marc.
    TYPES: BEGIN OF type_display,
    title(30),
    ww1(10),
    ww2(10),
    ww3(10),
    END OF type_display.
    TYPES: BEGIN OF type_from,
    year(4) TYPE c,
    ww(2) TYPE c,
    site TYPE marc-werks,
    demand TYPE i,
    END OF type_from.
    data : t_from type table of type_from,
           t_display type table of type_display.
    field-symbols : <fs_from> type type_from,
                    <fs_display> type type_display.
    data : wa_from type type_From,
           wa_display type type_display.
    wa_from-year = '2005'.
    wa_from-ww   = '1'.
    wa_from-site = 'OR1'.
    wa_from-demand = '12.00'.
    insert wa_from  into table t_from.
    wa_from-year = '2005'.
    wa_from-ww   = '2'.
    wa_from-site = 'OR1'.
    wa_from-demand = '13.00'.
    insert wa_from  into table t_from.
    wa_from-year = '2005'.
    wa_from-ww   = '3'.
    wa_from-site = 'OR1'.
    wa_from-demand = '14.00'.
    insert wa_from  into table t_from.
    data : variable(3) type c.
    field-symbols : <fs_any> type any.
    break-point.
    Loop at t_from assigning <fs_from>.
    variable = 'WW'.
    wa_display-title = <fs_from>-site.
    concatenate variable <fs_from>-ww into variable.
    assign component variable of structure wa_display to <fs_any>.
    <fs_any> = <fs_from>-demand.
    endloop.
    append wa_display to t_display.
    clear wa_display.
    loop at t_display assigning <Fs_display>.
      write :/ <fs_display>.
    endloop.
    Note : Please award points if this helps you.
    Regards,
    Ravi

  • Copy and Modify from one internal table to another.Please help.

    Hi,
    I have an internal table having a structure like below.
    Account Entity Category period1value pd2value
    10 A C 100 200.
    where account corresponds to 10
    entity A
    category C
    period1 value = 100
    period2 value = 200.
    Now I need to populate it into another table having structure like
    Account Entity Category period Value
    10 A C 1 100
    10 A C 2 200.
    If u see this carefully a new column, period is added in the database table and thus for each row there will be only 1value.
    Instead of period1 value and period2 value being in the same row they will come in different rows.One row will be like the value for period1 and next for value like period2.
    Pleadse help
    Ankit

    Hi,
    u can do as follows,
    LOOP AT itab1 into wa_itab1.
    wa_itab2-account = wa_itab1-account.
    wa_itab2-entity = wa_itab1-entity.
    wa_itab2-category = wa_itab1-category.
    if not wa_itab1-period1 is initial.
    wa_itab2-period = wa_itab1-period1.
    endif.
    if not wa_itab1-period2 is intial.
    wa_itab2-period = wa_itab1-period2.
    endif.
    wa_itab2-value = wa_itab1-value.
    append wa_tab2 to itab2.
    clear:wa_itab1-period1 ,
           wa_itab2-period .
    endloop.

  • How do I copy recordsets from one database table to another?

    I am using the Database Connectivity Toolset, and would like to copy either one recordset or multiple recordsets from one Access table to a table in a different database. I would like to do it directly with the data in variant form, but I can't get it to work. I can get it to work(on a small test table) if I first convert my source variant data to a cluster, then insert that into the other database table. My real database has many items with a variety of date types. Can I copy directly variant to variant?

    Is it necessary to read all the data back into LabVIEW first? The reason I'm asking is that it is much more efficient to just use SQL statements to get the data you need and write that directly to the second database. I did a quick Google search on it and came up with lots of responses on what the correct syntax is for setting that up. Using an SQL command to copy the data back and forth is analogous to copying data from one file to another using the Copy file function rather than reading the entire contents of the file, converting the file string to the data arrays, converting back to a string, and then writing it back to another file.
    Chapter 5 of the Database Connectivity Toolset User Manual describes how to execute SQL queries.
    If you do need to actually
    see the data in LabVIEW first, then the only way to get it back into the other database is to convert those variants to LV datatypes and then cluster those values again and write them back out to the second database.

  • How to transfer Data of One internal table to another

    Dear Guru,
    I have an internal table
    DATA: BEGIN OF t_cust OCCURS 0,
                kschl  LIKE rv13a-kschl,
                werks LIKE komg-werks,
                matnr LIKE komg-matnr,
                kbetr  LIKE konp-kbetr,
                datab LIKE rv13a-datab,
                datbi  LIKE rv13a-datbi,
          END OF t_cust.
    I want to tranfer all the contents of internal table "t_cust" into another internal table "t_cust2" after converting kbetr, datab, datbi fields  into char type.
    How i will do it??
    pls hlp..

    Hi Saifur,
    if the structure is same then you can simply do
    itab1[] = itab2[].
    if you are changing the data type then.
    data: wa1 like itab1,
            wa2 like itab2.
    loop at itab1 into wa.
    wa2-field1 = wa1-field1.
    wa2-field2 = wa1-field2.
    Append wa2 to itab2.
    endloop.

  • HOW TO TRANSFER DATA FROM ONE INTERNAL TABLE TO ANOTHER

    FOR PERTICULAR OBJECT ID ONE INT TABLE JTAB CONTAINS ONE RECORD(ROW) AND ANOTHER INT TABLE KTAB CONTAINS 3 RECORDS(ROWS). THEN HOW I SHOULD TRANSFER DATA FROM KTAB TO JTAB? WHAT R THE VARIOUS WAYS TO DO THAT. PLS HELP ME OUT. THANKS IN ADVANCE

    Try something like
    If you want one record per ktab :
    LOOP AT jtab.
      MOVE-CORRESPONDING jtab TO itab.
      LOOP AT ktab WHERE id = jtab-id.
        MOVE-CORRESPONDING ktab TO itab.
        APPEND itab.
      ENDLOOP.
    ENDLOOP.
    or
    LOOP AT ktab.
      READ TABLE jtab WITH KEY id = ktab-id. " binary implicit if sorted type
      MOVE-CORRESPONDING jtab TO itab.
      MOVE-CORRESPONDING ktab TO itab.
      APPEND itab.
    ENDLOOP. 
    If you want to sum ktab ratio into itab for each jtab
    LOOP AT jtab.
      MOVE-CORRESPONDING jtab TO itab.
      LOOP AT ktab WHERE id = jtab-id.
        ADD-CORRESPONDING ktab TO itab.
        APPEND itab.
      ENDLOOP.
    ENDLOOP.
    Use sorted type table when LOOP AT WHERE, else SORT table is enough.
    Regards

  • Transferring data from one internal table to another

    Hi,
    I have two internal tables it_acct and it_acct1 as below.
    data: begin of it_acct occurs 0,
          belnr like bkpf-belnr,
          bldat like bkpf-bldat,
          augcp like bseg-augcp,
          vbeln like bseg-vbeln,
          end of it_acct.
    data: begin of it_acct1 occurs 0,
          belnr like bkpf-belnr,
          cpudt like bsad-cpudt,
          vbeln like bseg-vbeln,
          end of it_acct1.
    select belnr cpudt vbeln into corresponding fields of table it_acct1
                  from bsad where cpudt in s_cpudt.
    Now I want to move the data from it_acct1 to it_acct . I have no data in it_acct now.
    i want to move it_acct1-belnr to it_acct-belnr,
              move it_acct1-cpudt to it_acct-augcp,
              move it_acct1-vbeln to it_acct-vbeln.
    Can someone help me how to code to move the data from it_acct1 to it_acct.
    Regards,
    D

    Hi Dev,
    Just add an additional line in Naren's code to get proper results at any time.
    LOOP AT IT_ACCT1.
    IT_ACCT-BELNR = IT_ACCT1-BELNR.
    IT_ACCT-VBELN = IT_ACCT1-VBELN.
    it_acct-augcp = it_acct1-cpudt.
    APPEND IT_ACCT.
    <b>CLEAR IT_ACCT.</b>
    ENDLOOP.
    If you didnt include CLEAR statement, even if IT_ACCT1 doesnt have any values for all fields or few fields in the next record, it will take values of previous one and it may lead to improper results.So it is a good practise to have CLEAR statement after APPEND statement in LOOP...ENDLOOP.
    Thanks,
    Vinay

  • Copying information from one repeating table to another repeating summary table?

    Hi,
    I have designed a dynamic form with a Table 1 (Investigator details) to be completed at the start to provide a list of investigators. This is a repeating table, and I have added buttons to add / delete an investigator (i.e. add/remove a row). I also have another repeating Table 2 at the end of the form to allow the investigators to be listed so they can insert a signature image (signature table).
    Is it possible to set this up so that when one adds an investigator (row) in Table 1, a row is added automatically to Table 2? I then want the Title First name last name to copy into the "Investigator Full name" cell in Table 2. Can this be done and keep the automatic renumbering of the rows in both tables?
    I am not sure how to upload a file to show you what I have, so please let me know and I can send a copy directly.
    I would appreciate if anyone has any suggestions for a code to do this.
    Regards
    Souheir

    Hi,
      Check the code below
    Data: itab1 type table of tab1,
          itab2 type table of tab2.
    * itab2 is of new table type created from some fields of tab1
    * In the select statement below you can select few fields depending upon your requirement
    select * from tab1 into table itab1.
    loop at itab1 into wa1.
      wa2-f1 = wa1=f1.
      append wa2 to itab2.
    endloop.
    insert itab2 into tab2.
    Regards,
    kinshuk
    PS: Reward points if you find it helpful

  • Dynamic script task to copy data from one server table to another server table excluding Timestamp column ?

    I have two server TestSource and TestDestination . In both the tables I have common table like below. I would like to copy the data from TestSource server src_Table to TestDestination server  table dest_table
    excluding the column timestamp. This process I would like to achieve dynamically. Since I have 50 tables where I need to copy from source server to destination server.
    Rule : This needs to achieve using script task. Please help me to find the solution as it is very urgent requirement.
    Above rule is because No option to choose export wizard dynamic query option for linked server.
     --Source
    Table
    CREATE TABLE src_table
    a int,
    b int,
    c timestamp
    --Dest Table
    CREATE TABLE dest_table
    a int,
    b int,
    c timestamp
    Thank you in advance.
    Hari

    I have two server TestSource and TestDestination . In both the tables I have common table like below. I would like to copy the data from TestSource server src_Table to TestDestination server  table dest_table
    excluding the column timestamp. This process I would like to achieve dynamically. Since I have 50 tables where I need to copy from source server to destination server.
    Rule : This needs to achieve using script task. Please help me to find the solution as it is very urgent requirement.
    Above rule is because No option to choose export wizard dynamic query option for linked server.
     --Source
    Table
    CREATE TABLE src_table
    a int,
    b int,
    c timestamp
    --Dest Table
    CREATE TABLE dest_table
    a int,
    b int,
    c timestamp
    Thank you in advance.
    Hari

Maybe you are looking for

  • Harman Kardon Drive+Play FirstLook on RainyDayMagazine

    We got the Harman Kardon Drive+Play iPod controller yesterday. We'll be doing a complete series on the installation of the unit into the Boxster the month of November. Go here if you want more tech info on the unit: http://www.driveandplay.com/ Go ch

  • White balance adds blue - looks worse!

    Hello. I am having a little problem with the white balance color picker. I shoot with a Canon 5D and I always start by shooting a WhiBal card. Prior to using the white balance tool I have values of R:196 G:196 B:187 on the WhiBal card itself. Since t

  • Cannot open microsoft office 2011 14.3.2 on mac 10.8.3

    When I try to open a microsoft office application, I get Process:         Microsoft Word [6639] Path:            /Applications/Microsoft Office 2011/Microsoft Word.app/Contents/MacOS/Microsoft Word Identifier:      com.microsoft.Word Version:        

  • How to get a download link after previous computer crashes

    My laptop that had Creative Suites installed on crashed and I cannot access the hard drive to deactivate the product, nor retrieve the original download link. I tired calling Adobe Support, the technician opened a call, immeediately closed the call a

  • [Solved] makepkg suddenly throws an error all the time

    After making some tweaks to my dwm/config.h file the makepkg now no longer works and returns the error: An unknown error has occurred. Exiting... It doesn't seem like it is the config.h file since I am unable to compile to backed up config.h file. I