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: 

Display more than 1023 Columns in alv

former_member226203
Active Contributor
0 Kudos

can we display more than 1023 columns in alv. please provide inputs on any approach that can be followed to achieve this.

Thanks.

7 REPLIES 7

Clemenss
Active Contributor
0 Kudos

Hi Kalyan,

as far as I remember I tried to do so using the SALV approach using class cl_salv_table and I could not find any limit. But I don't rember if I really tried thousands of columns.

But, by the way, I am curious: What is it good for? Who can read more than 1024 columns, you can't put them into excel, you can't print them, so why?

Kind regards

Clemens

Former Member
0 Kudos

Hi,

I believe there are no limitations. But the question is what you intend to do with the display ->

If you intend to :-

1. Print - check OSS Note 454462

2. Excel - check OSS Note 855314

Anoop

Clemenss
Active Contributor
0 Kudos

Hi,

just for the record. Here's the code to create a table with 10000 columns, in this example all of type vendor. It could be modified a little to create any dynamic table. Without any visible limits and can be displayed in SALV.

DATA:
    lv_lifnr       TYPE lifnr,
    lv_numc7       TYPE numc7,
    lt_components  TYPE cl_abap_structdescr=>component_table,
    lo_struc_descr TYPE REF TO cl_abap_structdescr,
    lo_tdescr      TYPE REF TO cl_abap_tabledescr,
    lr_tab         TYPE REF TO data.
  FIELD-SYMBOLS:
    <component>   TYPE LINE OF abap_component_tab,
    <range_tab>   TYPE STANDARD TABLE,
    <tab>         TYPE table.

* build dynamic table
  DO 10000 TIMES.
    APPEND INITIAL LINE TO lt_components ASSIGNING <component>.
    <component>-type ?= cl_abap_datadescr=>describe_by_data( lv_lifnr ).
    lv_numc7 = sy-index.
    CONCATENATE 'FIELD' lv_numc7 INTO <component>-name.
  ENDDO.
  lo_struc_descr    ?= cl_abap_structdescr=>create( lt_components ).
  lo_tdescr        = cl_abap_tabledescr=>create( lo_struc_descr ).
  CREATE DATA lr_tab TYPE HANDLE lo_tdescr.
  ASSIGN lr_tab->* TO <tab>.
  APPEND INITIAL LINE TO <tab>.

I discovered that it takes some time (15 seconds or more) to create, even F1 and F4 in the SALV table use considerable time to pop up, I think (SAP never imagined

But it works - and the code is so simple!

Kind regards,

Clemens

Former Member
0 Kudos

Deleted

former_member226203
Active Contributor
0 Kudos

solved

0 Kudos

I have 106 columns in my ALV report but when I download in excel file format that time data is not coming in proper format. some columns are coming into next line. Any solution for that?

Former Member
0 Kudos

Thank You Clemens...For this beautiful & simple code extract

Regards,

Tanmoy