2007 Apr 05 9:17 AM
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
2007 Apr 05 9:40 AM
hi
can you send me across the code , i guess there should b some probs with the feildcatalog.
Regards
Zarina
2007 Apr 05 9:43 AM
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
2007 Apr 05 9:47 AM
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
2007 Apr 05 10:00 AM
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
2007 Apr 05 10:11 AM
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
2007 Apr 05 10:15 AM
Thanks shipa. But the contraint here is we should bring in any new buttons. The customer needs this functionality to be rectified.