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: 

ALV download: retain column sequence in excel

former_member186741
Active Contributor
0 Kudos

Good people,

I wish to download an alv report to excel but keep the column sequence in excel identical to that displayed in alv.

Currently what happens is the basic sequence is kept but 'non-char' fields are moved to the end, eg my alv displays postcode, region, credit limit(non-char), industry... BUT in excel after downloading this is changed to postcode, region, industry, credit limit.

I have tried setting the 'fix_column' fieldcat attribute for all fields but this seems to have no effect.

Any ideas?

1 ACCEPTED SOLUTION

hymavathi_oruganti
Active Contributor
0 Kudos

i think u need to use

'XXL_SIMPLE_API' fn module to download, check it once it may be usefull

6 REPLIES 6

hymavathi_oruganti
Active Contributor
0 Kudos

i think u need to use

'XXL_SIMPLE_API' fn module to download, check it once it may be usefull

0 Kudos

This what I did. Not very elegant, but it worked.

Rob

0 Kudos

thanks for your replies guys. Rob are you saying that you used 'XXL_SIMPLE_API'?

I was hoping there'd be some layout and/or fieldcat setting that would do the trick.

It looks like I'll need to use a custom button to kick this fm off which might be a bit of overkill for this report.

0 Kudos

Yes - XXL_SIMPLE_API. Having said that, I'd wait a while to see if someone comes up with something better.

Rob

former_member186741
Active Contributor
0 Kudos

seems that ALV has its own logic with the column sequence that cannot be over-ridden. The fm mentioned by others could be used in harness with a custom button but I didn't use it in this case.

0 Kudos

instead of export->spread sheet try export->local file and then choose spreadsheet, this will result in same as what you see in the screen.

Regards

Raja