Transfer intenal table to file

Hi abaers,
i need to transfer the internal table data to file,,this file to create in application server.
internal table lineitems contains 100 fields...
i tried in the following method: but 100 fields i have to move each and evry field to t_output-data.. so it is becoming complex.
data: begin of t_output occurs 0,
     data(800),
   end of t_output.
loop at lineitems.
t_output-data(4) = lineitems-COMP_CODE.
t_output-data+4(10) = lineitems-VENDOR.
append t_output.
clear t_output.
endloop.
   open dataset filename for output in text mode encoding default.
   loop at t_output.
      transfer t_output-data to filename.
     clear t_outpu-data.
   endloop.
   close dataset filename.
endif.
is there any other method to do direct transfer from internal table to file..

Hi,
I think FM: GET_COMPONENT_LIST would be very useful to u.
i have attached the complete code and it's working absolutely fine with me.
Code **********
types: begin of type_item,
        f1(3),
        f2(3),
        f3(3),
        f4(3),
       end of type_item.
types: begin of type_data,
        data(800),
       end of type_data.
data : lineitems type table of type_item with header line,
       t_output type table of type_data with header line,
       fieldlist type table of RSTRUCINFO with header line.
lineitems-f1 = 'a1'.
lineitems-f2 = 'a2'.
lineitems-f3 = 'a3'.
lineitems-f4 = 'a4'.
append lineitems.
lineitems-f1 = 'b1'.
lineitems-f2 = 'b2'.
lineitems-f3 = 'b3'.
lineitems-f4 = 'b4'.
append lineitems.
lineitems-f1 = 'c1'.
lineitems-f2 = 'c2'.
lineitems-f3 = 'c3'.
lineitems-f4 = 'c4'.
append lineitems.
lineitems-f1 = 'd1'.
lineitems-f2 = 'd2'.
lineitems-f3 = 'd3'.
lineitems-f4 = 'd4'.
append lineitems.
field-symbols : <fs> type any.
CALL FUNCTION 'GET_COMPONENT_LIST'
  EXPORTING
    PROGRAM    = sy-repid
    FIELDNAME  = 'lineitems'
  TABLES
    COMPONENTS = fieldlist.
data : fieldname like fieldlist-compname,data_line type type_data,dref
type ref to data.
format color 3.
loop at lineitems REFERENCE INTO dref. .
loop at fieldlist.
    fieldname =  fieldlist-compname .
    assign dref->(fieldname) to <fs>.
  concatenate data_line <fs> into data_line .
endloop.
append data_line to t_output.
clear data_line.
endloop.
loop at t_output.
  write:/ t_output.
endloop.
Code *************
If u still have any issues please revert back.
Hope it'll help u.
Regards,
Ankur

