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

selected records of a table upload to excel.

hi everybody,

i need to upload all records of a selected table to excel sheet.

can anybody help me how to do this report.

if possible with example.

thanks & regards,

venu.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on May 13, 2005 at 01:38 PM

    This program will take any table with any where clause and download it to Excel (written in 640). Is this the kind of thing you are looking for?

    REPORT  ze_bc640_00_u07_table.
    
    PARAMETERS: table(30) TYPE c,
                where(100) TYPE c.
    
    DATA tabref TYPE REF TO data.
    FIELD-SYMBOLS <table> TYPE ANY TABLE.
    
    CREATE DATA tabref TYPE TABLE OF (table).
    ASSIGN tabref->* TO <table>.
    
    SELECT * FROM (table) INTO TABLE <table> WHERE (where).
    
    DATA: filename TYPE string VALUE 'c:test.xls'.
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        filename              = filename
        filetype              = 'ASC'
        write_field_separator = 'X'
      CHANGING
        data_tab              = <table>.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 13, 2005 at 01:38 PM

    Here is one way.....

    
    report zrich_0001 .
    
    data: imara type table of mara with header line.
    
    start-of-selection.
    
      select * into table imara up to 100 rows
                from mara.
    
    
      call function 'WS_EXCEL'
           exporting
                filename = 'TEST.XLS'
           tables
                data     = imara.
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

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

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