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

Download to Excel File

Hello,

I have a scenario; where the table is been populated with data; and i need to download these data in to an Excel file on button action. I need the exact way to do this. Can anyone help me through this.

Regards,

Vinod

  • Rewards waiting..

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 19, 2008 at 02:13 PM

    U have to pass the data to an internal table(it_table[]) and use FM as follows..

    • Download

    CALL TRANSFORMATION ('ID')

    SOURCE tab2 = it_table[]

    RESULT XML xml_out.

    lr_conv = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ).

    CALL FUNCTION 'CRM_IC_XML_STRING2XSTRING'

    EXPORTING

    INSTRING = xml_out

    *

    IMPORTING

    OUTXSTRING = lv_content.

    cl_wd_runtime_services=>attach_file_to_response(

    i_filename = 'file.xls'

    i_content = lv_content

    i_mime_type = 'x-excel/application'

    i_in_new_window = abap_true ).

    Regards

    kartik

    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.