Passin one internal tab to another

Hi all,
According to the problem i need to pass
<b>i_mard to t_mard</b>
But it showing error conversion is not possible
what I have to do ,so that FM on EXECL will work.
report y_test.
data: begin of i_mard occurs 0,
          matnr like mard-matnr,
         labst like <b>mard-labst</b> ,
      end of i_mard.
data: begin of t_mard occurs 0,
       matnr like mard-matnr,
        labst(17) <b>type c</b>   ,
      end of t_mard.
     data :  begin of it_fnames occurs 0,
        reptext like dfies-reptext,
      end of it_fnames.
select matnr LABST  from mard into table i_mard.
t_mard = i_mard.
it_fnames-reptext = 'MATERIAL'.
Append it_fnames.
it_fnames-reptext = 'Valued Stock'.
Append it_fnames.
CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
  EXPORTING
    FILE_NAME                       = 'C:\T001'
    DATA_SHEET_NAME                 = 'Companies'
  TABLES
   DATA_TAB                        = t_MARD
   FIELDNAMES                      = it_fnames
  EXCEPTIONS
    FILE_NOT_EXIST                  = 1
    FILENAME_EXPECTED               = 2
    COMMUNICATION_ERROR             = 3
    OLE_OBJECT_METHOD_ERROR         = 4
    OLE_OBJECT_PROPERTY_ERROR       = 5
    INVALID_FILENAME                = 6
    INVALID_PIVOT_FIELDS            = 7
    DOWNLOAD_PROBLEM                = 8
    OTHERS                          = 9

hi Satya,
Is both of your Itab contain <b>Same Structure</b> ?
Use,
I_mard[] = t_mard[] .
If the structures are not same, just loop the itab and insert the wa accordingly.
Rgds,
Jothi.P

