2013 Jan 15 9:08 AM
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.
2013 Jan 15 9:27 AM
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
2013 Jan 15 9:41 AM
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.
2013 Jan 15 9:48 AM
Hi,
You mean to say that the output is displayed but only the column headers are displayed ?
Thanks,
Tooshar Bendale
2013 Jan 15 9:51 AM
Hi Tooshar,
Exactly, only column headers are displaying. I want to populate data into it.
Thanks.
2013 Jan 15 9:56 AM
This means that your internal table is empty.
Thanks,
Tooshar Bendale
2013 Jan 15 10:34 AM
Internal table is not empty, its loaded with around 3000 records.
2013 Jan 15 11:26 AM
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