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

ALV: Export spreadsheet

Former Member
0 Likes
501

Hi

I am exporting a spreadsheet from ALV. There are about 126 columns and all columns are getting exported to the file but the record is not coming in single row.

The last column filled was CT and then the next column filled is column A for the same record. I dont think this is a problem with Excel as I am able to fill in columns manually beyond CT.

Can anyone tell me how I can get the record in a single row.

Regards,

Navneet Saraogi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
432

I had also faced the same problem once.

The solution for this is to create your own pf-status and handle the download button with your own code.

You can use the method

call method cl_gui_frontend_services=>file_save_dialog
 
      changing FILENAME = file
               path     = path
               fullpath = file_path.

for adding interactivity.

You can then call

call method cl_gui_frontend_services=>gui_download
 
    exporting    filename                = file_Path
                  WRITE_FIELD_SEPARATOR = 'X'
 
     changing    data_tab                = itab.

But note that, this method is not avalilable in 4.6c.

Instead you can use 'GUI_DOWNLOAD' or 'WS_DOWNLOAD'.

Alternatively, also check out XXLSTEST report. This was actauuly suggested by another SDN Member to me!

To download the excel file, you can alternatively use EXCEL_OLE_STANDARD_DAT for more customizations.

Message was edited by: Nazim Ur Rahman

2 REPLIES 2
Read only

Former Member
0 Likes
433

I had also faced the same problem once.

The solution for this is to create your own pf-status and handle the download button with your own code.

You can use the method

call method cl_gui_frontend_services=>file_save_dialog
 
      changing FILENAME = file
               path     = path
               fullpath = file_path.

for adding interactivity.

You can then call

call method cl_gui_frontend_services=>gui_download
 
    exporting    filename                = file_Path
                  WRITE_FIELD_SEPARATOR = 'X'
 
     changing    data_tab                = itab.

But note that, this method is not avalilable in 4.6c.

Instead you can use 'GUI_DOWNLOAD' or 'WS_DOWNLOAD'.

Alternatively, also check out XXLSTEST report. This was actauuly suggested by another SDN Member to me!

To download the excel file, you can alternatively use EXCEL_OLE_STANDARD_DAT for more customizations.

Message was edited by: Nazim Ur Rahman

Read only

0 Likes
432

Hi

Thanks for the reply. I have used GUI_DOWNLOAD to get the file.

I found out the reason why the line had not come in the same row. It was because the length of the line was more than 1023 characters.

Thanks

Navneet