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

Resorted Columns when exporting from ALV to SPREADSHEET

Former Member
0 Likes
2,448

Hi,

I have a report which displays data on an ALV grid control. This output has a specific column's order on the grid, but when I click the button to export to an Excel File the system somehow resorted the columns and display them differently. I didn't make any change to the catalog before exporting to Excel. Do someone have any idea why is this happening and how to fix it? I'll appreciate very much your help on this. Thanks.

1 ACCEPTED SOLUTION
Read only

Laxmana_Appana_
Active Contributor
0 Likes
1,007

Hi,

It is a problem with EXCEL, it alters the sequences of columns depending on the data type numerics,char.

Set the 'COL_POS' field of the feild catalog to each and every column and check.

Regards

Appana

4 REPLIES 4
Read only

Laxmana_Appana_
Active Contributor
0 Likes
1,008

Hi,

It is a problem with EXCEL, it alters the sequences of columns depending on the data type numerics,char.

Set the 'COL_POS' field of the feild catalog to each and every column and check.

Regards

Appana

Read only

Former Member
0 Likes
1,007

Its not a problem with EXCEL, but with the standard feature of the ALV grid. When you download using the standard button, it puts all the CHAR fields in the front and all the NUMERIC columns to the end in the downloaded excel file.

Alternative is to provide this functionality yourself by having a button and downloading the table using GUI_DOWNLOAD to a excel.

Regards,

Ravi

note : Please mark all the helpful answers

Read only

0 Likes
1,007

Ravi,

Thanks for your reply. Can you please give some kinf of example or any documentation about implementing GUI_DOWNLOAD since I'm kind of new with ABAP, I'll appreciate it very much it it's possible for you.

Regards.

Read only

0 Likes
1,007

Hi...

Read SAP Note 358644 ALV Export Excel: Recommendations and known errors.

Using the "Spreadsheet..." download button may re-arrange the column order...

"The system sorts or groups the columns together according to characteristics and key figures"

Using the "Local file..." download button... then choosing the "Spreadsheet" option should leave everything as it was...

Do I get points for this answer ?

Dave...

Message was edited by: Dave T.