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

ALV List using Classes

SG141
Active Participant
0 Likes
6,535

I am using CL_GUI_ALV_GRID for displaying the report in ALV Grid.

What are classes/methods used for displaying report in ALV List format.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
3,084

If you are running a release prior to NetWeaver 2004, then you must use the function module REUSE_ALV_LIST_DISPLAY. If you are on NetWeaver 2004 or 7.0, you can use the ALV object model class which allows you to force the list display.




REPORT zrich_0001.


DATA: ispfli TYPE TABLE OF spfli.

DATA: gr_table TYPE REF TO cl_salv_table.
DATA: gr_functions TYPE REF TO cl_salv_functions.

START-OF-SELECTION.

  SELECT * INTO TABLE ispfli FROM spfli.

  cl_salv_table=>factory(
    EXPORTING
      list_display   = if_salv_c_bool_sap=>true
    IMPORTING
      r_salv_table   = gr_table
    CHANGING
      t_table        = ispfli ).
  gr_functions = gr_table->get_functions( ).
  gr_functions->set_all( abap_true ).
  gr_table->display( ).

Regards,

Rich Heilman

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
3,085

If you are running a release prior to NetWeaver 2004, then you must use the function module REUSE_ALV_LIST_DISPLAY. If you are on NetWeaver 2004 or 7.0, you can use the ALV object model class which allows you to force the list display.




REPORT zrich_0001.


DATA: ispfli TYPE TABLE OF spfli.

DATA: gr_table TYPE REF TO cl_salv_table.
DATA: gr_functions TYPE REF TO cl_salv_functions.

START-OF-SELECTION.

  SELECT * INTO TABLE ispfli FROM spfli.

  cl_salv_table=>factory(
    EXPORTING
      list_display   = if_salv_c_bool_sap=>true
    IMPORTING
      r_salv_table   = gr_table
    CHANGING
      t_table        = ispfli ).
  gr_functions = gr_table->get_functions( ).
  gr_functions->set_all( abap_true ).
  gr_table->display( ).

Regards,

Rich Heilman

Read only

Former Member
0 Likes
3,084

hi

good

check this report in se38

BCALV_TEST_LIST

thanks

mrutyun^