Reputation: 575
I've been asked to change an ALV Grid report to ALV List Viewer. What I have found so far is that the only thing I need is to replace the REUSE_ALV_GRID_DISPLAY
function for REUSE_ALV_LIST_DISPLAY
(please correct me if I am wrong).
However, the report I need to change is using the cl_gui_alv_grid
class which does not use the functions above.
What can I do to change the report using cl_gui_alv_grid
? Or there is no way and I have to rewrite the code and use REUSE_ALV_LIST_DISPLAY
?
Upvotes: 0
Views: 3273
Reputation: 1
You can invoke the 'list output'-function in the toolbar of cl_gui_alv_grid
by calling set_function_code
as shown below.
DATA ucomm_list_output TYPE syucomm VALUE '&RNT_PREV'.
DATA alv TYPE REF TO cl_gui_alv_grid.
...
alv->set_function_code(
CHANGING
c_ucomm = ucomm_list_output
).
Upvotes: 0
Reputation: 10621
It is impossible with cl_gui_alv_grid
. You should use cl_salv_table
with list-display
parameter to accomplish this:
cl_salv_table=>factory(
EXPORTING
list_display = abap_true
IMPORTING
r_salv_table = o_alv
CHANGING
t_table = lt_table ).
Upvotes: 1