on 01-14-2008 8:02 AM
Hi Experts ,
I have a requirement where i would like to display the data from an internal table into an Excel sheet on the click of a user defined button .
I am not displaying a ll these fields in an ALV , yet i want them to be exported to the excel .
Can anyone help me out with this .
Thanks and Regards ,
Radhika .
hi radhika........
you will be having your values in an internal table.
now in the on action method,
call the function gui_download and pass teh internal table to it.
the file type must be 'ASC' and the filename must be <filename>.xls.
---regards,
alex b justin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1) First read all the table data into an internal table using get_static_attributes_table.
2) Then take all the internal table data into a string variable.
ex:
READ TABLE itab INTO wa_itab INDEX 0.
LOOP AT itab INTO wa_itab.
CONCATENATE wa_itab-carrid
wa_itab-connid
wa_date
wa_price
wa_currency
cl_abap_char_utilities=>newline INTO lo_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
endloop.
3) Convert the string variable to XSTRING format using FM.
ex:
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = lo_final_string
IMPORTING
buffer = lo_xstring.
4) Use below method:
wdr_task=>client_window->client->attach_file_to_response(
i_filename = " path to the word file
i_content = " lo_xstring-> your xstring variable
i_mime_type = 'EXCEL/WORD/NOTEPAD' ).
Hope that it does help you out. Award points if useful
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.