Similar Messages

  • How do i transfer data from one internal tabe to another.

    Hi All,
             How do i transfer data from one internal tabe to another.
             Can i do it ebven if he tables are different in structure.
    Please Advice.
    Thanks in advance.

    Hi Saket Tiwari,
    I hope the earlier post by kashyap is good enough an answer. anywas in addition to it let me give a detailed
    explanation of how you can populate an internal table.
    1) Append data line by line.
         Syntax :  APPEND [<wa> TO / INITIAL LINE TO] <itab>.
    this appends new line to internal table <itab>.
    2) Using COLLECT statement.
                 COLLECT is another form of statement used for populating the internal tables.  Generally COLLECT is used while inserting lines into an internal table with unique standard key. The syntax for COLLECT statement is as shown
         Syntax : COLLECT [<wa> INTO] <itab>.
    3) Using INSERT statement
         Syntax  INSERT [<wa> INTO / INITIAL LINE INTO] <itab> [index <idx>].
    INSERT statement adds a line/work area to the internal table. You can specify the position at which the new line is to be added by using the INDEX clause with the INSERT statement.
    Now coming to your request..
    To append part or all of an internal table
         Syntax
                  APPEND LINES OF <itab1> [FROM <n1>] [TO <n2>] TO <itab2>.
    *     Note:
    Without the FROM and TO options, this statement appends the entire table <itab1> to <itab2>.*
    b) To insert part or all of an internal table into another internal table
         Syntax
              INSERT LINES OF <itab1> [FROM <n1>] [TO <n2>]
              INTO <itab2> [INDEX <idx>].
    c) Using Move statement.
    To copy entire contents of one table into another in one execution
         Syntax MOVE  <itab1> To <itab2>.
                   OR
              <itab1> = <itab2>.
    but u hav to be careful because he contents of itab2 will eb overwritten on the execution of this statement.
    These copy the contents of ITAB1 to ITAB2. Incase of internal tables with header line we have to use [] inorder to distinguish from work area. So, to copy contents of internal tables with header line  the syntax becomes,
    ITAB1[] = ITAB2[].
    Coming to the letter part of your question, Yes, we can copy values between tables having different structures.
    for this we use    
                                MOVE-CORRESPONDING <itab1> TO <itab2>
        this executes the statement for their header lines. Searches for the sub-fields which occur both in itab1 and itab2 and then generates, for all relevant field pairs which correspond to the
            sub-fields ni , statements of the form MOVE itab1-ni TO itab2-ni. The other fields remain unchanged.
    I hope the information provided has been of your help.
    Reward if useful.
    Regards,
    Jose

  • 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

  • Installed 3.6.8 and now cannot switch from one open tab to another

    my home page automatically opens 4 tabs, I updated to 3.6.8 on my mac laptop. Now when the tabs are open I cannot go from one open tab to another even though the tabs are still up.

    Download iTunes from Apple's web site and install it.  Don't use Software Update.

  • How to pass data from one internal session to another internal session

    hi all sap experts ,
    How to pass data from one internal session to another internal session and from oneExternal session to another external session.
    Except : Import and Export parameters and SPA/GPA parameters.
    Tell me the otherWay to pass data ..
    Plz
    Thanks in advance

    hi,
      abap memory management u will understand about this concept.
    the import /export parameter will help u that passing data between two internal sessions by using abap memory.
      for syntax
    Passing Data Between Programs
    There are two ways of passing data to a called program:
    Passing Data Using Internal Memory Areas
    There are two cross-program memory areas to which ABAP programs have access (refer to the diagram in Memory Structures of an ABAP Program) that you can use to pass data between programs.
    SAP Memory
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens (see below).
    ABAP Memory
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse. For further information, refer to Data Clusters in ABAP Memory.
    Filling Input Fields on an Initial Screen
    Most programs that you call from other programs have their own initial screen that the user must fill with values. For an executable program, this is normally the selection screen. The SUBMIT statement has a series of additions that you can use to fill the input fields of the called program:
    Filling the Selection Screen of a Called Program
    You cannot fill the input fields of a screen using additions in the calling statement. Instead, you can use SPA/GPA parameters. For further information, refer to Filling an Initial Screen Using SPA/GPA Parameters.
    Message was edited by:
            sunil kumar
    Message was edited by:
            sunil kumar

  • How to pass data from one internal session to another

    Hi SAP Experts,
    How to pass data from one internal session to another and from One external session to another external session. I used import and export parmeter and SPA/GPA parameters. What is the other way to pass data?
    Please tel me urgently
    Thank you
    Basu

    Memory Structures of an ABAP Program
    In the Overview of the R/3 Basis System you have seen that each user can open up to six R/3 windows in a single SAPgui session. Each of these windows corresponds to a session on the application server with its own area of shared memory.
    The first application program that you start in a session opens an internal session within the main session. The internal session has a memory area that contains the ABAP program and its associated data. When the program calls external routines (methods, subroutines or function modules) their main program and working data are also loaded into the memory area of the internal session.
    Only one internal session is ever active. If the active application program calls a further application program, the system opens another internal session. Here, there are two possible cases: If the second program does not return control to the calling program when it has finished running, the called program replaces the calling program in the internal session. The contents of the memory of the calling program are deleted. If the second program does return control to the calling program when it has finished running, the session of the called program is not deleted. Instead, it becomes inactive, and its memory contents are placed on a stack.
    The memory area of each session contains an area called ABAP memory. ABAP memory is available to all internal sessions. ABAP programs can use the EXPORT and IMPORT statements to access it. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
    All ABAP programs can also access the SAP memory. This is a memory area to which all sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters are often used to preassign values to input fields. You can set them individually for users, or globally according to the flow of an application program. SAP memory is the only connection between the different sessions within a SAPgui.
    The following diagram shows how an application program accesses the different areas within shared memory:
    In the diagram, an ABAP program is active in the second internal session of the first main session. It can access the memory of its own internal session, ABAP memory and SAP memory. The program in the first internal session has called the program which is currently active, and its own data is currently inactive on the stack. If the program currently active calls another program but will itself carry on once that program has finished running, the new program will be activated in a third internal session.
    Data Clusters in ABAP Memory
    You can store data clusters in ABAP memory. ABAP memory is a memory area within the internal session (roll area) of an ABAP program and any other program called from it using CALL TRANSACTION or SUBMIT.
    ABAP memory is independent of the ABAP program or program module from which it was generated. In other words, an object saved in ABAP memory can be read from any other ABAP program in the same call chain. ABAP memory is not the same as the cross-transaction global SAP memory. For further information, refer to Passing Data Between Programs.
    This allows you to pass data from one module to another over several levels of the program hierarchy. For example, you can pass data
    From an executable program (report) to another executable program called using SUBMIT.
    From a transaction to an executable program (report).
    Between dialog modules.
    From a program to a function module.
    and so on.
    The contents of the memory are released when you leave the transaction.
    To save data objects in ABAP memory, use the statement EXPORT TO MEMORY.
    Saving Data Objects in Memory
    To read data objects from memory, use the statement IMPORT FROM MEMORY.
    Reading Data Objects from Memory
    To delete data clusters from memory, use the statement FREE MEMORY.
    Deleting Data Clusters from Memory
    please read this which provide more idea about memory
    Message was edited by:
            sunil kumar

  • 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

  • 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 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

  • 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

  • Moving iTunes library from one internal drive to another

    tl;dr somewhat - cloned iTunes folder from one non-boot internal to another; changed Media Folder Location in Preferences, both boxes below checked; iTunes still plays music off old location.  Help!
    First off, I have a Mac Pro in which I have a 1TB drive separate from the boot drive simply to house my iTunes media folder.  I have been running out of space on the drive, so I purchased a 2TB drive to move my iTunes media folder to.  I had been allowing my iTunes Library files to stay on my boot drive in their default location, but after reading more about how the library files + media folder work, I decided to copy all of the library files to the 1TB drive iTunes folder, to mirror the boot drive's.  I used Option + open iTunes and selected the copied library file and everything worked perfectly - I mention this in case this has created the problem I'm now having.
    I used the Apple endorsed method of having iTunes do the copying/consolidating of files to the new location on the 2TB drive but it failed - and I know I followed the directions perfectly, I even tried it twice.  It copied over ~100k of my 134k songs, and the missing songs weren't just albums that had strange symbols (which I've had issue with before) - it would simply not copy some artists; or copy six of an artist's seven albums.  This was not going to be an option for me in terms of how to move my media.
    I had wanted from the beginning to use Carbon Copy Cloner (which I use every day and trust) to simply clone the 1TB to the 2TB drive and then change the location in the iTunes preferences.  I unchecked 'Keep iTunes Media Folder Organized' and 'Copy files...', then changed the location and clicked OK.  I then went back in, checked those two boxes and iTunes started into "Updating iTunes Library", which lasted a few minutes.  However, even though the new location is set to the 2TB drive, when I play a song (to make sure it works) and then click to see info, it's still reading it off the 1TB drive.
    So I remembered the whole Option + open iTunes thing, did that and selected the iTunes Library.itl file on the 2TB drive - nothing changed.  I read some more on various forums about it and thought that maybe I should Option + open iTunes and then select the iTunes folder itself - nothing changed.
    So I'm stuck with the media in the right place on the 2TB drive but iTunes still trying to read it off the 1TB, even though the location in Preferences has been set to the 2TB.  I feel like I'm just missing something simple here. WHAT DO I DO?! I'm guessing it's not as simple as removing the 1TB, renaming the 2TB and letting iTunes look where the 1TB used to be.

    Thank you so much for replying!  I'm not sure I quite understand, though.  The media folder is in (2TB) /iTunes/iTunes Music/Music currently, cloned from (1TB) /iTunes/iTunes Music/Music.  If I copied the /iTunes/ folder from 1TB to the 2TB, I'd be doing the exact same thing as when I cloned it, which I'm willing to do if I'm understanding you correctly.
    Or are you asking me to copy all of the files (minus the /iTunes Music/ folder) in the (1TB) /iTunes/ folder and replace all of those files in the (2TB) /iTunes/ folder?

  • Transfering from one Internal Order to another Internal order

    Hi
    I need to transfer part of internal order from one location to another internal order to a different location (not physically, but in the system). Budget is only one
    Can somebody let me know if we have this functionality in the Controlling. Each Internal Order is assigned to different CWIP.
    Prasad

    I want to transfer the Budget and Actuals also. The actual scenario is like this:
    We have a budget for 10lakhs. We purchased some materials. Please remeber this is CWIP related thru internal order. Part of the Budget is used (for 1 lakh) and purchased material against this. Part of this material purchased say 40000 is to be transfered to another location Physically, for similar activity.
    As a i am transfering this material, part of my internal order is also has to be transfered to the other location, but remember the budget will be the same.
    So I need to transfer actuals and budget to another location.
    Prasad

  • 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.

