Appending data from amultiple internal tables

Hi Experts,
I need to append data from more than one internal tables to one internal table. But the internal tables has different structure.
For example, I have internal tables I_A550 table which has field KNUMH, and I_A573 which has same filed KNUMH. Same way I have 25 tables, and all have KNUMH field.
Now I have taken an internal table I_AXXX which has only one field KNUMH. I need to transfer data from all those 25 tables to I_AXXX.
I wrote code as below.
LOOP AT I_A550
   MOVE I_A550-KNUMH to I_AXXX-KNUMH.
   APPEND I_AXXX.
ENDLOOP.
LOOP AT I_A573.
    MOVE I_A573-KNUMH to I_AXXX-KNUMH.
    APPEND I_AXXX.
ENDLOOP.
But instead of writing 25 loops, is there any way we can simplify this?
Thanks in advance.

Hi,
Just use field-symbols for your purpose as follows:-
See the example below
TYPES: BEGIN OF y_t_final,
       matnr TYPE matnr,
       END OF y_t_final.
TYPES: y_tt_final TYPE STANDARD TABLE OF y_t_final.
data : WA_mara type mara,
       wa_mard type mard.
DATA : itab  TYPE STANDARD TABLE OF mara.
DATA : itab1 TYPE STANDARD TABLE OF mard.
DATA : it_final TYPE STANDARD TABLE OF y_t_final.
DATA : wa_final TYPE y_t_final.
wa_mara-matnr = '1'.
append wa_mara to itab.
wa_mard-matnr = '2'.
append wa_mard to itab1.
PERFORM f_loop USING  itab
               CHANGING it_final.
PERFORM f_loop USING  itab1
               CHANGING it_final.
The code inside the perform is as follow:-
FORM f_loop  USING    p_itab TYPE ANY TABLE
             CHANGING p_it_final TYPE y_tt_final.
  FIELD-SYMBOLS : <fs>     TYPE ANY TABLE,
                   <wa>    TYPE ANY,
                   <field> TYPE ANY.
  DATA: l_data TYPE REF TO data.
  ASSIGN p_itab TO <fs>.
  IF <fs> IS ASSIGNED.
    CREATE DATA l_data LIKE LINE OF <fs>.
    ASSIGN l_data->* TO <wa>.
    IF <wa> IS ASSIGNED.
      LOOP AT <fs> INTO <wa>.
        ASSIGN component 'MATNR' of structure <wa> TO <field>.
        IF <field> IS ASSIGNED.
          MOVE <field> TO wa_final-matnr.
          append wa_final to p_it_final.
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDIF.
ENDFORM.
I hope you can understand the concept.
Regards,
Ankur Parab

