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: 

Excel file size when download to Local File from ALV

Former Member
0 Kudos

Hi,

An issue was founded in ALV GRID when user exports the data to Excel file via Local File button (Local File -> Spreadsheet) or via List menu (List -> Export -> Local File -> Spreadsheet). The problem in local file is a line break occurs and moves 1 row in ALV into 2 rows in Excel.

There is some discussions about this situation in SCN, and some SAP related notes like  855314 - Downloading a list from the ALV to Excel that explain this issue, but is not a fixed rule because this happens sporadically, (when the local file size grow up than 7 MB, and others).

Other issue is when you download the data from internal table of the ALV  in debugging session (Tools -> Save Local File -> Spreadsheet), the file size is 1/3 of the file size when you download the file after shown the ALV data, via button or List menu (3,3 MB vs. 9,7 MB).

Anybody knows the reason of the size difference between debugging file and alv file?

Anybody knows the size limit of the excel files downloaded from ALV until the line break?

Thanks and regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

Eventually the issue is not caused by the size. The reason are special characters contained in a list field  ("-) .

Regards.

2 REPLIES 2

naimesh_patel
Active Contributor
0 Kudos

I don't know why the line break occurs, but I can explain the size difference.

When you do  Local File button (Local File -> Spreadsheet) or via List menu (List -> Export -> Local File -> Spreadsheet) on ALV, ALV internally writes the LIST (using the WRITE statement) and then downloads it using the similar functionality of LIST > Save. Since it uses the WRITE statement, it also generates the TOP OF PAGE, after certain rows (60000 or so - 1017586 - ALV export: New TOP-OF-PAGE displayed after 60,000 lines  )

When you use the Download from debugger (Tools -> Save Local File -> Spreadsheet), it uses the normal GUI_DOWNLOAD function to download the data. See FM TPDA_STANDARD_DOWNLOAD.

Since you have bigger table to download, I suggest that you implement your own function on ALV to download the data leveraging methods FILE_SAVE_DIALOG and GUI_DOWNLOAD of class CL_GUI_FRONTEND_SERVICES. This way you have better control on download data. But, it would be additional logic, if you need to consider ALV Sort and Filters while downloading.

Regards,
Naimesh Patel

Former Member
0 Kudos

Hello,

Eventually the issue is not caused by the size. The reason are special characters contained in a list field  ("-) .

Regards.