‎2006 Oct 20 7:55 AM
I want a button on the tool bar of the ALV on which When i click the data in the ALV gets transported to the Excel sheet.
I know the Feature is there in the ALV,but when i click on the existing button it asks for the options as shown below :
In which format should the
be saved ?
unconverted
Spreadsheet
Rich text format
HTML Format
Copy to Clipboard
I want the functionality such that when the user click on the button it directly transports the file to the Excel spreadsheet.
I dont know much about the OOABAP,So please provide the solution using the classical ABAP only.
Thanks in advance.
‎2006 Oct 20 7:57 AM
Hi,
add the button to the toolbar,
manage the code at the button event,
and use the following function to save the table in Excel file: SAP_CONVERT_TO_XLS_FORMAT
Rgd
Fred
‎2006 Oct 20 7:57 AM
Hi,
add the button to the toolbar,
manage the code at the button event,
and use the following function to save the table in Excel file: SAP_CONVERT_TO_XLS_FORMAT
Rgd
Fred
‎2006 Oct 20 9:54 AM
Hi Girod,
In the Function module:
CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
I_FIELD_SEPERATOR =
I_LINE_HEADER =
i_filename = 'C:/'
I_APPL_KEEP = ' '
tables
i_tab_sap_data = 'IT_OUTPUT'
CHANGING
I_TAB_CONVERTED_DATA =
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2
i have given the internal table name in tables i_tab_sap_data and the file path in the filename.But it is showing the error as 'it is not the standard table'
please reply
‎2006 Oct 20 7:59 AM
HI,
use the function 'GUI_DOWNLOAD' to download the data to the excel sheet.
if you want button in application tool bar then you have to use OO method. In classical it is not possible.
Regards,
‎2006 Oct 20 8:01 AM
Yes the Feature is there in ALV. Here you need to select <b>spreadsheet</b> format, then it will be saved as excel sheet.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
‎2006 Oct 20 8:29 AM
Hi Arvind,
use ALV-GRID, there is an EXCEL-Button wich show the
Output direct in EXCEL-Format. You can use this
Excel-Format as default.
Regards, Dieter
‎2006 Oct 20 8:49 AM
Hi Arvind,
Have u got answer for the query? If not please revert back else please close the thread.
Best Regards,
Vibha
<b>*Please mark all the helpful answers</b>
‎2006 Oct 20 10:05 AM
Hi Arvind,
What u were doing earlier was correct. U just have to mention the formar as speadsheet when u are using the feature provided by SAP.
Have you checked it Arvind? I think no changes are necessary.
Just try it out...
Best Regards,
Vibha
*Please mark all the helpful answers
‎2006 Oct 20 10:14 AM
Hi guys !!
Its working now but the only thing left is that when the data is transported to the excel sheet the field label from the data dictionary should also come on the Excel sheet.
Do I need to make some changes in the internal table like the field label inclusion at the time of data fetching.
Thanx.
‎2006 Oct 20 10:29 AM
Arvind,
Really it is not necessary to use the FM SAP_CONVERT_TO_XLS_FORMAT.
Using SPREADSHHET FORMAT was the simplest solution to ur problem.If you can use ur earlier method there will not be any problem of labels also.
Best Regards,
Vibha
*Please mark all the helpful answers