2005 Aug 10 11:32 AM
Hi
I think subject itself is more explanatory .
i need to Export the output of the report in excel programatically.
I know that i can use gui_download FM .
But i m dynamically printing my report so i dont have the perfect internal table. thjats why i can not use gui_download.
Hope u got it .
Each person will get the point depend on the ans
Thaks
Gain_ponits
2005 Aug 10 11:40 AM
Hi,
If you want to export to a real excel file, I can propose you two options:
1) Use office integration - lcl_xls_interface
Demo program: SAPRDEMO_TABLES_IN_EXCEL
2) FM 'SAP_CONVERT_TO_XLS_FORMAT'. It save a file in excel format.
call function 'SAP_CONVERT_TO_XLS_FORMAT'
exporting
I_FIELD_SEPERATOR = seper
I_LINE_HEADER = 'X'
I_FILENAME = P_FILE
tables
I_TAB_SAP_DATA = itab
exceptions
CONVERSION_FAILED = 1.
Svetlin
Message was edited by: Svetlin Rusev
2005 Aug 10 11:40 AM
Hi,
If you want to export to a real excel file, I can propose you two options:
1) Use office integration - lcl_xls_interface
Demo program: SAPRDEMO_TABLES_IN_EXCEL
2) FM 'SAP_CONVERT_TO_XLS_FORMAT'. It save a file in excel format.
call function 'SAP_CONVERT_TO_XLS_FORMAT'
exporting
I_FIELD_SEPERATOR = seper
I_LINE_HEADER = 'X'
I_FILENAME = P_FILE
tables
I_TAB_SAP_DATA = itab
exceptions
CONVERSION_FAILED = 1.
Svetlin
Message was edited by: Svetlin Rusev
2005 Aug 10 12:37 PM
2005 Aug 11 7:28 AM
Hi al,
Thanks for reply!!
I thing is I dont have my internal table in proper form.
So i m producing my report by doin some calculation .
Thants why i wann export my output which has dynamically produced into excel by program.
I know that after gettin output i can go to option and list and export to excel manually.
Above thing i wann do programatically
hope u can understand my quaey .
Gain_Point
2005 Aug 11 8:39 AM
Hi,
I can propose you 2 variants:
<b>1) write list to DAT file.</b>
report ztest.
type-pools SLIST.
data: pages TYPE slist_pagedescr_tab,
list TYPE slist_list_tab,
fmbs TYPE slist_fmbs_tab,
fmbx TYPE slist_fmbs_tab,
fsel TYPE slist_fsel_tab,
tags TYPE slist_hypertags_tab,
list_index type i,
listlevel_description TYPE slist_listds.
write:/ 'This is my test list'.
at line-selection.
PERFORM PREPARE_LIST_TABLES IN PROGRAM SAPLSLST
TABLES
PAGES
LIST
FMBS
FMBX
FSEL
TAGS
USING
LIST_INDEX
CHANGING
LISTLEVEL_DESCRIPTION.
CALL FUNCTION 'LIST_CONVERT_TO_DAT'
TABLES
LIST = LIST[]
FMBS = FMBS[]
FMBX = FMBX[]
FSEL = FSEL[].
<b>2) read list values</b>.Read the list values(READ LINE stmt) within a DO loop and transfer them to internal table. Save the internal table to a file.
Svetlin