Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV Problem

arvind_soni
Participant
0 Likes
1,013

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.

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
0 Likes
975

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

9 REPLIES 9
Read only

FredericGirod
Active Contributor
0 Likes
976

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

Read only

0 Likes
975

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

Read only

dani_mn
Active Contributor
0 Likes
975

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,

Read only

Former Member
0 Likes
975

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

Read only

Former Member
0 Likes
975

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

Read only

Former Member
0 Likes
975

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>

Read only

Former Member
0 Likes
975

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

Read only

0 Likes
975

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.

Read only

Former Member
0 Likes
975

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