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: 

Problem while exporting ALV to spreadsheet

Former Member
0 Kudos

Hi,

I'm displaying a report in ALV grid. It has 25 columns.

Some columns are editable. events are also handled in it.

I'm using SET_TABLE_FOR_FIRST_DISPLAY. While preparing the field catalog have set the 'COL_POS' each and every column.

The output is properly displayed but while downloading it to local file as spreadsheet, the data of all columns is not downloaded.

Anyone have an idea why is this happening?

BR,

Disha.

1 ACCEPTED SOLUTION

dani_mn
Active Contributor
0 Kudos

HI,

Try to use the method to download directly form the internal table you are using to display data in ALV.

Create a button in application tool bar for downloading and use the following code to download directly from internal table. It will download correctly.

data:  file type string,
       path type string,
       file_path type string.


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

check not file_path is initial.

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

Regards,

Wasim Ahmed

3 REPLIES 3

dani_mn
Active Contributor
0 Kudos

HI,

Try to use the method to download directly form the internal table you are using to display data in ALV.

Create a button in application tool bar for downloading and use the following code to download directly from internal table. It will download correctly.

data:  file type string,
       path type string,
       file_path type string.


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

check not file_path is initial.

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

Regards,

Wasim Ahmed

Former Member
0 Kudos

Hi Wasim,

Thanks a lot for the prompt reply..Your suggestion was helpful.

BR,

Disha.

former_member188685
Active Contributor
0 Kudos

Hi Disha,

in your Fieldcat did you specify the Correct tabname for all the columns ,and also it should be same.

fieldcat-tabname = <b>'IT_FINAL'.</b>

specify this for all columns and make sure you the tablename should be same.

Regards

vijay