Maybe you are looking for

  • IR Report and Form Problem

    Hi, I Created a IR report using A form on a report wizard. I have now changed the underlying query in the IR and it is showing correct. In the Query i have created, I have extra columns that are not in the table of the report as shown in the Query be

  • Looking for a particular color correction tutorial

    I am looking for an online tutorial on how to do color correction if the video one is working with has color bars.  This happens on a lot of analog videotapes that come to me.  I know what my scopes are suppposed to look like when analyzing color bar

  • How do I transfer files verbatim across a socket connection?

    So, I've got this socket connection running between two computers. I want one computer to take a file (C:\SourceFile.doc for example) and transfer it verbatim over an Internet connection to another computer (C:\DestFile.doc for example). By verbatim,

  • OCA_Abuse exception 6402

    Hi Experts, I am encountering this exception during migration process. Details: Migrating from BO XIR2(Linux) to BO4.1 SP4(Linux). I have changed FRS input and output path on BO4.1 to: Errors: Please advise. Thanks. Regards Yue Seng

  • Taskdef [b]class com.sun.xml.rpc.tools.ant.Wscompile cannot be found[/b]

    Hi everybody, I m new in developing web service. I am using NetBeans IDE 4.1 EA2 for developing web service. I have created a sample jaxrpc web service. When i build project it gives me error that:taskdef class com.sun.xml.rpc.tools.ant.Wscompile can