Similar Messages

  • How to append data from an internal table to an external table.

    HI everyone,
    I am trying to update an DB table type 'c'from the data captured in my internal table. can any one tell me as to how to do this.the contents of the DB table needs to be erased completly before i send in new data.
    Regards,
    Vj

    Assuming that you table has 1 character field(?) besides the MANDT field
    MANDT
    FIELD
    you need to update this db table with values from ITAB which I assume has one field of type c.
    To first delete all of the data from DB table.
    * Yes there are other ways of doing this.
    tables: ztable.
    select * from ztable.
    delete ztable.
    endselect.
    Then simply LOOP your internal table and update the table.
    loop at itab.
      ztable-field = itab-field.
      insert ztable.
    endloop.
    Regards,
    Rich Heilman

  • How to download data from an internal table to a text

    Hi All,
    I want to download data  from an internal table to a text file.
    The fields should be pipe(|) separated. I have tried GUI_DOWNLOAD but it is not taking the field separator.
    The sample of the desired data that i require should be this way:-
    13456TR|M|COUP|MATERIAL|KGS
    Thanks in advance.
    Regards
    Satish.

    Hi,
    Try this..
    REPORT  zc1download message-id zc1dwnmsg.
    *& Declaration Section for the Tables *
    TABLES: makt.
    *& Declaration Section for the Internal Tables
    DATA: intab TYPE TABLE OF makt,
          wa_intab LIKE LINE OF intab,
          no_of_rec TYPE i,
          count TYPE i.
    DATA: BEGIN OF f_intab,
            str(255) TYPE c,
          END OF f_intab.
    DATA: t_intab LIKE TABLE OF f_intab,
          w_intab LIKE LINE OF t_intab,
          temp(255) TYPE c.
    FIELD-SYMBOLS: <f> TYPE ANY.
    *& Selection ScreenSection for the file download
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: file TYPE rlgrap-filename MEMORY ID file,
                tab RADIOBUTTON GROUP rad1 DEFAULT 'X',
                others RADIOBUTTON GROUP rad1,
                delimit TYPE c.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      IF file IS INITIAL. " check to ensure file.
        MESSAGE i001.
        EXIT.
      ENDIF.
      IF others = 'X'.    " check to ensure delimiter.
        IF delimit = ' '.
          MESSAGE i002.
          EXIT.
        ENDIF.
      ENDIF.
      SELECT * FROM makt INTO TABLE intab.
      IF tab = 'X'.       " default delimiter tab is used
          CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
            filename                = file
            filetype                = 'DAT'
            mode                    = 'A'
          TABLES
            data_tab                = intab
          EXCEPTIONS
            file_open_error         = 1
            file_write_error        = 2
            invalid_filesize        = 3
            invalid_type            = 4
            no_batch                = 5
            unknown_error           = 6
            invalid_table_width     = 7
            gui_refuse_filetransfer = 8
            customer_error          = 9
            no_authority            = 10
            OTHERS                  = 11.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ELSE.             " If user defind delimiter is to be used
                  Counts the number of fields                *
        DO.
          ASSIGN COMPONENT sy-index OF STRUCTURE wa_intab TO <f>.
          IF sy-subrc <> 0.
            EXIT.
          ELSE.
            count = count + 1.
          ENDIF.
        ENDDO.
        LOOP AT intab INTO wa_intab.
          DO count TIMES. " Adding the delimiter in required places
            ASSIGN COMPONENT sy-index OF STRUCTURE wa_intab TO <f>.
            CONCATENATE temp delimit <f> INTO temp.
          ENDDO.
          SHIFT temp.
          APPEND temp TO t_intab.
          CLEAR temp.
        ENDLOOP.
        CALL FUNCTION 'WS_DOWNLOAD'
          EXPORTING
            filename                = file
            filetype                = 'ASC'
            mode                    = 'A'
          TABLES
            data_tab                = t_intab
          EXCEPTIONS
            file_open_error         = 1
            file_write_error        = 2
            invalid_filesize        = 3
            invalid_type            = 4
            no_batch                = 5
            unknown_error           = 6
            invalid_table_width     = 7
            gui_refuse_filetransfer = 8
            customer_error          = 9
            no_authority            = 10
            OTHERS                  = 11.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
      WRITE:/ 'The Data has been tranfered to :', file.
    Cheers
    Kathir!~

  • How to move data from 2 internal table to 1 internal table

    Can any body send me code that how to move data from 2 internal table into one internal table.
    Moderator message : Read ABAP documentation. Thread locked.
    Edited by: Vinod Kumar on Jun 13, 2011 11:45 AM

    Hi Mohdarif92;
    I don't know your full needs. But general method should be as below code.
    Please check exam below code.
    Best regards.
    data : begin of gt_result.
                ... like mkpf-...
                ... like mkpf-...
                ... like mseg-...
                ... like mseg-...
              end of gt_result
    select *
    into table gt_mkpf
    from mkpf where ...
    select *
    into table mseg
    from mseg where ...
    loop at gt_mkpf.
         loop at gt_mseg where ... = mkpf-...
            move-corresponding gt_mkpf to gt_result.
            move-corresponding gt_mseg to gt_result.
            append gt_result
         endloop.
    endloop.

  • How to get data  from an internal table in some other program

    I would like to get data from the internal table in the other program. When I using FM "LIST_FROM_MEMORY" to get the data, it doesn't work and the exception is not fount.
    If any special code need in the other program, like write data to memory .
    Many thx .
    From Ross Wang

    Hi
    <li>You need to have interaction if you want to use EXPORT/IMPORT statments.
    <li>The internal tables in both programs must be same
    <li>Program one ..Calling program
    REPORT ZTEST_NOTEPAD.
    DATA: BEGIN OF it_t001 OCCURS 0,
            bukrs TYPE t001-bukrs,
            butxt TYPE t001-butxt,
          END OF it_t001.
    START-OF-SELECTION.
      SUBMIT ztest_notepad1 AND RETURN.
      IMPORT it_t001 FROM MEMORY ID 'ZTEST_T100'.
      LOOP AT it_t001.
        WRITE:/ it_t001.
      ENDLOOP.
    <li>Program two ...Called program
    REPORT ztest_notepad1.
    DATA: BEGIN OF it_t001 OCCURS 0,
            bukrs TYPE t001-bukrs,
            butxt TYPE t001-butxt,
          END OF it_t001.
    START-OF-SELECTION.
      SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_t001 UP TO 10 ROWS.
      IF sy-dbcnt > 1.
        EXPORT it_t001 TO MEMORY ID 'ZTEST_T100'.
      ENDIF.
    I hope that it gets you some idea.
    Thanks
    Venkat.O

  • How to insert  data from different internal  table  into a data base table

    hi all,
             I want to insert a particular field in an internal table to a field in a data base table.Note that the fields in the internal table and database table are not of the same name since i need to insert data from different internal tables.can some one tell me how to do this?
    in short i want to do something like the foll:
    INSERT  INTO ZMIS_CODES-CODE VALUE '1'.
    *INSERT INTO ZMIS_CODES-COL1 VALUE DATA_MTD-AUFNR .(zmis_codes is the db table and data_mtd is the int.table)

    REPORT  ZINSERT.
    tables kna1.
    data: itab LIKE KNA1.
    data lv_kUNAG LIKE KNA1-KUNNR.
    lv_kuNAG =  '0000010223'.
    ITAB-kuNNR = lv_kuNAG.
    ITAB-name1 = 'XYZ'.
    INSERT INTO KNA1 VALUES ITAB.
    IF SY-SUBRC = 0.
    WRITE:/ 'SUCCESS'.
    ELSE.
    WRITE:/ 'FAILED'.
    ENDIF.
    Here lv_kunag is ref to kna1 kunnr passed in different name
    In internal table .
    Try and let me know if this logic dint work.

  • How to read data from an internal table into a real table?

    Hello experts,
    I'm relatively new to ABAP and I'm trying to figure out how to read data from an internal table into a table that I created.  I'm trying to use the RRW3_GET_QUERY_VIEW_DATA function module to read data from a multiprovider.  I'm trying to read data from the e_cell_data and e_axis_data tables into a table that I've already created.  Please see code below.
    TABLES MULTITAB.
    DATA:
      query_name TYPE RSZCOMPID,
      s_cubename TYPE RSINFOPROV,
      t_cell_data TYPE RRWS_T_CELL,
      t_axis_data TYPE RRWS_THX_AXIS_DATA,
      t_axis_info TYPE RRWS_THX_AXIS_INFO,
      wa_t_cell_data like line of t_cell_data,
      wa_t_axis_data like line of t_axis_data,
      w_corp_tab like line of t_cell_data.
    s_cubename = 'CORP_MPO1'.
    query_name = 'Z_corp_test'.
        CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA'
           EXPORTING
             i_infoprovider           = s_cubename
             i_query                  = query_name
            i_t_parameter            = query_string_tab
           IMPORTING
             e_cell_data              = t_cell_data
             e_axis_data              = t_axis_data
             e_axis_info              = t_axis_info.
    If anyone has any information to help me, I would greatly appreciate it.  Thanks.

    Hi,
    <li>Once you call the function module RRW3_GET_QUERY_VIEW_DATA, lets say data is available in the corresponding tables e_cell_data e_axis_data which you have mentioned.
    <li>Modify your internal table defined for other purpose, with data from e_cell_data e_axis_data like below.
    LOOP AT t_cell_data INTO wa_t_cell_data.
      "Get the required data from t_cell_data.
      MOVE-CORRESPONDING wa_t_cell_data TO it_ur_tab.
      "Modify your internal table wih data
      MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
    ENDLOOP.
    LOOP AT t_axis_data INTO wa_t_axis_data.
      "Get the required data from t_cell_data.
      MOVE-CORRESPONDING wa_t_axis_data TO it_ur_tab.
      "Modify your internal table wih data
      MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
    ENDLOOP.
    Thanks
    Venkat.O

  • Select Data from 2 intern tables

    Hi Experts,
    how I can select Data from 2 intern Tables into another intern table?
    For Example:
    My Result  Table has the fields: mandt, user, ID, ID_Name.
    My select table no. 1 has the fields mandt, XYZ (like A_Name), ID, ID_Name, ...
    My select table no. 2 has the fields mandt, A_Name, User, ...
    I want to search for all entries in select table no. 1 and 2. where are a_name have the same worth.
    How I can select my Dates?
    Regards,
    Mike

    hii
    you can do it by using for all entries and with READ statement ..do like follow code
    IF i_marc[] IS NOT INITIAL.
        SELECT matnr                       " Material Number
               werks                       " Plants
               lgort                       " Storage Location
          FROM mard
          INTO TABLE i_mard
           FOR ALL ENTRIES IN i_marc
         WHERE matnr EQ i_marc-matnr
           AND werks EQ i_marc-werks
           AND lgort IN s_lgort.
      ENDIF.                               " IF i_mara[] IS NOT INITIAL
      IF sy-subrc EQ 0.
        LOOP AT i_output INTO wa_output.
          READ TABLE i_mard INTO wa_mard WITH KEY matnr = wa_output-matnr.
          wa_output-lgort = wa_mard-lgort.
          MODIFY i_output FROM wa_output.
          CLEAR wa_output.
        ENDLOOP.                           " LOOP AT i_output
      ENDIF.                               " IF sy-subrc EQ 0
    regards
    twinkal

  • Filling dynamic internal table with data from other internal table

    Hi Friends,
    My problem is that i have already built a dynamic internal table
    (class int_table->create) but now i want to fill it with data from other internal table.
    The dynamic table column name and the field value of the data filled internal table are same, but how to access that column name, since i cant hard code it anyway.
    Like if my werks field value is '8001'. I want to place it under the column 8001 of dynamic table, Can anybody help me in this regard?
    Awarding points is not a problem for even giving a slight hint.
    Best Regards

    Hi
    See this
    Dynamic internal table is internal table that we create on the fly with flexible column numbers.
    For sample code, please look at this code tutorial. Hopefully it can help you
    Check this link:
    http://www.****************/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm
    Sample code:
    DATA: l_cnt(2) TYPE n,
    l_cnt1(3) TYPE n,
    l_nam(12),
    l_con(18) TYPE c,
    l_con1(18) TYPE c,
    lf_mat TYPE matnr.
    SORT it_bom_expl BY bom_comp bom_mat level.
    CLEAR: l_cnt1, <fs_dyn_wa>.
    Looping the component internal table
    LOOP AT it_bom_expl INTO gf_it_bom_expl.
    CLEAR: l_cnt1.
    AT NEW bom_comp.
    CLEAR: l_cnt, <fs_dyn_wa>, lf_mat.
    For every new bom component the material data is moved to
    temp material table which will be used for assigning the levels
    checking the count
    it_mat_temp[] = it_mat[].
    Component data is been assigned to the field symbol which is checked
    against the field of dynamic internal table and the value of the
    component number is been passed to the dynamic internal table field
    value.
    ASSIGN COMPONENT c_comp_list OF STRUCTURE <fs_dyn_wa> TO
    <fs_check>.
    <fs_check> = gf_it_bom_expl-bom_comp.
    ENDAT.
    AT NEW bom_mat.
    CLEAR l_con.
    ENDAT.
    lf_mat = gf_it_bom_expl-bom_mat.
    Looping the temp internal table and looping the dynamic internal table
    *by reading line by line into workarea, the materialxxn is been assigned
    to field symbol which will be checked and used.
    LOOP AT it_mat_temp.
    l_nam = c_mat.
    l_cnt1 = l_cnt1 + 1.
    CONCATENATE l_nam l_cnt1 INTO l_nam.
    LOOP AT <fs_dyn_table2> ASSIGNING <fs_dyn_wa2>.
    ASSIGN COMPONENT l_nam OF STRUCTURE <fs_dyn_wa2> TO <fs_xy>.
    ENDLOOP.
    IF <fs_xy> = lf_mat.
    CLEAR lf_mat.
    l_con1 = l_con.
    ENDIF.
    Checking whether the material exists for a component and if so it is
    been assigned to the field symbol which is checked against the field
    of dynamic internal table and the level of the component number
    against material is been passed to the dynamic internal table field
    value.
    IF <fs_xy> = gf_it_bom_expl-bom_mat.
    ASSIGN COMPONENT l_nam OF STRUCTURE <fs_dyn_wa> TO <fs_check>.
    CLEAR l_con.
    MOVE gf_it_bom_expl-level TO l_con.
    CONCATENATE c_val_l l_con INTO l_con.
    CONDENSE l_con NO-GAPS.
    IF l_con1 NE space.
    CONCATENATE l_con1 l_con INTO l_con SEPARATED BY c_comma.
    CLEAR l_con1.
    l_cnt = l_cnt - 1.
    ENDIF.
    <fs_check> = l_con.
    l_cnt = l_cnt + 1.
    ENDIF.
    ENDLOOP.
    AT END OF bom_comp.
    At end of every new bom component the count is moved to the field
    symbol which is checked against the field of dynamic internal table
    and the count is been passed to the dynamic internal table field
    value.
    ASSIGN COMPONENT c_count OF STRUCTURE <fs_dyn_wa> TO <fs_check>.
    <fs_check> = l_cnt.
    INSERT <fs_dyn_wa> INTO TABLE <fs_dyn_table>.
    ENDAT.
    ENDLOOP.
    Reward if useful
    Anji

  • Can we get the data from two internal tables in ALV.

    hi friends i would like to display the data using two internal tables using alv grid.please guide me.

    Hi,
    ALV would be having a specific layout say :
    MATNR
    MAKTX
    QTY
    Now, if you have two internal tables, then do they have a different structure. If they have different structures, then what kind of ALV layout you expect. The ALV output should be as per the structure of 1st or 2nd internal table.
    If both internal table have same layout, then populate the data from 2nd internal table into 1st internal table and pass the 1st internal table ( it will have data of both internal tables) to ALV.
    Best regards,
    Prashant

  • Read data from STATIC internal table during round trip in DO_PREPARE_OUTPUT

    Dear Gurus
    I have a requirement where I need to select some data from the database table BUT_HIER_NODE_D.
    After SELECTING this data to an internal table (say ITAB), I am displaying this data in a table view. I was able to achive this functionality by putting some code in the DO_PREPARE_OUTPUT method.
    Now according to my requirement, after the above data has been displayed on the screen initially, the user will click on any row. After clicking on a particular row, I need to capture the document number on that particular row and need to display all its child document numbers in a separate table. I am able to achive this functionality also.
    Initially I am not sure of how to READ the same internal table (ITAB) again and again by avoiding the SELECT query upon each round trip (between CRM and Web).
    After some research, I understand that I might have to use STATIC internal table to store the data during the
    initial SELECT. This way, upon each round trip, I can READ the data from the same internal table.
    My question: But now, when I tried to create a STATIC internal table in DO_PREPARE_OUTPUT, it is not allowing me to declare this table because DO_PREPARE_OUTPUT method is a INSTANCE method.
    I didn't find any STATIC methods in the IMPL class of the view.
    I would really appreciate if somebody can help me on how to proceed further.
    Thanks
    Raj

    Hi Bharathy / Adil / Masood
    Thank you very much for the replies. I declared a static method inside the IMPL class and I was calling this method inside the DO_PREPARE_OUTPUT method. Looks like it is working fine for me...will comeback if I had any further issues.
    Masood
    As per my requirement, I need to Select the data into the internal table during the very first step, then I need to continuosly read the data from this internal table upon every round trip. So I am not sure if I would be able to use the method DO_INIT_CONTEXT. Because I need a method which will trigger upon each round trip and will also hold the data of this internal table. So right now, the only option for me is DO_PREPARE_OUTPUT method.
    Plz let me know if am doing in the right way.
    Thanks
    Raj

  • Sending data from final internal table  to application server in xml format

    hi to all ,
    can anyone send details about send data from final internal table to application server in xml format.right now i am able to download data to presentation server in xml format . love to here soon from all the abap gigs.

    welcome to SDN.
    are you using call transformation to convert itab to XML? the XML string is in which format?
    convert it to xstring and then use the following code to store it in application server.
    OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
    TRANSFER XML_content TO FNAME.
    CLOSE DATASET FNAME.
    where fname is the path to the file name.
    Regards
    Raja

  • Moving the data from multiple internal tables into a single one

    Hello everyone,
    I am creating a classical report which uses the following tables.
    tables : ekko, ekpo, mara, makt,lfa1.
    my input parameter is 
    Select-options Purchase Order number
    Following fields are getting used.
    Doc no                  EKKO-EBELN
    Material              EKPO-MATNR
    Item number          EKPO-EBELP
    Quantity             EKPO-MENGE
    Material Group          MARA-MATKL
    Vendor                  EKKO-LIFNR
    Old Material code   MARA-BISMT
    Material Desc.           MAKT-MAKTX
    Vendor name         LFA1-NAME1
    Now i need to do the following task.
    1 Select record from EKKO Using document number.
    2 Select record from EKPO using EKKO record using Document no as key.
    3 Find out Old Material code of each and every material from Material master.
    4 Find out Material description for each and every material from MAKT.
    5 Sort record on Vendor, Purchase Order number and Material.
    I have defined seperate internal tables for these operation.
    Once i have fetched records into these individual internal tables  from the corresponding DB tables i need to move these values into a new internal tables which has all the above fields mentioned
    I need to move these values into a new internal table because to display the values on the report.
    Any idea for the above ? Plz help with a sample example or some relevant.
    Regards,
    Ranjith Nambiar

    Hi
    1 Select record from EKKO Using document number.
    2 Select record from EKPO using EKKO record using Document no as key.
    Use inner join and retrive data into one internal table.for Ex ITAB1
    3 Find out Old Material code of each and every material from Material master.
    Use ITAB1 with for allentries in MARA table to get the onl materil number populate in to one table.
    4 Find out Material description for each and every material from MAKT.
    Get the Material desc with the same manner as above,
    5 Sort record on Vendor, Purchase Order number and Material.
    now sort the ITAB1 as you req.
    now Loop on the ITAB1.
    and read above 2 tables for old matnr and matner deac and append into another table as you want.
    Hope this will help.
    Regards,
    Hiren Patel

  • 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

  • Fetching data from one internal table and populating into other table

    hi
    i am working on a report program.
    here,i have my data in a internal table(having only one field) i.e. only one column in the table.
    now i want to populate this data into other internal internal table that has 13fields i.e. 13 columns.
    so could anyone let me know how can i work on this.
    i am looping the internal table with one field into a work area from there i am not able to proceed ahead.
    thanks in advance

    hi
    i would like to clear one point here i.e. my internal table into which i want to populate data is a dynamic internal table....so i cant give the fieldnames here..
    here i am pasting the code..so that u may get some idea...
    "generating dynamic internal table :
    ref_descr ?= cl_abap_typedescr=>describe_by_data( it_itab ).
    it_details[] = ref_descr->components[].
    loop at it_details into wa_comp.
    cnt = cnt + 1.
    wa_fcat-col_pos = cnt.
    wa_fcat-fieldname = wa_comp-name.
    append wa_fcat to t_fcat.
    endloop.
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
      EXPORTING
        I_STYLE_TABLE             =
        IT_FIELDCATALOG           = t_fcat
        I_LENGTH_IN_BYTE          =
      IMPORTING
       EP_TABLE                  = lo_table
        E_STYLE_FNAME             =
      EXCEPTIONS
        GENERATE_SUBPOOL_DIR_FULL = 1
        others                    = 2
    so lo_table is my dynamic internal table.
    ASSIGN lo_table->* TO <f_tab>.
    using the GUI_UPLOAD i have uploaded the data file(separated by semicolon)  from presentation server and its in the table itab.
    with the following logic i am capturing the data in between the semicolon's.
    LOOP AT itab INTO wa_itab.
    find all occurrences of c_semicolon in wsg_string results result_tab.
    loop at result_tab into wa_reslt.
    if sy-tabix = 1.
    str1 = wsg_string+0(wa_reslt-offset).
    wa_prev_offset  = wa_reslt-offset.
    wa_prev_offset = wa_prev_offset + 1.
    clear str1.
      else.
       count = wa_reslt-offset - wa_prev_offset.
       count = count.
    str2 = wsg_string+wa_prev_offset(count).
    clear str2.
    wa_prev_offset  = wa_reslt-offset.
    wa_prev_offset = wa_prev_offset + 1.
    enddo.
    endif.
    endloop.
    data is there in the fields str1 and str2.now i want to populate this data into dynamic internal table row-wise.
    could anyone suggest me how can i do this

Maybe you are looking for

  • BPM does not start

    Hi guys, I have developed an XI interface that takes three files from an ftp location and by making use of a business process, it correlates them and creates some Idocs in target system. In SXMB_MONI, on the outbound side, I can see a green flag for

  • I cant hear all my musics on my ipod touch 5, i cant do anything at itunes about it!

    I cant hear all my musics on my ipod touch 5, i cant do anything at itunes about it

  • LoadBatchActions XML Date Parasing

    We are using LoadBatchActions to populate a matrix with data in a single call by passing an XML document, but we have noticed that in B1 2005, date columns in the matrix seem to parse the date wrong.  When you have the date format set to DD/Month/YYY

  • CALL ING TRANSACTION THROUGH ALV

    hi, any one can help me. i created one ALV interactive report.i want  in that first report when i click a record, it will go to the transaction MM01. pls any one can explain with code.

  • What is "other storage" and how do I clear it up?

    I have an Ipod touch 4th generation, 8GB. I am trying to clean out all my unused files, and I am seeing that over 3GB of the storage is being used up by "other files." This is very frustrating as this gives me very little storage space to work with,