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 to Excel Export

Former Member
0 Kudos

Hi,

I want to export an ALV grid which has 88 columns to Excel Spreadsheet. The problem here I am facing is after 66 columns the heading and the relevant is going on the next row. I have tried searching SDN but found nothing in vain and finally posting this as a question.

The ALV is in OO.

4 REPLIES 4

Former Member
0 Kudos

Hi,

I think there is a limitation with export to excel with ALV, with large number of columns.

Some times ago I was also facing the same.

0 Kudos

So besides using the soltuion of adding a custom download button and using download to excel FM is there any other way out ?

Former Member
0 Kudos

Hi...

I check the problem which you are saying into my IDES.. And I created an ALV using OOPS.. which is having more than 255 columns.. and when I m exporting to Excel then.. it will export only 99 columns not 66.

Kindly check it. May be it will solve your problem.. coz.. you column is 88 only..

My code is :


PARAMETERS : vbeln TYPE vbak-vbeln.
types : begin of struct,
  vbak type  vbak,
  vbap type  vbap,
  end of struct.

data : itab type TABLE OF struct,
       wa type struct.

data obj TYPE REF TO cl_Salv_table.
data REF_FUNC TYPE REF TO CL_SALV_FUNCTIONS.

select * from vbak into CORRESPONDING FIELDS OF TABLE itab where vbeln = vbeln.

try.
call method cl_salv_table=>factory
*  exporting
*    list_display   = IF_SALV_C_BOOL_SAP=>FALSE
*    r_container    =
*    container_name =
  importing
    r_salv_table   = obj
  changing
    t_table        = itab
    .
 catch cx_salv_msg .
endtry.

REF_FUNC = obj->GET_FUNCTIONS( ).
REF_FUNC->SET_ALL( ABAP_TRUE ).

obj->display( ).

Thanks,

Jhings.

0 Kudos

This code works well in case CL_SALV_ALV using the FACTORY method but there is no integration between the class CL_ALV_GUI_GRID and FACTORY method. As most of the existing ALV reports have been using ALV_GUI_GRID so it is hard to change the entire logic.

Still no soluiton found for this thread.