Similar Messages

  • How to transfer the tables from one file group to another file group in SQL 2008.?

    Hello all,
    I have few issues regarding the transfer of the tables from one file group to another file group  in SQL 2008 and also How can we  backup
    and restore the particular database based on file group level.
    Let’s say I have a tables stored within the different FG. such as
    Tables                                                    
      File group
    Dimension tables                                              
                                                                     Primary
    Fact tables                                               
                                                                              FG1
               FG2…
    zzz_tables                                               
                                                                              DEFAULT_FG    
    dim.table1                                                                                                                          DEFAULT_FG
    dim.table2                                                                                                                          DEFAULT_FG
    Here all I want to transfer the dim.table1 ,dim.table2  from  DEFAULT_FG to the Primary File
    group .So is there simple methods for transfer the dim.table1,2  from one FG to another .I have tried somewhat but I couldn’t get the exact way .So if someone have better idea please share your knowledge that would be really appreciated.
    Secondly after moving those dim.table1 ,dim.table2 from DEFAULT_FG to Primary ,All I want to backup and restore the database only containing  the Primary and FG1,FG2… not
    a DEFAULT_FG.Is it possible or not.?
    Hope to hear from the one who knows better approach for this kind of task .Your simple help will be much appreciated.
    Regards,
    Anil Maharjan

    Well after all my full day research on this topic had paid off, I finally got the solution and am so happy to research on these things. It makes
    us feel really happy after all our research and hard work doesn't goes as waste.
    Finally I got what I am looking for and want to make sure that I am able to transfer the tables from DEFAULT_FG to another FG without tables
    having clustered index on that tables .
    With the help of the link below I finally got my solution where Roberto’s coded store procedure simply works for this.
    Really thanks to him for his great post and thanks to all for your response and your valuable time.
    http://gallery.technet.microsoft.com/scriptcenter/c1da9334-2885-468c-a374-775da60f256f
    Regards,
    Anil Maharjan

  • Intenal tables

    Hi Guys,
                  I am having two internal tables.I have to mov the data from one Internal table to another internale table.I have to transfer the second internal table data into a file
    It_bkpf------all columns.
    DATA: BEGIN OF wa_bkpf_temp,
            lineno(7) TYPE n,
            prog_space     TYPE c VALUE ' ',
            data_rec(712) TYPE c ,
         END OF wa_bkpf_temp.
               I wrote the logic like this
      LOOP AT il_bkpf_header into wa_bkpf_header_out. "Load data to SAP Server.
        got_cha_cnt = got_cha_cnt + 1.
        MOVE got_cha_cnt TO wa_bkpf_temp-lineno.
       MOVE wa_bkpf_header_out TO wa_bkpf_temp-data_rec.-----Syntax Error
        TRANSFER wa_bseg_temp TO wa_acntdoc_header_file.
      ENDLOOP.
                       I wrote the abap Statement like this
        MOVE wa_bkpf_header_out TO wa_bkpf_temp-data_rec.
          But i am getting syntax error.can anybody tell me how to move the data from BKPF intenal table to wa_bkpf_temp.
                    Very urgent.
    Thanks,
    Gopi.

    Below  is the code for  capturing data fromt he table to internal table then to  FILE.
    just copy the code and try  .... and change the table  which ever you wasnt and fields also...
    REPORT  ZREPORT_CAPTURE  no standard page heading.
    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid.
    DATA: BEGIN OF it_report OCCURS 0,
          line(300),
          END OF it_report.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * retrieve data
      PERFORM data_retrieval.
    *END-OF-SELECTION.
    END-OF-SELECTION.
    * display date on screen
      write: sy-uline(27).
      LOOP AT it_ekko INTO wa_ekko.
        WRITE:/ sy-vline,
                (10)wa_ekko-ebeln, sy-vline,
                (10)wa_ekko-ebelp, sy-vline.
      ENDLOOP.
      write:/ sy-uline(27).
    * capture report to internal table, does not work for ALV reports
      CALL FUNCTION 'LIST_TO_ASCI'
        EXPORTING
          LIST_INDEX               = 0
        TABLES
          listasci                 = it_report.
    * download report to file
      CALL FUNCTION 'WS_DOWNLOAD'
        EXPORTING
          filename = 'C:tempreport.txt'
          filetype = 'ASC'
        TABLES
          data_tab = it_report.
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekko.
    ENDFORM.                    " DATA_RETRIEVAL
    Reward  Poitns if it is  usefull ...
    Girish

  • How can i transfer more than one file from server to client

    Hi,
    our requirement is transfer more than one files from server to client using the
    webutil_file_transfer.as_to_client_with_progress.One file transfer is already working in our system.If anybody know the solution please inform
    regards
    mat

    just an idea ...
    for this purpose let us put aside security concerns and other potential problems....
    -- Get the content of a server directory with Filter and create zip file
    1) create a class that implements java.io.FilenameFilter ...
    2) define accept() method ...
    3) call File.list() with the filter as a parameter. The returned array of strings will have all the names that passed through the accept() filter
    4) use java.util.Zip to create ZIP file on the server side
    -- I think it is better to create this functionality as a separate Java class, put it in required folder and after it
    -- use Forms->Program->"Import Java class" to create pl/sql wrappers, than to create wrappers for all classes and code in pl/sql
    5) use webutil to transfer file on the client
    6) use Java on client side to unzip transferred file
    if you think this is not too complicated, you should try ...
    Regards,
    Vladimir

  • I have a power pc (g5) computer that I will soon be replacing with a current i5 or i7 mini. How do I transfer the Time Machine files from the internal hard drive on the G5 to an external drive that I will later use with the Mini?

    I have a Power PC G5 computer that I will soon be replacing with a current i5 or i7 Mini. How do I transfer the Time Machine files from the internal hard drive on the G5 to an external drive that I will later use with the Mini?

    Hi, likely the easiest is to just poll the drive & get something like this...
    Get MacScan...
    http://www.apple.com/downloads/macosx/networking_security/macscan.html
    http://eshop.macsales.com/item/NewerTech/U3NVSPATA/
    But if you have a good external drive already, just clone it.
    Get carbon copy cloner to make an exact copy of your old HD to the New one...
    http://www.bombich.com/software/ccc.html
    Or SuperDuper...
    http://www.shirt-pocket.com/SuperDuper/

  • I have a mid year 2007 24 inch iMac and will be purchasing a new 27 inch Retina iMac, what is the easiest way to transfer the data and files from my old machine to the new one?

    I have a mid year 2007 24 inch iMac and will be purchasing a new 27 inch Retina iMac, what is the easiest way to transfer the data and files from my old machine to the new one?

    Following up on this thread,
    I have a new iMac on the way and my current is from 2008, never had a problem but I am sure there are internal issues that I would prefer not to transfer.
    I have no issues other then the slowness in certain programs and that is the main reason to buy a new one.
    Programs like numbers and pages seem to take a longer time to open after I update to Yosemite.
    I only use 272GB of 500 GB, my memory is 4GB and I am upgrading to 8Gb and bought the 4.0 processor.
    Question:
    Is there a way to manually transfer items or would that be a waste of time in that if there are issues they could be anywhere and would transfer anyway?

  • Can I transfer the outlook pst file from one mac to another

    Can I transfer the outlook pst file from one mac to another?

    sure you can
    also to a windows pc and import it in a windows outlook

  • How can I transfer an adobe reader file to Microsoft word?

    I have Windows Vista on my machine. I really need to transfer an Adobe reader file into Microsoft word or at least be able to type inside of Adobe. Just wondering how can I do this task or am I just not able to?
    Any help or suggestions out there..?

    That would require using Adobe Acrobat. It can create Word docs from PDF's.
    The bad news is, most of the time it doesn't do a very good job at it.
    With Acrobat, you could also add form fields that you can fill in which would be much better.

  • How can I transfer all of the files from my old iPhone 4S to my new iPhone 5?

    how can I transfer all of the files from my old iPone 4S to my new iPhone 5?

    Download the media content from an iTunes library or the iTunes Store, and follow these instructions to transfer your personal settings and data.
    (83108)

  • How can i transfer the radio recording files from my Ipad to Computer

    how can i transfer the radio recording files from my Ipad to Computer ?

    I was hopeful I could use home sharing to sync my iTunes libraries,
    Unfortunately, you can only stream content to your iOS devices via home sharing (not sync it).
    I'd have a check through the following user tip instead:
    Recovering your iTunes library from your iPod or iOS device

  • Error when opening table container file keydb read only

    Hi Guys,
    We are installing solution manager 4.0 on windows/sql but we are getting following error and couldnt continue the installation
    FKD-00070  Error when opening table container file C:\PROGRA1\SAPINS1\SOLMAN\SYSTEM\MSS\CENTRAL\AS\keydb.xml for writing. Possible reason: "read-only"
    ERROR 2008-06-04 20:10:56.843
    FKD-00049  XML - Parser error: error: no DTD specified, can't validate in line 1, 1
    in file C:\Program Files\sapinst_instdir\SOLMAN\SYSTEM\MSS\CENTRAL\AS\keydb.xml.
    Please help
    Regards,
    Santosh

    Further info
    keydb.xml is empty and the directory has got write access for everyone
    regards
    Edited by: Santosh Keerti on Jun 4, 2008 1:29 PM

  • How to transfer more than one files over internet at once?

    hi, friends,
    I just wonder how to transfer more than one files from one computer to another over internet at once. Not using ftp. pls any one give me the solution.

    This isn't hard to do, but it depends on your exact need. I did something very similar to let me upload all my mp3 file from home to work using sockets (don't have the code anymore..).
    What I did was implement a "pull" approach rather than a "push" approach. In other words, everytime my server got a request from a client, it served up the next file. It didn't know or care that the client was always the same.
    If you can set up a server to serve one file when a client attaches, then basically just put that code in a loop.
    If this doesn't meet you need, it might still be helpful as a starting point...

  • I'm a new MAC user and I'm trying to transfer my iTunes music files to my Mac, however when I attach the external drive that contains the music files, they aren't visible on the MAC (but they are visible on my old PC).  How do I get my music loaded?

    I'm a new MAC user and I'm trying to transfer my iTunes music files to my Mac, however when I attach the external drive that contains the music files, the music files aren't visible on the MAC (but they are visible on my old PC).  How do I get my music transferred?  I have already exported the purchased music from the iTunes library, but I have thousands of songs from my private CD collection that I had previously loaded through iTunes.

    Paragon Software has the most reliable NTFS driver for Mac
    tips on importing and organizing, transferring from Windows etc
    http://www.apple.com/support/itunes
    http://www.ilounge.com

  • How to transfer a 8GB .MOV file from MacBook Air (late 2013) via external HD (Samsung S2 Portable) to a Dell laptop ?

    Hi guys and galls,
    How can I transfer a 8GB .MOV file from MacBook Air (mid 2013) via external HD (Samsung S2 Portable) to a Dell laptop ? The mentioned file currently will not let me transfer it to my ext HD. I want to upload it afterwards to a Dell laptop with Windows software installed.
    Reformatting the drive doesn't seem to be the sollution, since this will erase all the data stored on the ext HD, and it will only allow me to use the drive with either Apple or Microsoft equipment.
    Please HELP, running out of options here... Thnx, "Apple-Dummy"

    Apple-Dummy wrote:
    How can I tell whether my External HD is formatted NTFS?
    Attach the HDD to your MBP.  Click on the icon on the desktop COMMAND+I. It will produce a display such as this and look what it says by FORMAT.
    How do I format my External HD: FAT or ExFAT?
    Do this on a PC.  You will have to use the Windows equivalent of Disk Utility.  I am not a Windows user so I cannot give you detailed information regarding this.  I have seen on these forums that there are at times compatibility problems if formatted on a Mac.
    Which one is preferred, FAT or ExFAT? And why?
    Use ExFAT.  FAT has a file size limitation of 4 GB.
    Ciao.

  • How to transfer video and audio files from windows PC to new ipad?

    How to transfer video and audio files from windows PC to new ipad?

    iTunes: Syncing media content to iOS devices and iPod
    Sync with iTunes.
    Connect the iPad to the PC and launch iTunes.
    Click on the iPad name on the left side under devices.
    Click on the Music Tab on the right.
    Click on all of the albums, artists, playlists that you want to sync
    Click on the Sync Music Heading.
    Click on Apply in the lower right corner of iTunes
    Follow the same procedure for Movies.

Maybe you are looking for