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

Function module REUSE_ALV_GRID_DISPLAY_LVC

Former Member
0 Likes
2,634

Hi,

i have to display 500 columns in the output of the ALV, for that I found one program on SDN. With the help of that I can be able to see the columns 500. I want to insert the data for this code, please guide me how i can do that?

Below is the program.

 

DATA:lr_ref TYPE REF TO data.

DATA:cn(3) TYPE n.

DATA:fcat TYPE lvc_t_fcat,

ls_f LIKE LINE OF fcat.

 

field-symbols:<fs_tab> type table.

 

DO 500 TIMES.

cn = sy-index.

CONCATENATE 'C' cn INTO ls_f-fieldname.

ls_f-datatype = 'CHAR'.

ls_f-reptext = cn.

ls_f-intlen = ls_f-outputlen = '15'.

APPEND ls_f TO fcat.

ENDDO.

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = fcat

IMPORTING

ep_table = lr_ref.

 

assign lr_ref->* to <fs_tab>.

 

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'

EXPORTING

i_callback_program = sy-repid

it_fieldcat_lvc = fcat

 

TABLES

t_outtab = t_tab.

t_tab is assumed internal table.

Thanks.

7 REPLIES 7
Read only

Former Member
0 Likes
1,462

Hi,

Please post on what issue you are facing during display of the output in ALV.

Below is the sample code.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
       EXPORTING
            i_callback_program      = gd_repid
            i_callback_user_command = 'USER_COMMAND'
            is_layout_lvc               = gd_layout
            it_fieldcat_lvc             = it_fieldcat
            i_save                  = 'X'
       TABLES
            t_outtab                = t_tab

Thanks,

Tooshar Bendale

Read only

0 Likes
1,462

Hi Tooshar,

Sorry for the misundertanding.

Actually the code i have written is showing me 500 columns but i can't be able to pop up values in the output. If you want to output 500 columns with values then how you would change the above code?.

Assume t_tab as your internal table.

Read only

0 Likes
1,462

Hi,

You mean to say that the output is displayed but only the column headers are displayed ?

Thanks,

Tooshar Bendale

Read only

0 Likes
1,462

Hi Tooshar,

Exactly, only column headers are displaying. I want to populate data into it.

Thanks.

Read only

0 Likes
1,462

This means that your internal table is empty.

Thanks,

Tooshar Bendale

Read only

0 Likes
1,462

Internal table is not empty, its loaded with around 3000 records.

Read only

0 Likes
1,462

Hi,

In addition to your program code i have added data into the internal table <fs_tab>. Refer to the code. I can see the record that i have appended.

DATA: fieldname(20) TYPE c.
DATA: fieldvalue(10) TYPE c.
data : wa_flname(5) TYPE c.
field-symbols <fs_fldval> type any.
clear cn.

  DO 500 TIMES.
    cn = sy-index.
    CONCATENATE 'C' cn INTO wa_flname.
    CONCATENATE 'VALUE' index INTO fieldvalue.
    CONDENSE fieldvalue NO-GAPS.
    ASSIGN COMPONENT wa_flname OF STRUCTURE <fs_wa> TO <fs_fldval>.
    <fs_fldval> fieldvalue.
  ENDDO.

  APPEND <fs_wa> TO <fs_tab>.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = sy-repid
it_fieldcat_lvc = fcat
TABLES
t_outtab = <fs_tab>.

Let me know if it works ?

Thanks,

Tooshar Bendale