Application Development 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: 

Exporting to Excel - ALV Grid

Former Member
0 Kudos
128

Dear Experts,

I have come across a strange scenarion where in the "Export to Excel" functionality from an ALV grid behaves differently for different layout selections.

for eg: I have my output list with 10 fields displayed. If I export the list to the excel using the button from the application tool bar of the grid, my output excel is having only the column headings without any values. Where in say, if i select all the fields of the output list (around 20), then the output is perfect into the excel.

Kindly let me know what would be the problem and how to handle them.

Lots of rewards awaiting.

Thanks.

Arunkumar S

6 REPLIES 6

Former Member
0 Kudos
93

hi

can you send me across the code , i guess there should b some probs with the feildcatalog.

Regards

Zarina

0 Kudos
93

Hi Zarina,

We have used Class objects for the Grid display and not our usual RESUSE methodology.

Thanks for your quice response. It would be nice if u can find me more about this now.

Arunkumar S

0 Kudos
93

Hi arun,

This looks strange!!!!!

Anyways try this ..

Open your excel sheet

Tools>Macros>Security

Change that to medium if not

And also in the same macro popup , goto Trusted Publishers tab

Check the Trust Access to visual Basic Project Checkbox

0 Kudos
93

Dear Chandrasekar,

Even Im confused having such a scenario. Those settings are already made.

Could you please further help me out.

If I have the entire list of fields, im getting the output perfect. There lys the confusion to great extent.

Arun

Former Member
0 Kudos
93

Hi Arunkumar,

Some time export to excel through Local file-->spreadsheet option behave abnormally.

You can do one thing as you have all your data in internal table.

Add a button " Export to excel" in Menu painter and use following code in subroutine user_command

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG

EXPORTING

DEFAULT_EXTENSION = 'XLS'

DEFAULT_FILE_NAME = L_FILE_NAME

CHANGING

FILENAME = L_FILENAME

PATH = L_PATH

FULLPATH = L_FULLPATH.

thanks,

shilpa

0 Kudos
93

Thanks shipa. But the contraint here is we should bring in any new buttons. The customer needs this functionality to be rectified.